Caml1999O004"Tq)*g18!8!l18!8! Y@8#Z(2&)*8!8! 8 !8! 8! 8!? @@ 8! 8!68!C8!8!58!D8!8!58!c8!C8!8! D8!8! Y#58!@8!c8!@  8#Z( )*7?h? C8! IT%\C C C"TC C" IC8! IC8!C C8 "UcC%)*8! 8&58!8!h8" i8"68!8!58!8! }V 58!T }V 58!T58!58%+ +66 ,,+=h8!c8!7O8d8^6 ^V#5 ^V5 ^V 58!T "T  "T "TB58!58!58!58!58!58!58!58!58!58!c8!   >9Y|,$P$Main^F$unit@@@N O A@A#int@@@@@@B$char@C&string@D%float@E$bool@@@%false@$true@@@@F$unit@@@"()@@@@G#exn@@@@@@H%array@Р@J@A@@AA@I$list@Р@K@A"[]@":: @@L@@@A@@J&format@Р@O@N@M@C@@AAAAAA@K&option@Р@P@A$None@$Some @@@A@@L)nativeint@XM%int32@ZN%int64@\Y.Assert_failureAb@@Bl@@@@V@V0Division_by_zeroA@U+End_of_fileA@T)Sys_errorA@X.Sys_blocked_ioA@S)Not_foundA@R'FailureA@Q0Invalid_argumentA@W.Stack_overflowA@P-Out_of_memoryA@O-Match_failureA%!"@W@@*PervasivesAq.print_gameover@ I$list@@%PieceA%piece@@q+@@*@@)qqq@@Rqq@u,human_player@(@%PieceA%piece@@uW6I$list@@@~@@}ueu] u^_uXYuV@x/randcomp_lambda@}@@x@y.comp_firstgood@@@y@z/randcomp_player@^@%PieceA%piece@@zjI$list@@@@@z zz@0randcomp2_player@$@@Dְ!$@@@@԰ @J(gameloop@ @%PieceA%piece@@yJzJWJ[@%BoardA%board@@(J^ JPJ_`J\]Jǰ)(Jg/JjJklJhiJ@@J JJ@@D@@AIG@@B@@ABA@@mF@@AC@@E@@ABC@@G@$<I@@O AG@$$@@O AG@$ ؐ@@O A$G@$@@O A+G@$e@@O A2G@$,@@O A9G@$@@O A@G@$א@@O AGG@$|@@O ANG@$d@@O ܐAUG@$Le@AWG@$<B[Y@X@O%match@H@@ABC[ZD@@H@$,n@A H@$$O BH@$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@@A 4G@$@@A';G@$Y@@A0DG@$S@@A7KG@$>@A9MGA$8AA=@@ABCF $p@ADFA$lAAH@@AB CE $\@AOE@$< A#int@@@@A@CAZ@BCE@$(IE@@@<@Af D@$@AhDA$AAl@@A2BC$[AtC@$x@Av CA$EAAz@@@ABB$DI$list@v@@@@@ƐAB@$@@B@$ @A{&player@zz@|%board@zz@}$loc1@F@@zǠJ@@z@zz{@~$loc2@A@@zʠE@@z@zz{@@-A@@P#exn@E@@AB+C@@D@@A=B@@BC@@1@@@AE@$K }CG@@A C@ H@$hR @ALDA$dV AAP @@AB@C$T] 򐰕n@@{{A] C@$Df @A_CA$|j AAc@0@(@AB@'B$lq @@{{Ap B@$Tz @@rB@@2$$MainP@&RandomA`@$GameAp@&RandomAH@$GameAX@$GameA@"IoAԠ@$ListA䠠@&LambdaA@&LambdaA@*PrimitivesA@%PieceA0@&LambdaA`@&LambdaAt&ANS: (@*PervasivesA@*PrimitivesA ", Ġ̠@*PrimitivesA䠠!)$ ' @*PrimitivesA8@$GameAH@*PrimitivesA`@$GameAp'CMove: D@$GameALȠ@$GameA@%BoardA(@$GameAP@%PieceAР@%BoardA𠠑@$GameA@%BoardAP@%HumanAh-FINAL BOARD: |}@%BoardA@$GameA@$GameAȠ6Game over. X's score: ؠࠠ, O's score:   ) X wins!DL) O wins!x$Tie!"  0let rr = \\(primpair (rand 49) (rand 49)); rr;蠠  let true = \\#1; let false = \\#0; ' If conditional let if = \b.\x.\y.b x y; ' Fixpoint operator for recursion let fix = \f. (\x.f (x x)) (\x.f (x x)); ' Find a piece of _player_, starting at _pos_, using the ' _board_at_ algorithm for reading the board let find_piece = fix (\self.\pos.\player.\board_at. if (equ (board_at pos) player) (pos) (self (add pos 1) player board_at) ); ' Find the first piece for _player_ let firstgood = \player.\board_at. ((\a.primpair a (sub a 1)) (find_piece 0 player board_at)); let int_to_x = \n. mod n 7; let int_to_y = \n. div n 7; ' Find the distance between a and b let dist = \a.\b.abs (sub a b); let distance = \a.\b. let x = (dist (int_to_x a) (int_to_x b)) in let y = (dist (int_to_y a) (int_to_y b)) in if (gt x y) (x) (y); ' and let and = \a.\b. if a (if b b false) false; ' Do a random (legal) move let rand_move = let a = rand 49 in let b = rand 49 in fix (\self.\player.\board_at. if (and (equ player (board_at a)) (equ 0 (board_at b))) (primpair a b) (self player board_at) ); ' find first legal move from pos let findlegal = fix (\self.\pos.\cur.\board_at. ' if (lt cur 49) if (lt cur (add pos 16)) ( if (and (lt (distance pos cur) 3) (equ (board_at cur) 0)) (cur) (self pos (add cur 1) board_at) ) (50) ); let get_first_legal_move = fix (\self.\player.\pos.\board_at. let me = (find_piece pos player board_at) in let tospot = (findlegal me 0 board_at) in if (lt tospot 50) (primpair me tospot) (self player (find_piece (add me 1) player board_at) board_at) ); let getfirstlegal_wrapper = \player.\board_at. get_first_legal_move player 0 board_at; ' Run the firstgood 'firstgood; ' Run the random move 'rand_move; ' Run the firstlegalmove algo getfirstlegal_wrapper; 𠠑@&RandomA4@*PrimitivesAH@#SysAX@#SysAx.array_get_addr!2/string_notequal%2rand $randĠР3Error. Bad option. ࠠ蠠=Ataxx GP Simulation Program PX'Usage: h#p0 ataxx option ,)Options: 5 2 - human vs human > # 2rand - randcomp vs randcomp ȠGР $ smart - human vs smartcomp ࠠP蠠 # s_vs_r - smartcomp vs randcomp Y $ s_vs_s - smartcomp vs smartcomp b ! test - Do some random test (k0nD@A@0Bg!8Iܠ*Primitives0, ]a>}Sx&Stream0 sQyp%Human04ݚ%a..X%Array0Nt\=k1 -&Parser0hqjΐc&Lexing0+g?H[@΢Qݠ$Unix0ߧ<G]2#Sys0eō 68ըe&Lambda0$%/-7zDw%Lexer0QI}VmZ˻0"Io0<}6|nv4u%Piece0KOkhW*Pervasives0"2AC 迠&Random0h)^"Ճݠ%Board0gOذuv'Im$List0϶OA>:$Game0\۶Np@@@m