Questions tagged [pattern-matching]

For challenges about matching a particular pattern or patterns.

Filter by
Sorted by
Tagged with
14 votes
13 answers
872 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 ...
user avatar
  • 34.8k
8 votes
0 answers
255 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 ...
user avatar
9 votes
1 answer
184 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: ...
user avatar
  • 30.5k
15 votes
4 answers
322 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:...
user avatar
  • 30.5k
17 votes
7 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 ...
user avatar
8 votes
3 answers
383 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 ...
user avatar
  • 8,107
18 votes
7 answers
1k 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 ...
user avatar
  • 8,107
22 votes
6 answers
2k 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 ...
user avatar
  • 99.5k
-1 votes
1 answer
144 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 ...
user avatar
  • 21
15 votes
25 answers
4k views

Making Sandwiches

Introduction Bob runs a deli. His deli serves sandwiches to its customers. However, it is a bit unusual. At Bob's deli, instead of telling Bob what they want, customers show Bob an ASCII art drawing ...
user avatar
  • 2,045
19 votes
4 answers
1k views

Pentomino 6x10 solution normalizer

As you most probably now, there are 2339 solutions to pentomino puzzle in a 6x10 grid. There are different labeling schemes for the 12 pentominoes, two of them are shown on the image below: Image ...
user avatar
  • 20.5k
37 votes
28 answers
12k views

Java is to JavaScript as Car is to Carpet

Title stolen inspired by Greg Hewgill's answer to What's the difference between JavaScript and Java? Introduction Java and JavaScript are commonly used languages among programmers, and are currently ...
user avatar
368 votes
1 answer
115k views

Regex that only matches itself

There are some pretty cool challenges out there involving regex (Self-matching regex, Regex validating regex) This may well be impossible, but is there a regex that will ONLY match itself? NOTE, ...
user avatar