Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,8 +1,7 @@
|
|||
b::2 9#0 / the board
|
||||
WINMASKS::((9#2)\)'7 56 448 73 146 292 273 84 / winning trios
|
||||
fin:{`0:x," won";`exit 0}
|
||||
b::2 9#0; WINMASKS::((9#2)\)'7 56 448 73 146 292 273 84 / the board and winning trios
|
||||
{1}{({`1:"MOVE: ";$[(|/b)m:(`I$-1_1:`)-1;o`0:"NO";b[0;m]::1]} / your move
|
||||
{b[1;(|/b)?0]::1})[x;0] / cpu's move
|
||||
x{`0:" "/'`c$3 3#|/"XO*"*b,,~|/b}/0 / show board after cpu moves
|
||||
$[+/3=0^WINMASKS(+/&)\:b x;fin "XO*" x;511=2/|/b;fin"the cat"] / test win
|
||||
{b[1;*1?&~|/b]::1})[x;] / cpu's move
|
||||
x{`0:" "/'`c$3 3#|/"XO*"*b,,~|/b}/0 / show board after each move
|
||||
w:|/3=0^WINMASKS(+/&)\:b x;t:511=2/|/b / test win and tie conditions
|
||||
$[w|t;{`0:x," won";`exit 0}("XO"x;"the cat")t;] / when game is over, exit and print winner
|
||||
~x}/1 / now it's other player's turn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue