Welcome to the 3x3 Grid Game, a console-based C++ project developed as part of my Programming in C++ module during my first year of study. This engaging two-player game recreates the classic 3x3 grid gameplay, where players take turns making strategic moves until one player wins or the game ends in a draw.
Module Grade: 79/100
-
Player 1's Turn:
- Prompted to enter two numbers representing their move coordinates.
- Input is validated to ensure it falls within the acceptable range.
-
Player 2's Turn:
- Similarly prompted for their move coordinates with the same validations.
-
Game Loop:
- The game continues alternating turns until a winning condition is met or the grid is full resulting in a draw.
-
Enter Move:
Players input their chosen grid coordinates during their respective turns. -
Range Validation:
The program checks whether the entered coordinates are valid and within the 3x3 grid boundaries. -
Play Piece:
The program confirms the chosen spot is unoccupied before placing the player's piece. -
Board Display:
After each move, the updated game board is displayed in the console. -
Winning Condition Check:
Following every move, the program evaluates if the current player has achieved three in a row, column, or diagonal.- If a winning condition is met, a victory message is shown.
-
Draw Condition Check:
If the grid is filled without any player winning, the game ends in a draw and an appropriate message is displayed.