An old time game Tic-Tac-toe

Overview

A Tic Tac Toe Bot

tictactoe

This is the code repository for my article on Medium - Playing Games with Python - Tic Tac Toe, where I have tried to take the famous Tic-Tac-Toe game and create a bot proficient enough to beat human players, if not the game itself.

What's inside this repository?

  • A fully playable Tic-Tac-Toe environment.
  • A bot trained using Temporal Difference learning (A technique in Reinforcement learning).
  • A bot trained using the Minimax Algorithm.

How to use this ?

Play against the RL bot

run python testing_(HumanvsAI)_ReinforcementLearning.py

Play against the Minimax bot

run python HumanvsAI_Minimax.py

Play against another human player (Regular tic tac toe)

run python HumanvsHuman.py

Training the RL Bot

Out of the two implementations, only the RL bot needs to train in order to reach proficiency. It does so by play 1v1 with another RL bot sharing the same state values in order to learn to beat itself and eventually become better. The num_iterations parameter controls the number of games that will be played among the bots.

run python training_(AIvsAI)_ReinforcementLearning.py

Testing the two bots by making them play among themselves

I wrote anotherr script in order to see which bot performed better in very brutal 1v1 fashion. The num_iterations parameter controls the number of games that will be played among both the bots.

run python Showdown_Minimax_vs_RL.py

To Try

  • Minimax Algorithm
  • Temporal Difference Learning
  • Q Learning
  • Genetic Algorithms
Owner
Jigyanshu
AI/ML ENTHUSIAST..
Jigyanshu
A Minecraft clone written in python and pyglet.

PyCraft A Minecraft clone written in python and pyglet. Running PyCraft To run PyCraft, run the following code: git clone https://github.com/TheWebCra

The WebCrafters 17 Dec 29, 2022
NSI project --> 2D platformer in Python with Pygame

Projet de NSI (2021-2022): Jeu sous Python Collaborateurs: Remi K-S et Nathan D Lien de l'environnement IDE de Python en ligne: https://replit.com/@Re

Remi K-S 3 May 24, 2022
Create a Hangman Game using Python and all techniques of Python.

Hangman Game Created by Fernando Callasaca Game rules: Choose a word and if you guess it will appear completed. In case it is not the word then the ma

Fernando Callasaca 3 Nov 01, 2021
MCTS (among other things) for 2048

2048 Created by Chad Palmer for CPSC 474, Fall 2021 Overview: This is an application which can play 2048 and simulate games of 2048 with a variety of

Chad Palmer 1 Dec 16, 2021
You can play TicTacToe with the engine running UI.py with python3

TicTacToe An "Engine" for TicTacToe You can play TicTacToe with the engine running UI.py with python3. The file engine.py is designed so you can make

Ahnaf Syndeed 3 Feb 20, 2022
🌍🍓 A better MCPi Launcher

Planet Launcher A better, maintained launcher for the Minecraft: Pi Edition Reborn mod. Report Bug | Request Feature Planet is a maintained, feature-r

15 Oct 19, 2022
A Game of Life implementation in Python

Game of Life in Python (Golipy) Golipy is a simulator of John H. Conway's Game of Life, developed in Python based on the Pygame library. This is a toy

Alber 2 Dec 10, 2021
To solve games using AI, we will introduce the concept of a game tree followed by minimax algorithm.

To solve games using AI, we will introduce the concept of a game tree followed by minimax algorithm.

Vaibhaw 7 Oct 13, 2022
Solution for automation games play-to-earn

Pillow automation used processing images

Luis Eduardo Camilo 1 Jan 19, 2022
This is an amazing game make using pygame.

This is an awesome balloon game. It is made in python using Pygame library. It is a project game while learning game development.

Rishikesh Kumar 2 Oct 10, 2021
A python script that uses pygame to display fractals.

Pygame-Fractals A python script that uses pygame to display interactive fractals. There are 3 fractals on the script. They can be displayed on the col

michel 2 Feb 09, 2022
Snake game made in python with the pygame library.

Pygame snake Snake game made in python with the pygame library. Requirements pip pygame Pygame Installation On the command line, type: pip install pyg

Ayza 3 Oct 02, 2022
Memory game in Python

Concentration - Memory Game Concentration is a memory game written in Python, inspired by memory-game. Description As stated in the introduction of th

Marco Colonna 0 Jul 21, 2022
Rock-Paper-Scissors - Rock Paper Scissors With Python

Rock-Paper-Scissors The familiar game of Rock, Paper, Scissors is played like th

Lateefah Ajadi 0 Jan 15, 2022
This repository contains algorithm and solver for the game WORDLE

Wordle-Cracker This repository contains algorithm and solver for the game WORDLE How to use Run the program: python main.py Type in the guess word in

YiHsin Chen 3 May 14, 2022
Several implementations of classical games (ex: FlappyBird, Minesweeper etc.) using Python (pygame)

Mini Games with Pygame This projects implement several classic and popular games in Python, using python package -- pygame. Currently, 4 games are alr

1 Feb 14, 2022
A terminal-based number guessing game written in python

A terminal-based number guessing game written in python

Akshay Vs 15 Sep 22, 2022
Automatically prepare your Minecraft maps for release

map-prepare Automatically prepare Mineraft map for release. Current state: kinda works Make sure you have backups for your world before running this p

11 Oct 11, 2022
Ghdl-interactive-sim - Interactive GHDL simulation of a VHDL adder using Python, Cocotb, and pygame

GHDL Interactive Simulation This is an interactive test bench for a simple VHDL adder. It uses GHDL to elaborate/run the simulation. It is coded in Py

Chuck Benedict 2 Aug 11, 2022
This is a basic virtual quiz game using opencv-python

Basic Virtual-Quiz-Game This is a basic structure of a virtual quiz game using opencv-python. As the camera window opens up we can see the questions a

2 Dec 11, 2021