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
13 votes
4 answers

Road golf through the mountains

You have a bunch of cities on a grid which you wish to link up. Roads can be placed on any tile that doesn't contain a city, and connect to all roads or cities adjacent to them, vertically, ...
user avatar
  • 31.6k
34 votes
8 answers

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 ...
user avatar
  • 12.3k
32 votes
6 answers

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 ...
user avatar
  • 14.7k
23 votes
2 answers

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 ...
user avatar
  • 20.6k
10 votes
5 answers

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. ...
user avatar
  • 10.7k
8 votes
3 answers

Polyomino generator [closed]

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

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 ...
user avatar