Tents and Trees Puzzle

"Daily tents" / Trees and / Tents (?) logic puzzle solver (explanation of puzzle). Solving in fdq, a Finite Domain Constraint Solver By Peter van der Zee, © pvdz.ee, September 2017.

Back to puzzle list

Given a 10x10 grid and some trees (cells with a 1 turn green), for each tree, assign one tent orthogonal to that tree. Tents cannot touch each other, not even diagonally. Numbers to the side indicate how many tents occur in that row or column.

Cell value legend: 0=empty, 1=tree, 2/3/4/5= tent belonging to tree below/left/up/right. Press load buttons for examples:)

(Trying to load library)









Input dsl:

Output:

Import:
Export:

Note: Solving won't work in Edge and Safari until they support TextEncoder (or when the standards committee grace us with a simpler method of converting string to Uint8Array, whichever comes first).

Firefox ... sometimes works. It seems to handle Uint8Array slightly different from v8 which might cause binary desyncs :'( ymmv