Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Graphical Tic tac toe game using minimax algorithm.

License

NotificationsYou must be signed in to change notification settings

atenadadkhah/iceXO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Graphical Tic tac toe game using minimax algorithm


About iceXO

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

Web version

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.`)}})

iceXO web version

Python version

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.

iceXO python version


[8]ページ先頭

©2009-2025 Movatter.jp