Questions tagged [connected-figure]

Challenges for which the input, output, and/or source contains an ascii connected map or graph.

Filter by
Sorted by
Tagged with
33
votes
8answers
2k views

Connect the Three Kingdoms

You are a medieval overlord tasked with designing a road network between three kingdoms placed on a \$9 \times 9\$ grid. A sample placement of kingdoms might look like this: Non-commercial use of ...
32
votes
6answers
2k views

Slash the matrix

You are given a matrix of forward and back slashes, for instance: //\\ \//\ //\/ A slash cuts along the diagonal of its cell corner-to-corner, splitting it in ...
23
votes
2answers
479 views

Connecting letters

You should write a program or function which receives a block of chars represented as a string and outputs or returns a similar string in which the letters adjacent in the alphabet are connected. A ...
10
votes
5answers
2k views

How many trees in the Alphabet Forest?

Inspired by the connection rules from Calvin's Hobbies' question Make me an alphabet tree take a number of lines of letters as input and output the number of distinct connected trees it represents. ...
7
votes
3answers
2k views

Polyomino generator

Write a program that prints the shapes of one-sided polyominoes. Given input 4 (tetrominos), a sample output would be: ...
8
votes
8answers
513 views

Is this figure connected?

You are given a list of (x,y) grid coordinates. Your function should decide whether the figure obtained by coloring in the squares of the grid with the given ...