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
463 views

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, ...
emanresu A's user avatar
  • 37.8k
34 votes
8 answers
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 ...
Sisyphus's user avatar
  • 14.8k
32 votes
6 answers
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 ...
ngn's user avatar
  • 15.3k
23 votes
2 answers
515 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 ...
randomra's user avatar
  • 20.9k
10 votes
5 answers
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. ...
trichoplax is on Codidact now's user avatar
8 votes
3 answers
2k views

Polyomino generator [closed]

Write a program that prints the shapes of one-sided polyominoes. Given input 4 (tetrominos), a sample output would be: ...
ralu's user avatar
  • 291
8 votes
8 answers
548 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 ...
Keith Randall's user avatar