robbiebarrat / unbeatable_tictactoe

Unbeatable Tic Tac Toe playing algorithm written in python 2.7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Picking random corners on the second turn

sahil231090 opened this issue · comments

Look at the history of the game below

Welcome to Tic Tac Toe!
The board is set up like this:
0|1|2
3|4|5
6|7|8
Enter your first move, 0 through 8. (You are O's, the AI is X's)
||_
||_
| |
Turn: PLAYER
Enter a number 0-8: 7
||_
||_
|O|
Turn: AI
||_
|X|
|O|
Turn: PLAYER
Enter a number 0-8: 5
||_
|X|O
|O|
Turn: AI <- THE AI picks a random corner
X|
|_
|X|O
|O|
Turn: PLAYER
Enter a number 0-8: 8
X|
|_
|X|O
|O|O
Turn: AI
X|
|X
|X|O
|O|O
Turn: PLAYER
Enter a number 0-8: 6
Human wins. Did you cheat?
Here is the final board.
X|
|X
_|X|O
O|O|O
An exception has occurred, use %tb to see the full traceback.

SystemExit: 0