Tic-tac-toe: Difference between revisions

Content added Content deleted
No edit summary
Line 4,453: Line 4,453:
When the user clicks on the grid, this generates an event that is handled by the program. The mouse click coordinates are converted to a cell coordinates and a large X is placed in the box. At this point program tests if this resulted in a win. Next it calculate the computer's response and it checks to see if the computer won. The process is repeated until there is a winner or a draw.
When the user clicks on the grid, this generates an event that is handled by the program. The mouse click coordinates are converted to a cell coordinates and a large X is placed in the box. At this point program tests if this resulted in a win. Next it calculate the computer's response and it checks to see if the computer won. The process is repeated until there is a winner or a draw.


[[File:DelphiTicTacToe.png|frame|none]]



<syntaxhighlight lang="Delphi">
<syntaxhighlight lang="Delphi">
Line 4,736: Line 4,736:


</pre>
</pre>



=={{header|EasyLang}}==
=={{header|EasyLang}}==