Study the following concepts and topics
1. Control / Conditional Structures - if, if else, switch
2. Repetition Structure - while, for, do-while
3. array , 2D array
4. User-defined Functions
Create a command prompt Tic-Tac-Toe game. Game should print the playing board like this.
1 2 3 4 5 6 7 8
|
1 2 3
1 X | O | X
---------
2 O | X | O
---------
3 X | O | X
|
Then, you will program the game for 2 human players (Programming computer AI may be a bit difficult for you at the moment).
You will prompt them to enter their names first and then the marker they would like to use. If the first player chooses X, then the second player should accept O by default and vice versa.
The board will be blank at the start, of course. For each player turn, you will ask them to enter the coordinate at which they would like to place their marker (For example, Enter "1 3" to play Row 1 Column 3). Then, you will update the board accordingly and print the board.
This will continue until a player wins or the board is completely full (This requires you to code the win condition).
At the end of the game, you will announce who the winner is or announce that the game is a draw.
EDIT: If you create this game successfully, save the code because you will modify your game as you learn more C++
Once you learn class, inheritance and operator overloading, you will create an Abstract Data Type for Board, Game, and Player. You will basically reorganize your code.
Once you learn some advanced algorithms, you will create an effective computer AI that never loses to human (They can draw).