Git Product home page Git Product logo

stalemater2000's Introduction

Stalemater2000

A basic c++ chess engine

This project was inspired by Sebastian Lague's Chess Engine. Stalemater2000 uses bitboards and alpha-beta search to quickly find the best move of a chess position. The program runs in a terminal and is controlled using commands from the UCI protocol. This way, the program can (try to) compete against commercial engines like Stockfish using Arena.

The bitboard logic I used was really well explained in this Youtube series by Logic Crazy Chess.

Also, everything you'd ever would want to know about chess programming can be found on the chess programming wiki.

stalemater2000's People

Contributors

dogefromage avatar

Stargazers

Mark avatar

Watchers

 avatar Protej avatar

stalemater2000's Issues

Extra move reported

This position:

position startpos moves a2a3 d7d5 c2c4 d5c4 d1a4

which leaves black to play gives d8d2 as a valid move. However, black is in check from the queen on a4, and d8d2 doesn't evade it. After a bit of digging the problem is the else here in Board::Init():

	Checks = 0;
	if (BitBoards[KW] & UnsafeForWhite)
		Checks |= CHECK_WHITE;
	else if (BitBoards[KB] & UnsafeForBlack)
		Checks |= CHECK_BLACK;

Although black's move is illegal, it's one that puts the white king immediately in check, so the first condition above is met but not the second. And just like that, black isn't in check as far as the game is concerned :)

Removing the else from the above code fixes the perft tests (found at startpos, depth 6 initially) and stops a few oddities.

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.