FILES- chessengine.py: Main module.
- test.py: Unit test.
- basic_ui.py: Basic interface to playing&testing.
- pieceset.py: Piece sets.
Examplefrom chessengine import Board
from pieceset import default as defaultset
board = Board(defaultset)
# a2 square
a2 = board.square[0][1] # x:0 y:1
# a4 square
a4 = board.square[0][4] # x:0 y:3
# move a pawn which is located in a2, to a4
pawn = a2.piece
if pawn.movement.count(a4): # has it got the a4 square in it's movement array?
pawn.move(a4)
|