Tic Tac Toe

Line: Input Line
Hard Difficulty Learning Outcome One Learning Outcome Three Learning Outcome Four Exercise
Type: Exercise
You should have completed:

White Box

This topic leads to:

This is the end of the line.

Summary

The game of noughts and crosses, or tic-tac-toe is a common childhood game. In this exercise, you will design a two player computer version of this game.
Each player is asked in turn where they want to place their next piece, they can identify one of the nine possible locations on the game board as shown below.

After they have entered their move the game will print out the current state of the board and ask the next player for their go.
If either player enters 0 for their move, they concede the game.  The game should then congratulate the winner and end.

It is suggested that you write some methods for this program.  For example, you may have a method to:

Task

  1. Create a console application to play a two player game of tic tac toe as above.

Questions

  1. How would the program work out if one player has won?