Git Product home page Git Product logo

tic-tac-toe-gym's Introduction

Tic-Tac-Toe-Gym

This is the Tic-Tac-Toe game made with Python using the PyGame library and the Gym library to implement the AI. In this game you could play against the AI that I have created using the Gym libray and StableBaselines3

Little overview

Imgur

Execute it in your editor


Python 3.7 required


_(I hardly recommend the conda enviroment in order to run all the files)_

Use the package manager conda to install the same virtual environment that I used, this command will create a new virtual environment with the same libraries that I used:
The my_enviroment.yml is in this repo

conda env create -f my_environment.yml

Then to execute the app to:

python tictactoe.py

What files are in this repo?

In this repo you can find the following file:

  • tictactoe.py: the main file made with Pygame that you need to execute it in order to play the game
  • Tic_Tac_Toe_Gym.ipynb: the file that creates the IA for the oponent. You can execute this in Google Colab if you want
    Open In Colab
  • model5millonesFinal.zip: the file that I import in tictactoe.py file; in this file is where I saved the AI

About the AI


The AI for this game was created using Reinforcement Learning using the Gym Library and StableBaselines3. For this AI I specified all the tic-tac-toe rules and the model itself learnt the rules, after 5 millions steps.

Showcase

Example

Imgur

Imgur

License

MIT

tic-tac-toe-gym's People

Contributors

francofgp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hoooon89

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.