Questions tagged [pattern-matching]
For challenges about matching a particular pattern or patterns.
19 questions
7
votes
7
answers
835
views
Translate BBCode into HTML
BBCode is a markup language commonly used in webforum software in the 2000s and 2010s. Your task is to write a program or function that translates BBCode to HTML according to the following spec. (...
8
votes
6
answers
1k
views
Counting the sequences
I was thinking when SQL can be less verbose than traditional programming languages and came up with this challenge.
Input
Natural number N
Generating data
We ...
4
votes
2
answers
238
views
Ragged list pattern matching, Part 2
This is a sequel to Ragged list pattern matching. In this challenge, the wildcard may match a sequence of items of any length instead of just a single item.
Given a pattern and a ragged list of ...
12
votes
2
answers
747
views
Classify a surface from its fundamental polygon
This question is an extension of Who's that Polygon? to arbitrary numbers of sides.
A fundamental polygon for a surface is an polygon with a prescribed pairing for all its \$2n\$ sides, each ...
9
votes
5
answers
503
views
Next Time Of Given Pattern
Introduction:
Some times using a 24-hour clock are formatted in a nice pattern. For these patterns, we'll have four different categories:
...
4
votes
3
answers
1k
views
Python: can I shorten this code further for checking substrings
So the golf question was like this:
You are given a number T and then a total of T number of 17-character strings. For each of ...
15
votes
14
answers
1k
views
Ragged list pattern matching
Given a pattern and a ragged list of positive integers, your task is to decide whether the pattern matches the ragged list.
The pattern is also represented by a ragged list. But in addition to ...
10
votes
1
answer
424
views
Counting overlapping objects
Consider a NxN pixel grid with up to M objects drawn on it, either squares or diamonds:
square
diamond
The objects may overlap, so recognition is hard. The task is to give the minimal possible ...
8
votes
1
answer
246
views
Is this continuous terrain? Part II
Caves and Cliffs edition
Part 1, Very related
You're given a piece of ASCII art representing a piece of land, like so:
...
15
votes
4
answers
415
views
Sides of a polygon
Given an ASCII-art shape made of the characters /\|_, your challenge is to return the number of sides it has.
A side is a straight line of one of those, for example:...
18
votes
9
answers
2k
views
But, Is It Art?
But Is It Art? is an esolang created by ais523, where one step is break the program into orthogonally connected "tiles":
A BBBB
A B B
AA CC
A CC
Each ...
9
votes
4
answers
561
views
Patterns in Permutations
This fastest-code challenge is based partly on this MSE question and exists to extend some OEIS sequences, and create others. If I extend or create sequences based on this challenge, I'll link to this ...
20
votes
8
answers
2k
views
Matching ABACABA-type patterns
(This challenge is related to the challenge "Generate the Abacaba sequence.")
Zimin words (also called "sesquipowers") are an important idea in the subject of "combinatorics ...
27
votes
9
answers
3k
views
The matrix has U
Given a matrix of size at least 3×3 formed by positive integers, determine if it contains at least one "U" pattern, defined as
...
-2
votes
1
answer
182
views
Symbol Search Deleter [rephrased] [closed]
Your challenge is to parse nonsensical text and output a "congruous phrase" - which I shall define here to be text with any contiguous characters in between, and including, a given set of like symbols ...