Anonymous user
Tic-tac-toe: Difference between revisions
m
{{out}}
m (Added Common Lisp) |
m ({{out}}) |
||
Line 1:
{{task|Games}}
Play a game of [[wp:Tic-tac-toe|tic-tac-toe]].
Ensure that legal moves are played and that a winning position is notified.
=={{header|Ada}}==
Line 128 ⟶ 129:
end Tic_Tac_Toe;</lang>
{{out}}
<pre>
> ./tic_tac_toe
Line 438:
</lang>
<pre>
Bic Bash Bow
Line 766:
//--------------------------------------------------------------------------------------------------
</lang>
<pre>
1 | 2 | X
Line 1,028:
}</lang>
{{out}}
<pre>Welcome to Rosetta Code Tic-Tac-Toe for C#.
1 | 2 | 3
Line 1,167:
</lang>
{{out}}
<pre>CL-USER> (tic-tac-toe)
Shall a computer play as X? (y/n)
Line 2,424:
putStrLn "Player X always begins."
</lang>
{{out}}
Player X is computer, O is human.
<pre>
Line 4,596:
((not (myMove)) "No moves")
((find3 0) "Sorry, you lost!") ) )</lang>
{{out}}
<pre>: (main)
+---+---+---+
Line 5,082:
print('\nA draw')</lang>
{{out}}
<pre>
Tic-tac-toe game player.
Line 5,724:
<br>The '''LINESIZE.REX''' REXX program is included here ──► [[LINESIZE.REX]].<br>
<br>(a negative 3 indicates a grid of <tt> 3x3 </tt> and that the computer should play first.)
<br><br>Note: the user input is shown along with the program output.
Line 5,836:
─────────────────────────── The computer (O) won. ───────────────────────────
</pre>
<br>(which indicates a grid of <tt> 5x5 </tt> and that the marker for the human is an ASCII hex db [█].)
<pre style="height:80ex">
Line 6,110:
Game.new(*players_with_human).play</lang>
{{out}}
<pre>
Computer0 goes first.
Line 6,368:
}</lang>
<pre>
1 2 3
|