Noughts and Crosses

The game starts off as a blank board always allowing the user to go first. I constructed the board using tutle, a python libary that allows you to draw on the python window. However to determine where the moves are stored after clicking on the square I used a 3d array, this meant the game moves could easily be calculated to work out if the user has one or where the ai can place to try and block the user.

After chooosing the first move, the ai straight away takes there move. To draw the noughts and crosses I used the same size each time, for each move the position is validated each time to make sure something isn't already placed there. This is why the use of the 3d array is so good as the moves can be tracked easily.

The code checks the board to see if there is three in a row, if thereis a line is drawn straight through the three in a row. After is asks the user if they want to play again or stop.