Skip to content

Instantly share code, notes, and snippets.

View odyniec's full-sized avatar

Michał Wojciechowski odyniec

View GitHub Profile
@salva
salva / interactive-session.prolog
Last active May 5, 2016 20:37
Michał Wojciechowski's puzzle (blogs.perl.org/users/michal_wojciechowski/2016/05/brutally-solving-a-logic-puzzle-with-perl-6.html)
$ swipl
?- ["puzzle.prolog"].
true.
?- S = [_, 3, 17, 5, _, _, 13, _, 7], puzzle(S, O).
S = [41, 3, 17, 5, 23, 19, 13, 11, 7],
O = [61, 47, 31, 59, 37, 43, 71, 53, 541] ;
S = [11, 3, 17, 5, 41, 37, 13, 23, 7],
O = [31, 83, 43, 29, 67, 61, 59, 71, 601] ;