This project is part of The Odin Project's Ruby course. The goal of this assignment was to create a command-line version of the classic game Tic Tac Toe. Two human players take turns marking a 3x3 grid, and the game checks for a winner or a draw after each move. This project was a great way to apply object-oriented programming (OOP) concepts like classes, instance variables, and methods.
The objective was to build a Tic Tac Toe game where two players could alternate turns marking the board, and the game would check for a win or draw after each move. By structuring the game into distinct classes, the project emphasized clean separation of responsibilities and maintaining the game loop until a victory or draw condition was met.
-
Allows two human players to play against each other in the terminal.
-
Displays the game board between turns.
-
Players can input their row and column coordinates to mark their symbol (
X
orO
). -
Checks for win conditions across rows, columns, and diagonals.
-
Detects when the game results in a draw.
-
Object-Oriented Programming: Practiced structuring code using classes, instance variables, and methods for game logic.
-
Game Logic Development: Improved my ability to develop and implement rules for checking win conditions and handling edge cases like a draw.
-
User Input Validation: Gained experience in validating player inputs and handling errors.
-
Looping and Condition Handling: Strengthened my understanding of loop structures for maintaining the game flow until a result is reached.
- Ruby for implementing the Tic Tac Toe game logic and user interactions.
- The Odin Project: For providing the project outline and guidance.