Skip to content

Welcome to the Tic-Tac-Toe Game repository! It's a solo project, currently in the initial phase with console output. Future updates will bring an interactive graphical user interface. Stay tuned for more!

Notifications You must be signed in to change notification settings

Thewealth-soft/TicTacToe-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Tic-Tac-Toe Game

This is a simple command-line implementation of the classic Tic-Tac-Toe game written in JavaScript. It allows two players to take turns marking X and O on a 3x3 grid until one player wins or the game ends in a tie.

How to Play Rules
1. Clone or download the repository to your local machine. 1. The game is played on a 3x3 grid.
2. Open a terminal or command prompt and navigate to the project directory. 2. Players take turns to mark an empty cell with their respective symbol (X or O).
3. Make sure you have Node.js installed on your machine. 3. The first player to get three of their symbols in a row (horizontally, vertically, or diagonally) wins the game.
4. Run the game using the following command: node ticTacToe.js 4. If all cells are filled and no player has won, the game ends in a tie.
5. The game will display an empty Tic-Tac-Toe board with cells represented by numbers from 0 to 2 for rows and columns.
6. Players take turns entering the row and column of their desired move when prompted.
7. The game will notify if the move is valid or ask you to try again.
8. The game continues until one player wins or the game ends in a tie.

Commands

Enter row (0, 1, or 2):: Enter the row number (0, 1, or 2) for your move.
Enter column (0, 1, or 2):: Enter the column number (0, 1, or 2) for your move.

Example Gameplay

Welcome to Tic-Tac-Toe!
- - -
- - -
- - -
Player X's turn.
Enter row (0, 1, or 2): 1
Enter column (0, 1, or 2): 1
- - -
- X -
- - -
Player O's turn.
Enter row (0, 1, or 2): 0
Enter column (0, 1, or 2): 1
- O -
- X -
- - -
...

Player X wins!

Have fun playing the Tic-Tac-Toe game!

About

Welcome to the Tic-Tac-Toe Game repository! It's a solo project, currently in the initial phase with console output. Future updates will bring an interactive graphical user interface. Stay tuned for more!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published