"Tic-tac-toe, also called noughts and crosses (in the British Commonwealth countries), X's and O's (in Ireland) and X and 0 (in India) is a pencil-and-paper game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The X player usually goes first. The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game." (Wikipedia)
Create a basic tic-tac-toe game for the console. The game should work as follows:
- Output a board in the following format:
1 2 3 1 | | ---+---+--- 2 | | ---+---+--- 3 | |
No other board format will be accepted. You must number the rows and columns, not each box.
- Ask the user for a row and column number.
- Put the appropriate symbol for that player (X or O) in the specified spot.
- Repeat for the next player until someone has won the game.
- If someone has won, announce which player won and exit.