Skip to content

This is a tic tac toe game where a human is going to play against AI

Notifications You must be signed in to change notification settings

Jishnuadhikary10/TICTACTOE_humaNvsAi

Repository files navigation

TICTACTOE_humaNvsAi

This is a tic-tac-toe game where a human is going to play against AI.# Unbeatable Tic Tac Toe Game. This is a Python implementation of the classic Tic Tac Toe game, where you can play against an unbeatable AI opponent. The AI uses the minimax algorithm to make optimal moves and ensure it never loses.

Game Instructions

Here are the steps to play the Tic-Tac-Toe game:

  1. Run the Python code called tictactoe.py to initiate the game. To run this code, you need to make sure you have Pygame and Numpy installed. You can install Pygame using the following command: pip install pygame and pip install numpy
  2. The game board will be presented on the screen, displaying a 3x3 grid.
  3. By default, the game is configured in AI mode, enabling you to play against an AI opponent that cannot be defeated. To switch to player vs. player mode, press the 'g' key on your keyboard.
  4. In AI mode, you have the option to adjust the AI level. Press the '0' key to set it to random moves or the '1' key to set it to the impossible level.
  5. To make a move, select any unoccupied square on the game board by clicking on it.
  6. After you make your move, the AI opponent will automatically generate its move.
  7. If desired, you can restart the game at any point by pressing the 'r' key on your keyboard.

Have fun !!!

Game moves' Snapshot

move1 - Start

move1

move2

move2

move3

move3

AI won

AI won

working

working

About

This is a tic tac toe game where a human is going to play against AI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages