Dark Matters
  • About Me
  • Publications
  • Educational Resources
  • Blog
  • Other Interests

A Working Chess Program in Python

9/10/2013

1 Comment

 
I have completed a Python program that uses the Stockfish chess engine with rules governed by the ChessBoard Python module. The code allows the user to choose whether to play black or white, has an adjustable skill level, and lets the chess engine look 15 moves deep. The program will also check the legality of each move made and accounts for special moves such as en passant, castling, and pawn promotion. It also checks for stalemates, the 50 move rule, and the three move repetition rule. In its current iteration, the program prints out the board after each move to make sure it is working correctly. Here is a copy of the program for Python 2.7. You must have the Stockfish engine installed as well as the ChessBoard module with the code pointed to the appropriate places. Moves must be entered in algebraic notation with quotes. For example, a typical opening move may be 'e2e4', castling may be 'e1g1', a pawn promotion may be 'e7e8q', and en passant may look like 'e5d6'. 

Enjoy!
1 Comment
Jimmy Stewart
7/26/2016 10:39:51 pm

Please Im interesting on your chess program, please share your program again. I will be welcome

Reply



Leave a Reply.

    Archives

    July 2015
    February 2014
    November 2013
    October 2013
    September 2013
    July 2013
    June 2013
    May 2013
    April 2013
    March 2013
    February 2013
    January 2013

    Categories

    All
    Arduino
    Chess
    Lightsaber
    Math
    Probability
    Projects
    Python
    Raspberry Pi
    Robotics
    Statistics

    The Great Arduino Project

    RSS Feed

Powered by Create your own unique website with customizable templates.