Takuzu - Solve Binary Puzzle

117 views
Skip to first unread message

Wietze Brandsma

unread,
Mar 31, 2018, 2:20:09 PM3/31/18
to SWI-Prolog
Takuzu - Solve Binary Puzzle

Attachment: takuzu.pl

Can be used with SWISH: http://pengines.swi-prolog.org/apps/swish/

takuzu.pl

alecbrainstone

unread,
Apr 5, 2018, 9:54:01 AM4/5/18
to SWI-Prolog
How can I generate a puzzle with random filled fields, with only one solution and the less filled fields possible?

Wietze Brandsma

unread,
Apr 7, 2018, 6:02:09 PM4/7/18
to SWI-Prolog
Generate Random Takuzu - Binary Puzzle

First generate a Puzzle Solution, by solving an empty grid.
Next use random labeling, pick the first solution.
Then optimize redundancy in the Puzzle using a 'simple' solver, pick the first solution.

The 'simple' solver here is an implementation of a selection of the rules, which tries to solve the puzzle row by row.

Attachment: takuzu_generate.pl

takuzu_generate.pl
Reply all
Reply to author
Forward
0 new messages