robbiebarrat / unbeatable_tictactoe

Unbeatable Tic Tac Toe playing algorithm written in python 2.7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash when wrong field number is taken

Kaligule opened this issue · comments

number that are not in range(-9,9) let the programm crash.

Fixed it.
Now it makes sure that the number the human enters is between zero and eight, and that it is an integer.

Thanks.
You could additionaly add a test weather the input is empty, so if nothing is entered you get a different message. This might help: http://stackoverflow.com/questions/7896495/python-how-to-check-if-a-line-is-an-empty-line

Hey -- thanks for the link -- it should work now. If you have any more suggestions on what I could do to make the program better I'd love to hear them.