Skip to content

burger4d/Krevetka-chess-engine-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

117 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Krevetka-chess-engine-project

chess.gif

A basic chess engine coded in python, with a GUI that enables you to use more advanced chess engines as bots. It was a personal project made during high school (the code quality is... bad).

Why "Krevetka"?

Krevetka (or Креветка) means "shrimp".

The "image recognition"

The bot captures a screenshot and searches each individual pixel for colors belonging to the chessboard. It then determines the chessboard's location on the screen, ensuring its complete visibility, and begins playing.

Currently, the bot is compatible with the following websites (only tested under WINDOWS):

  • lichess
  • chess.com
  • chessfriends
  • chess24

The Algorithm:

The minimax algorithm explores every possible position up to a predetermined depth. It executes a recursive function which evaluates each position and determines the optimal move. Krevetka uses this algorithm with a maximum depth of three. Instead of a recursive function, I implemented it using "for" loops, as these tend to be quicker in Python.

Modules:

Files:

  • krevetka.py: Code for the chess engine.
  • main.py: The file displaying the graphical user interface.
  • endgame.mp3: This playlist is "Hard as Steel" by Abbynoise, and it is a Non-Copyright Song(NCS). It can be played after the game has ended.
  • tools.py: Provides necessary "tools" for analyzing the screen, such as taking screenshots, finding positions, and moving the mouse to play.
  • README.md: The file that you are currently reading.

Lichess account (banned):

game ⚠WARNING⚠: CHEATING IS BAD

About

basic chess engine made with python

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors