GithubHelp home page GithubHelp logo

tictactoe-game's Introduction

Tic Tac Toe Game in C++

This is a simple Tic Tac Toe game developed in C++. It is designed for two players and is played on a 3x3 board. The game starts with player 1 (X) and player 2 (O) taking turns to place their respective marks on the board. The game continues until either one player wins, or the game ends in a draw.

How to Play

To play the game, simply compile and run the C++ code. The game will display the game board and prompt player 1 to make a move. Player 1 should enter the number corresponding to the location where they wish to place their mark. Player 2 will then be prompted to make their move. The game will continue in this way until either one player wins, or the game ends in a draw.

Code Structure

The game board is represented using a 2D character array. The game is played using a while loop, which continues until the game is over. The game board is displayed using a function called display_board(). The player's moves are recorded using a function called player_turn(). The game status is determined using a function called gameover(), which checks for win/loss/draw conditions. The game ends when either one player wins, or the game ends in a draw.

Features

Simple, easy-to-use interface. Two-player mode. Displays the game board after each move. Checks for win/loss/draw conditions. Displays a message when the game is over.

Conclusion

Overall, this is a simple and fun Tic Tac Toe game that is easy to play and understand.

tictactoe-game's People

Contributors

oneshikaa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.