Skip to content

A code snippet that proves that there is no legal, potentially non-reachable chess position with more than 218 moves.

License

Notifications You must be signed in to change notification settings

Tobs40/chess218

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

chess218

image

A code snippet that, using the solver Gurobi, proves that there is no legal chess position with more than 218 moves. Can be configured to solve very similar problems (144 moves without promotions, with certain restrictions on piece counts, ...). Does not check whether the position can be reached from the initial position. There are tools for that: https://github.com/peterosterlund2/texel

Usage:

  • Install gurobipy via pip
  • Install Gurobi on your system
  • Obtain and activate a free academic license from https://www.gurobi.com/
  • Make sure gurobipy finds Gurobi, this is usually the case
  • Modify the script according to your needs
  • Start running it and wait for the results

Solutions (Correct, illegal, wrong) will be written to a folder as images as well as text files with the corresponding fen. At the end of the program, after the popup window with the optimal solution is closed, a text file with the FENs of all correct solutions is created.

Check out the corresponding Lichess article: https://lichess.org/@/Tobs40/blog

About

A code snippet that proves that there is no legal, potentially non-reachable chess position with more than 218 moves.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages