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
Implementation of the famous puzle Tower of Hanoi

Tower_of_Hanoi Implementation of the famous puzle "Tower of Hanoi". The setup consists of three pegs (sticks) and a certain amount of discs (in this i

Raffaele Fiorillo 3 Mar 08, 2022
A small module for creating a card deck, used for making card games

card-deck This module can be used to create small card games such as BlackJack etc.. To initialize the deck, use: Deck() To shuffle the deck, use: Dec

4 Dec 31, 2021
A Pygame game made in 48 hours

Flappuccino Flappuccino is a game created in 48 hours for the PyGame Community New Years Jam using Python with Pygame. Screenshots Background Informat

PolyMars 242 Jan 02, 2023
Simple game where you try to survive as long as you can on screen.

Survival Game Simple game where you try to survive as long as you can on screen. Play To run, download the code and run the survival_game.py file. Fro

Logan Morris 1 Feb 10, 2022
Simple implementation of the classic Snake Game in under 100 lines of code

Snake_Game Simple python implementation of the classic Snake Game in under 100 lines of code. Printscreen of the game: Imported Libraries: random; pyg

Raffaele Fiorillo 2 Jun 13, 2022
General Crossy Road Game using Python code

Python-Game General Crossy Road Game using Python code Using code such as function and while using turtle, I was able to recreate a beginner version o

Jacob Paquette 1 Dec 19, 2021
A hangman game that I created. Thanks to Data Flair for giving me the code!

Hangman A hangman game that I created. Thanks to Data Flair for giving me the code! Run python3 hangman.py in a terminal if you have Python 3. Please

SmashedFrenzy16 0 Dec 24, 2022
A python program for playing rock-paper-scissors with computer .

Rock_Paper_Scissors_Cut A time passing famous hand game known as rock paper scissors cut game. Starting from children to adults everyone plays this ga

Arghya Banerjee 1 Dec 16, 2021
Rock Paper Scissors Game with PyQt5

Rock-Paper-Scissors-Game rock paper scissors is a old game that all of us played it but this time let's play with computer Description This is Rock Pa

MohammadAli.HBA 4 Nov 11, 2021
Multiple hacks that breaks the game

Blooket-Hack All of the cheats are based on a game mode.

glizzz_y 484 Feb 25, 2022
Given some input, spit out the possible words for a Wordle puzzle

Wordle Helper, because why not. Given some input, spit out the possible words for a Wordle puzzle First time setup # Download the dictionary to a file

Richard Duarte 1 Jan 25, 2022
Command-line Hangman game

Hang-_an-game-python-build Hangman C command-line Hangman game. Compilation Navigate to the root of the repository from your Terminal and run make to

Hemant Choudhary 3 Jan 16, 2022
Turtle Road Crossing Game in Turtle(python module)

Turtle Road Crossing Game in Turtle(python module) In this project we have built a road crossin game in python with Object-Oriebted Programming. This

Jhenil Parihar 3 Jun 15, 2022
Pratice Project - Tic tac toe game

Hello! This tic-tac-toe game project and its notes are result from a course pratice milestone. The project itself is written in Python using the Jupyt

Rafael Nascimento 1 Jan 07, 2022
uses Entropy to find the best next guess for Wordle, given the color clues

WordleSolver uses Entropy to find the best next guess for Wordle, given the color clues use player.py and enter in the string for the suggested clue w

Steve Earth 1 Jan 26, 2022
python script to convert .OBJ files into Minecraft, rendering them in game with a core shader.

samples: random notes about the tool general output format: (animation not supported yet but planned) vertex id Minecraft's gl_VertexID isn't per mode

199 Jan 02, 2023
Solo CLF project about the creation of the FlickColor game in Python with very precise instructions.

Solo CLF project about the creation of the FlickColor game in Python with very precise instructions.

COZAX 1 Dec 09, 2022
πŸŽ… Celebrating 2021 Christmas with the development of this game

ChristmasGame (DEVELOPING) πŸŽ… Celebrating Christmas with the development of this game You can also use this engine to create your game too, just empty

Γ‰rik Freitas 5 Jan 10, 2022
Lint game data metafiles against GTA5.xsd for Rockstar's game engine (RAGE)

rage-lint Lint RAGE (only GTA5 at the moment) meta/XML files for validity based off of the GTA5.xsd generated from game code. This script accepts a se

GoatGeek 11 Sep 18, 2022
A simple script which allows you to see how much GEXP you earned for playing in the last Minecraft Hypixel server session

Project Landscape A simple script which allows you to see how much GEXP you earned for playing in the Minecraft Server Hypixel Usage Install python 3.

Vincenzo Deluca 4 Dec 18, 2021