Tic-tac-toe: Difference between revisions

m
→‎{{header|Tailspin}}: use tagged identifiers
m (→‎{{header|Tailspin}}: use tagged identifiers)
Line 13,377:
<lang tailspin>
processor Tic-Tac-Toe
@: [1..9 -> (position:$) -> $::value];
 
source isWonOrDone
Line 13,387:
when <~=[]> do $(1) !
\) !
when <[<=$(first)::raw>+ VOID]> do '$(first); wins!'!
end isWonOrDone
 
Line 13,395:
 
templates move
when <?($@Tic-Tac-Toe <[<=($.position>]) <position>)> do @Tic-Tac-Toe($.position): $.mark;
$ !
otherwise
Line 13,420:
[{mark: $@play, position: $IN::readline -> toInt} -> board::move] -> #
otherwise
$(1) !
end getMove
 
Anonymous user