The game is to be played between two people (in this program between HUMAN and COMPUTER). One of the players chooses ‘O’ and the other ‘X’ to mark their respective cells. The game starts with one of the players and the game ends when one of the players has one whole row/ column/ diagonal filled with his/her respective character (‘O’ or ‘X’). If no one wins, then the game is said to be draw. 

Prerequisites

Hardware Required

This project can be done with OLED display, for that refer tic-tac-toe on OLED display.

  • ARIES v3.0 Board
  • USB type C to USB type A cable

Note:  All of the following boards can be used for this project

Procedure

We do not need to connect any external hardware for this project, so let’s power up the board. Make sure the Laptop/Desktop/PC which we’re using should be pre-installed with Arduino IDE and VEGA ARIES boards of latest version.

  • Now, Open the Arduino IDE
  • Make sure you have selected ARIES v3 Board from Tools -> Board -> VEGA Processor: ARIES Boards -> ARIES v3
  • Enable the flash mode from Tools -> Flash Mode -> Enabled
  • Select Programmer as VEGA FLASHER from Tools -> Programmer -> VEGA FLASHER
  • Also select appropriate port, Tools -> Port -> COM* (ARIES Board)
  • Open File -> Examples -> Under Examples for ARIES v3 -> UART -> tic-tac-toe
  • Now, Upload the code in ARIES v3 board.

Output

Once the code is uploaded, an empty 3×3 grid will display on serial monitor. Also, it will display the turn. If it’s your turn, you can make a move using the 1…9 keys (plus Enter) from the Serial Monitor:

The game is played with X and O as the two players’ symbols, where X goes for CPU and O goes for You. A player wins the game if they get three of their symbols in a row (horizontally, vertically, or diagonally). If a player successfully forms a winning pattern, they announce their victory.

Leave a Reply

Your email address will not be published. Required fields are marked *