Code Monkey home page Code Monkey logo

chess-engine's Introduction

Python Chess Engine

Table of contents

General info

I have been playing chess since primary school and one day I had an idea to implement chess in Python. Then, I came across a tutorial by Eddie Sharick, who made a whole 16 episodes series covering the topic. This repository is a result of following his videos, sometimes coming up with some improvements on my own. Hereby, I highly encourage you to visit his YouTube channel and check the whole series by yourself.

Eddie's YouTube channel

First episode of "Chess engine in Python"

Technologies

  • Python 3.7.8
  • pygame 2.0.1

TODO

  • Cleaning up the code - right now it is really messy.
  • Using numpy arrays instead of 2d lists.
  • Stalemate on 3 repeated moves or 50 moves without capture/pawn advancement.
  • Menu to select player vs player/computer.
  • Allow dragging pieces.
  • Resolve ambiguating moves (notation).

Instructions

  1. Clone this repository.
  2. Select whether you want to play versus computer, against another player locally, or watch the game of engine playing against itself by setting appropriate flags in lines 52 and 53 of ChessMain.py.
  3. Run ChessMain.py.
  4. Enjoy the game!

Sic:

  • Press z to undo a move.
  • Press r to reset the game.

Further development ideas

  1. Ordering the moves (ex. looking at checks and/or captures) should make the engine much quicker (because of the alpha-beta pruning).
  2. Keeping track of all the possible moves in a given position, so that after a move is made the engine doesn't have to recalculate all the moves.
  3. Evaluating kings placement on the board (separate in middle game and in the late game).
  4. Book of openings.

chess-engine's People

Contributors

mikolaj-skrzypczak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chess-engine's Issues

A quick note to say thanks

Thank you for all your efford doing this and making it available to the public.
I git cloned it and it works perfectly.
I started watching the videos for a better understanding.

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.