pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
ChessBoard

ChessBoard - 2.02

John Eriksson (wmjoers)

Tags:

Description

ChessBoard is a Python implementation of the FIDE laws of chess. The main goal is to implement all applicable rules in a simple, straightforward way. The intention is not to be fast but to be easy to understand and to be complete. Many other implementation has known problems with castling, stalemate or other more or less special rules.

Features:

  • The moves of the pieces
  • Castling
  • En passant
  • Check detection
  • Checkmate detection
  • Stalemate detection
  • Draw by the fifty moves rule detection
  • Draw by the three repetitions rule detection
  • Get valid locations support
  • Imoprt and export of Forsyth-Edwards Notation strings.
  • Add text moves in the AN, SAN and LAN standards.
  • Export moves in the AN, SAN and LAN standards.
  • Undo and Redo.
  • Goto a specified move.

Unpack the source and start example with "python ChessClient.py"

Keys:

  • Left - Undo last move.
  • Right - Redo move.
  • F - Print current board as FEN.
  • A - Print all moves as Algebraic Notation.
  • S - Print all moves as Standard Algebraic Notation.
  • L - Print all moves as Long Algebraic Notation.

Changes

  • Added the method getLastMove()
  • Changed the behavior of the promotion value. The promotion value set by setPromotion is always remembered until setPromotion(0) resets it.
  • Added the method getPromotion() to get the current promotion value.
  • Added the method getLastMoveType() to indicate if the last move was a "special move" like en passant or castling.
  • Fixed a bug in getLastTextMove(...). It now returns the correct code for castling.
  • Fixed a bug in the addMove() method. It pushed the state before it determined the game result causing it to loose the game result when using undo redo.

Links

Home Page: http://arainyday.se
Source: http://arainyday.se/projects/python/ChessBoard/ChessBoard_2.02.tar.gz

Screenshot


click to view original size

Releases

ChessBoard - 2.05 - Jul 29, 2008
ChessBoard - 2.04 - Jul 28, 2008
ChessBoard - 2.03 - Aug 7, 2007
ChessBoard - 2.02 - Jan 3, 2007
ChessBoard - 2.01 - Dec 5, 2006
ChessBoard - 2.0b - Nov 28, 2006
ChessBoard - 1.1 - Aug 8, 2006
ChessBoard - 1.0 - Aug 3, 2006

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

March 4, 2010 9:22pm - game crazy :) - nickname: (art118) - 3/5
now way to run it
March 4, 2010 8:57pm - game crazy :) - nickname: (art118) - 3/5
no chess program
May 6, 2008 11:48pm - peter papineau - nickname: (pcubed)
i am a new programmer with an idea for a version of chess. i plan to make the ai using python and the graphics with blender. i wanted to see the actuall code that you used to study from. any tips would be great!
April 11, 2008 5:21am - luca binetti - nickname: (masterjimmy) - 5/5
Very good! John, i'm trying to contact u from ur website, but every time i try to send email (in contact section), i have a Invalid validation code!, but i'm sure i'm writing right code! i've have an important question 4 u
August 7, 2007 6:50am - John Eriksson - nickname: (wmjoers)
I know :-) The ChessClient.py application is just a proof-of-concept and when the ChessBoard.py implementation returns "MUST_SET_PROMOTION" it will always set the promotion value to Queen.
August 7, 2007 5:40am - Will McGugan - nickname: (willmcgugan) - 4/5
Nice. Pawn promotion doesn't give you the option of selecting knight, bishop or rook though.
January 4, 2007 1:47pm - John Eriksson - nickname: (wmjoers)
Hehe..that's because I have one very thorough and active user/tester, Jasper. Without you I would probably never have got around to make another release of ChessBoard.
January 3, 2007 9:57am - Jasper Stolte - nickname: (apex) - 4/5
Getting better and better every release!
August 16, 2006 8:57am - Anonymous - nickname: ()
???????????/
August 16, 2006 8:43am - Anonymous - nickname: ()
Bad Bad.
Is't it: Can't find downloads.
??
NEXT.
August 16, 2006 8:39am - Anonymous - nickname: ()
Good game!
August 11, 2006 2:59pm - Anonymous - nickname: () - 4/5
Reminds me of chess on television from the 1980s - that's a good thing, by the way. A clean and usable implementation of the game!
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Apr 21, 2014


Apr 19, 2014

Apr 16, 2014

Apr 13, 2014

Apr 9, 2014

Mar 18, 2014


Mar 15, 2014


Mar 14, 2014

Mar 13, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)