Code Monkey home page Code Monkey logo

icexo's Introduction

iceXO - A Tic Tac Toe Game With AI


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 have iceXO.css and iceXO.js added in your project.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>iceXO</title>
    <link rel="stylesheet" href="./css/iceXO.css">
</head>
<body>
    
<main></main>
    
<script src="./js/iceXO.js"></script>
</body>
</html>

Then simply call the iceXO object and pass the parent element to it (e.g .parent, #parent, div)

<script>
    IceXO.play('main')
</script>

You can also customize it by passing settings 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 the runner.py file.

iceXO python version

icexo's People

Contributors

atenadadkhah avatar

Stargazers

Alireza Kia avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.