A chess engine with basic AI capabilities (search for best move using MinMax algorithm)

Overview

AI CHESS ENGINE, by KEN WU

Video Demo: https://www.youtube.com/watch?v=GqyVCjIernA

Description:

This is an AI chess engine that uses the MinMax algorithm to find the next best move to play. The project consists of three files: chessMain.py, chessEngine.py, and chessAI.py. chessMain.py contains the "main" function which draws the chess board and deals with user inputs. chessEngine.py is responsible for the majority of move mechanics and board graphics/game states. chessAI.py contains the MinMax algorithm.

I chose to implement the Min Max algorithm instead of the greedy algorithm. When I implemented the greedy algorithm, I realized that the AI would simply look one move ahead and choose the move that grants it the most material points. This is a naive algorithm because it doesn't take into account the possible retaliatory moves the opponent can make. For example, in the case where the AI can take a pawn with its queen, it will do so, without checking whether the opponent can take its queen the next move. The Min Max algorithm, on the other hand, evaluates not only the best possible move for its current board position but also tries to minimize the opponent's best move. For instance, if move A grants the AI +1 point but allows the opponent to make a +5 move while move B grants the AI 0 point yet limits the opponent's best move to only 1 point, it will choose move B over move A, because move B minimizes the opponent's score while simultaneously maximizing its own score.

Owner
Ken Wu
Melbourne Uni Business Grad 20' | Entrepreneur | Learning to Code
Ken Wu
Official PyTorch implementation of NAC from the paper: Neural Auto-Curricula in Two-Player Zero-Sum Games.

NAC Official PyTorch implementation of NAC from the paper: Neural Auto-Curricula in Two-Player Zero-Sum Games. We release code for: Gradient based ora

Xidong Feng 19 Nov 11, 2022
Python codes for the classic Hang Man game

Python codes for the classic Hang Man game. The user will be assigned a random word to guess, one character at a time. If the user gets everything right, the program says Well Done!, but if the user

p.katekomol 1 Jan 25, 2022
Wordle-prophecy - The comprehensive list of all Wordle answers, past and future

About This repo contains the comprehensive list of all Wordle answers, past and

Hayden Moritz 2 Dec 15, 2022
A simple matrix code rain created using Python with Pygame.

Matrix4_code_rain A simple matrix code rain created using Python with Pygame. To run the code you will need Pygame and MS Mincho font. Create a projec

7 Nov 06, 2022
The Sinclair ZX Spectrum BASIC compiler!

ZX BASIC Copyleft (K) 2008, Jose Rodriguez-Rosa (a.k.a. Boriel) http://www.boriel.com All files in this project are covered under the GPLv3 LICENSE ex

Jose Rodriguez 143 Dec 13, 2022
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
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
WordleHelper suggests words to help players better enjoy the hit game Wordle

WordleHelper Introduction WordleHelper suggests words to help players better enjoy the hit game Wordle. Both the general mode and the hard mode are su

Shao-Yu, Chu 5 Jun 02, 2022
Running Chess Night results tabulation

Running Chess Night results tabulation

Mitch LeBlanc 2 Nov 20, 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
The Original Snake Game. Maneuver a snake in its burrow and earn points while avoiding the snake itself and the walls of the snake burrow.

Maneuver a snake in its burrow and earn points while avoiding the snake itself and the walls of the snake burrow. The snake grows when it eats an apple by default which can be disabled in the setting

17 Nov 12, 2022
The Classic Fruit Collecting game made in python with pygame

FruitCollect A classic fruit Collecting game made with pygame Install pygame before running: "pip install pygame" Rules: Random fruits will drop from

Pranav Bobby 1 Dec 01, 2021
A fun, casual and strategic game made using Python!

Steve's Pixels A fun, casual and strategic game made using Python! Prerequisites See requirements.txt Demo video demo.mp4 Usage python -m steves_pixel

Jaivardhan Bhola 9 Sep 17, 2022
Disables the chat in League of Legends for Windows.

Disables the chat in League of Legends for Windows. If you simply can't stop yourself from typing LeagueStop will play KEKW.mp3 each time you try. The sound will stack & becomes horribly annoying.

1 Nov 24, 2021
This is a python interactive story game that I made to show off what I've learnt in python coding for a month

Purpose The files in this repository are for that of a story game created with python version 3.8.5 The purpose of this project was to get familiar wi

0 Dec 30, 2021
シューティングゲームぽい?未完成ですけど

シューティングゲームぽい?未完成ですけど

kawamineka 64 Jun 25, 2022
A python3 project for generating WorldEdit shematics for the MineClone2 game for Minetest from images.

MineClone2 MapArt This is a python3 project you can use with the MineClone2 game for Minetest. This project take an image and output a WorldEdit shema

3 Jan 06, 2023
Mandaw 2 Mar 01, 2022
A networking library for multiplayer games.

Aerics A networking library for multiplayer games. Getting Started Install Python Open cmd/terminal and type: pip install Aerics Examples Creating a

Yusuf Rençber 3 Jan 04, 2023
For educational purposes, a simple script that assists in solving the word game Wordle.

WordleSolver For educational purposes, a simple script that assists in solving the word game Wordle. Instructions Pick your first word from the sugges

Christian De Leon 2 Mar 25, 2022