in reply to Re^3: My first cpan module - App::ForKids::LogicalPuzzleGenerator
in thread My first cpan module - App::ForKids::LogicalPuzzleGenerator
But the example given in the OP should be solvable by filling 3 zeros for each clause and applying simple deduction rules on the 3x3 cuts.
I think the strength of prolog comes to play if you apply more complicated rules.
Please don't take this as a critic of your work, just theoretical observations. :)
Applying the rules given on a 3x3x3 matrix displayed by 3 cuts by name:
FRUITS PROFESSIONS NAMES W B F pineapples apples 0 0 John pears 0 0 0 pineapples 0 apples 0 0 0 Patrick pears 0 pineapples 0 0 0 apples 0 0 0 James pears 0
Deductions:
FRUITS PROFESSIONS NAMES W B F pineapples 0 0 0 apples 1 0 0 John pears 0 0 0 pineapples 0 apples 0 0 0 Patrick pears 0 pineapples 0 0 0 apples 0 0 0 James pears 0 0
Deductions:
FRUITS PROFESSIONS NAMES W B F pineapples 0 0 0 apples 1 0 0 John pears 0 0 0 pineapples 0 0 apples 0 0 0 Patrick pears 0 0 0 pineapples 0 0 0 apples 0 0 0 James pears 0 1 0
I did it manually, hope everything is right and I made the technique of a solver clearer.
I think you need more complicated rules to challenge people and take advantage of the power of prolog. :)
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: My first cpan module - App::ForKids::LogicalPuzzleGenerator (3D)
by LanX (Saint) on Feb 24, 2018 at 09:42 UTC |