in reply to TicTacToe Code Help.
# cls();
You clear the screen too soon. You should store the results in a variable, then print after the cls.
Also, the game continues even if someone wins. You need an exit condition.
I got a draw with this sequence: 123465798
See also: Basic debugging checklist
Check out Conditional Operator for assigning to $player.
|
|---|