Post Reply 
Vietnamese snake puzzle - Closed
05-21-2015, 08:12 AM (This post was last modified: 05-21-2015 08:13 AM by Tugdual.)
Post: #11
RE: Vietnamese snake puzzle - Closed
Since I'm in Haskell at the moment, I gave it a go, it is quite a simple exercise.
For what it matters, I found 128 solutions instantly... wow.
Haskell code
Code:
import Data.List
[x | x <- permutations [1..9], (x!!0+13*x!!1/x!!2+x!!3+12*x!!4-x!!5-11+x!!6*x!!7/x!!8-10)==66]

Solutions
Code:

126478539
426178539
126478359
426178359
296351478
396251478
132956478
932156478
714965328
914765328
734165928
734165298
134765928
134765298
314279568
214379568
796152438
196752438
912567438
512967438
714965238
914765238
236179458
136279458
314279658
214379658
296351748
236179548
136279548
396251748
132956748
932156748
796152348
196752348
912567348
512967348
948567132
948567312
548967132
548967312
496158732
196458732
764859132
764859312
864759132
864759312
364958172
364958712
964358172
964358712
196458372
496158372
286941753
986241753
286941573
986241573
139478256
139478526
324851976
324851796
132458976
132458796
248179356
148279356
439178256
439178526
824351976
824351796
432158976
432158796
248179536
148279536
941527836
941527386
321547986
321547896
352148976
352148796
152348976
152348796
521347986
521347896
153942876
953142876
153942786
953142786
752849136
752849316
852749136
852749316
852147936
852147396
152847936
152847396
541927836
541927386
328651974
328651794
931625874
931625784
628351974
628351794
631925874
631925784
693521874
693521784
928765134
928765314
728965134
728965314
732859164
732859614
731526984
731526894
832759164
832759614
892315764
392815764
892315674
392815674
872539164
872539614
572839164
572839614
531726984
531726894
593621874
593621784
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Vietnamese snake puzzle - Dave Britten - 05-20-2015, 11:27 AM
RE: Vietnamese snake puzzle - Gerald H - 05-20-2015, 11:33 AM
RE: Vietnamese snake puzzle - Gerald H - 05-20-2015, 12:58 PM
RE: Vietnamese snake puzzle - Closed - Tugdual - 05-21-2015 08:12 AM



User(s) browsing this thread: 1 Guest(s)