Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 1.14 KB

File metadata and controls

14 lines (10 loc) · 1.14 KB

Project Title: CLI Tic-Tac-Toe

Overview: This project is a command-line tic-tac-toe game where the user plays against a random enemy. The user plays as O, and the enemy plays as X.

Requirements:

  1. The user will see a 3x3 tic-tac-toe board in the terminal.
  2. The user will make a move by selecting an empty square from 1 to 9.
  3. If the user selects an empty square, O will be placed in that square. Otherwise, the user will be asked to retry the input.
  4. After the user makes a move, it becomes the enemy's turn. The enemy will always choose a random empty square and place X in that square.
  5. The user and the enemy will take turns making moves.
  6. When the user gets three Os in a row in any direction, the user wins. When the enemy gets three Xs in a row in any direction, the enemy wins. If the board is full without the user or the enemy winning, the game is tied.

Example Interaction: The game prints a board with numbered empty squares. The user enters 5. The game places O in the center square. The enemy randomly chooses an empty square and places X there. The game prints the updated board and asks the user for the next move.