Re: Generating Puzzle Solutions



Ovid wrote:

>
> Anyone care to try their hand at a Prolog solution so I can try to
> convert it to AI::Prolog?
>

Here is a program that you can try with SWI Prolog to generate
admissible strategies:

http://stud4.tuwien.ac.at/~e0225855/oddball.pl

I used it to find (fixed) strategies in addition to those posted on
Perlmonks. I copied the first two rounds from their solution and limited
the search to the last round (line 139f.) for illustration.

You can test whether a given strategy lets you infer the odd ball and
its quality in all cases:

?- Strategy = [[5, 6, 8, 10]-[7, 9, 11, 12], [2, 3, 4, 7]-[5, 6, 11,
12], [1, 2, 5, 7]-[4, 9, 10, 12]], test_strategy(Strategy).

State [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] OK
State [0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] OK
State [0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0] OK
.... etc.


Best regards,
Markus.
.