- Notifications
You must be signed in to change notification settings - Fork0
Graphical Tic tac toe game using minimax algorithm.
License
atenadadkhah/iceXO
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Graphical Tic tac toe game using minimax algorithm
This package is written in two Python and Web versions. Both types have an attractive and interactive user interface, and the web version is flexible and customizable.In this project, the minimax algorithm is used in such a way that with every move you make on the screen, artificial intelligence predicts next moves and chooses the best move.
- A simple way to implement the MiniMax algorithm
- Customizable UI for web version
- Interactive UI/UX
- Web version has pure JavaScript (ES6+) with no libraries attached to it
- Ability to play in both X and O positions
The web version of this Tic tac toe game, has a beautiful graphical user interface and the ablity to change appearance and colors.
To use this version, you should haveiceXO.css
andiceXO.js
added in your project.
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><title>iceXO</title><linkrel="stylesheet"href="./css/iceXO.css"></head><body><main></main><scriptsrc="./js/iceXO.js"></script></body></html>
Then simply call theiceXO
object and pass the parent element to it (e.g .parent, #parent, div)
<script>IceXO.play('main')</script>
You can also customize it by passingsettings
parameter to the object.
IceXO.play('main',{boardColor:'#EEEEEE',body:'white',fancyColor:'#32E0C4',xColor:'#222831',oColor:'#393E46',gameOver:function(winner){alert(`${winner||'No one'} wins the game.`)}})
Thanks to Pygame, the Python version also has an interactive user interface.
To use the Python version, at first you should install libraries.
pip3 install -r requirements.txt
To play tic tac toe run therunner.py
file.