Skip to content

An easy-to-use, interactive game experience is offered by this C++ program Tic-Tac-Toe

Notifications You must be signed in to change notification settings

karts13/Tic-Tac-Toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe

Description

An easy-to-use, interactive game experience is offered by this C++ program Tic-Tac-Toe , which applies object-oriented ideas. It makes use of classes, functions, and random number generation. The game has two modes:

  1. Play Against a Human: Two players enter their moves sequentially on the 3x3 game board in this mode. Players can start new games and the program keeps track of their scores.
  2. Play Against the Computer: In this mode, a lone player faces off against an artificially intelligent foe. The player attempts to win or earn a draw while the computer performs random moves.

How to Use this Code

  1. Clone the Repository:
    git clone https://github.com/karts13/Tic-Tac-Toe.git
    cd Tic-Tac-Toe
    
  2. Do the necessary customizations.
  3. Compile the Code:
    make
    
  4. After successful compilation, an executable file named tictactoe will be generated. Run the compiled executable
    ./tictactoe
    
  5. Upon running the program, a menu will be displayed with two options shown in Output 2.
  6. Enter the number corresponding to your preferred mode and press Enter.
  7. To play the game depending on your selected option, follow to the prompts and directions given by the computer.
    • If you selected to play against a human, you will be prompted to enter player names and take turns making moves on the board.
    • If you selected to play against the computer, you will be prompted to enter your name and then play against the computer opponent.
  8. After each round, the application is going to ask if you'd want to begin a new game. You can opt to stop playing or keep going.

Customization

This code can be easily customized to meet your specific needs. Here are some things you may want to modify:

  • Custom Symbols: Instead of using the letters "X" and "O," players could use their own symbols (such as emojis or icons).
  • Board Size: You can change the game to support larger or smaller game boards, such as 4x4 or 5x5 grids, by modifying the board size and victory condition logic appropriately.
  • Player profiles: Customize the leaderboard to enable players to keep track of their game data, including their win-loss records and the number of games they've played.

Sample Outputs

Text Editor
Text Editor
Menu
TicTacToe Menu
vsHuman
Play against Human
Leaderboard
Leaderboard
vsComputer
Play against Computer

Contributions

If you find any issues or have suggestions for improvement, please open an issue or create a pull request.

About

An easy-to-use, interactive game experience is offered by this C++ program Tic-Tac-Toe

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published