Giter Site home page Giter Site logo

aheritianad / kivy-tictactoe Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 9.32 MB

tictactoe Game : Python-Kivy with Q-learning algorithm from Scratch

License: MIT License

Python 4.79% kvlang 0.56% Jupyter Notebook 94.65%
game kivy kivymd reinforcement-learning reinforcement-learning-agent reinforcement-learning-algorithms reinforcement-learning-environments tabular-q-learning

kivy-tictactoe's Introduction

TicTacToe Game

What is this?

This is a draft of a kivy app which can do basics tictactoe game. User can choose to play against cpu.

WARNING!!!

The iterface is not nice. Yeah! but it can do the job.

Why do I write this?

  • Mainly for fun
  • To apply my understanding of kivy and Q-learning free tabular

Next plan ?

  • My next plan is to implement a reinforcement learning model from scratch to allow cpu to play on its own.
  • It seems that the model plays offensive only. I will train it to play against myself after against itself when I have time for that.
  • Update with gui...
  • Still thinking and waiting for a free time

How to use it?

First of all, you need to download and install its requirement on python3.

Installation

Clone this repository by running

git clone https://github.com/aheritianad/kivy-tictactoe.git

Enter into the directory

cd kivy-tictactoe

[OPTIONAL] Create a virtual environment

Do the following if you want to run it in a virtual environment.

Create a virtual environment named .venv
python3 -m venv .venv
Activate the virtual environment you just created with
source .venv/bin/activate

Install the requirements in the environment

pip3 install -r requirements.txt

Run the game

Use the following command to run the game

python3 main.py

Solo vs Multiplayer setups

  • For solo, you can choose to either the first player or the second by setting CPU player's name by either cpu0 for easy, cpu1 for medium, cpu2 for hard or cpu3 for expert.

It is important to know that expert will upgrade after each game it plays

  • For multiplayer, only avoid cpu0, cpu1, cpu2 and cpu3 for players' names

kivy-tictactoe's People

Contributors

aheritianad avatar

Stargazers

 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.