cli-tic-tac-toe-ai

Part of a submission to the MLH hackathon Snakes and Hackers.

gif

Problem Statement

Game on! This weekend's special is board games wherein you build something incredible for fun. Whether you're a fan of snakes and ladders, monopoly or not, this hackathon is for you to enjoy and have a great time.

My Submission

Adding a AI to the original Tic-Tac-Toe Game.

Not this, but something much simpler. A CLI based Tic Tac Toe built from scratch.

Live Demonstration

Run on Repl.it

  • You can view it on the live terminal by clicking on the repl.it badge above, OR
  • You can view the demonstration videos on issues #1, #2 & #3

Features:

  • Player vs. Player
  • Computer vs. Player
  • Computer vs. Computer (just for fun)

Local Setup

  • Make sure you have Python 3.7.x or Python 3.8.x installed, if not, click here to install!
  • Clone this into your Desktop: git clone "https://github.com/tusharnankani/cli-tic-tac-toe-ai"
  • Open Command Line or Terminal
  • Change directory to a respective game: cd "Desktop\Tic-Tac-Toe-AI"
  • Run : python tic-tac-toe-AI.py
  • And now have fun! ^_^

gif

Motivation to build this

  • I had been thinking to build upon the Basic Tic Tac Toe I had worked as a Python beginner.
  • Adding AI, thinking about optimal moves, and always not losing sounds fun to me.

References

Logic

  • Optimal Tic Tac Toe Moves

tic_tac_toe

Built With

Share this project:

Updates