Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 2.57 KB

File metadata and controls

65 lines (51 loc) · 2.57 KB

Simple TicTacToe Game

Description

This is simple game called Tic Tac Toe that build using C. This game have 2 modes : PvP and versus AI. In versus AI mode you have 100% chance winning the game :D. This project made for fulfill final project, basic programming practicum

Getting Started

How to Run

  1. Clone this repository. If you dont know how to clone repository, check this out : https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository
  2. After you done cloning, delete file TicTacToe from your folder, dont delete file TicTacToe.c
  3. Run code from file TicTacToe.c in your terminal
  4. Enjoy playing the game ❤️

How To Play

First of all, you choose game modes. '1' for PvP, '2' for Versus AI

  1. PvP Mode :
  • 1st player symbol is (X)
  • 2nd player symbol is (O)
  • There's 9 square, each square has a number like this :
          |     |
      0 0 | 0 1 | 0 2
     _____|_____|_____
          |     |
      1 0 | 1 1 | 1 2
     _____|_____|_____
          |     |
      2 0 | 2 1 | 2 2
    
  • If it's your turn, then type the number according to the square you want
  • If you player 1 and you type "0 0" then the (X) will place on square according the information above. Same it goes when you are player 2 the symbol that will place is (O)
  • 1 square cannot place 2 symbol, if player 1 or 2 place symbol in same square, the square will just contain first symbol, and the move are gonna be reset for next player ( so don't give wrong input :D )
  • If you win / lose / draw there is a message that showing up to tell you
  1. Versus AI Mode :
  • 1st player symbol is (X)
  • AI player symbol is (O)
  • There's 9 square, each square has a number like this :
          |     |
      0 0 | 0 1 | 0 2
     _____|_____|_____
          |     |
      1 0 | 1 1 | 1 2
     _____|_____|_____
          |     |
      2 0 | 2 1 | 2 2
    
  • If it's your turn, then type the number according to the square you want
  • If you type "0 0" then the (X) will place on square according the information above.
  • The AI will automatically place symbol (O) after you type for your move
  • 1 square cannot place 2 symbol, if you place symbol in same square, there a message "Pilih Kotak Lain!" its mean "Choose another square". and ask your input again. It will looping until your input is valid, not place in same square.
  • If you win / lose / draw there is a message that showing up to tell you

Contact

If you have any question or feedback, please do not hesitate to contact me any time Mahijapradipta86@gmail.com

Made with passion by Eeja ❤️