Skip to content

Instantly share code, notes, and snippets.

@lessandro
Last active December 13, 2015 18:59
Show Gist options
  • Save lessandro/4959740 to your computer and use it in GitHub Desktop.
Save lessandro/4959740 to your computer and use it in GitHub Desktop.
Write me a tic tac toe game.
The grid coordinates should be:
1 2 3
4 5 6
7 8 9
The program should run like this:
Player X turn: 5 (<<< USER INPUT HERE)
. . .
. X .
. . .
Player O turn: 4
. . .
O X .
. . .
Player X turn: 1
X . .
O X .
. . .
Player O turn: 4
Invalid position!
Player O turn: 6
X . .
O X O
. . .
Player X turn: 9
X . .
O X O
. . X
X won!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment