Skip to content

A Python implementation of the MiniMax algorithm in Tic Tac Toe

License

Notifications You must be signed in to change notification settings

adam-sroka/minimax-tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniMax Tic Tac Toe 🎮

Preview

Github

About

A CLI implementation of the MiniMax algorithm in Tic Tac Toe without any external libraries in Python.

Running

Clone/Download this repository, open up a terminal in it and run:

python tic_tac_toe.py

Playing

While the input command: message is displayed, you can either start a game or exit the program.

Starting a game is done by running start player_1 player_2, where player_1 and player_2 can be any of the following: user, easy, medium, hard. These specify whether the given player will be played by the user, an easy bot, a medium bot or the hard bot (the MiniMax algorithm), respectively.

For example, typing start medium user and pressing enter will start a game with the first player being played by the medium-difficulty bot and the second player being the human player (assuming no 🤖 is playing this!)

Once the game has started, when prompted with Enter the coordinates: you should enter two numbers separated by a space. The first number is the x-coordinate of the board (from 1 to 3) and the second number the y-coordinate (also 1 to 3). Press enter to play your move with the given coordinates.

To exit the program type exit and press enter.

I hope you enjoy! 😇

About

A Python implementation of the MiniMax algorithm in Tic Tac Toe

Topics

Resources

License

Stars

Watchers

Forks

Languages