Morpion solitaire: Difference between revisions

Content added Content deleted
Line 386: Line 386:
play =: 3 : 0
play =: 3 : 0
OUTPUT =: y
OUTPUT =: y
NB. save the random state to replay a fantastic game.
RANDOM_STATE =: '(9!:42 ; 9!:44 ; 9!:0)' ; (9!:42 ; 9!:44 ; 9!:0)''
RANDOM_STATE =: '(9!:42 ; 9!:44 ; 9!:0)' ; (9!:42 ; 9!:44 ; 9!:0)''
if. 0 < # OUTPUT do.
if. 0 < # OUTPUT do.
Line 391: Line 392:
smoutput 'RANDOM_STATE begins as' ; RANDOM_STATE
smoutput 'RANDOM_STATE begins as' ; RANDOM_STATE
end.
end.
NB. save the random state to replay a fantastic game.
TURN =: _1 NB. count the number of plays. Convergence requires 1 extra attempt.
TURN =: _1 NB. count the number of plays. Convergence requires 1 extra attempt.
GRID =: morpion GREEK_CROSS NB. play the game
GRID =: morpion GREEK_CROSS NB. play the game