#NEWLINE# def __init__( self , mateInOne = False , castleBoard = False , pessant = False , promotion = False ) : #NEWLINE# #INDENT# self . pieces = [ ] #NEWLINE# self . history = [ ] #NEWLINE# self . points = 0 #NEWLINE# self . currentSide = WHITE #NEWLINE# self . movesMade = 0 #NEWLINE# self . checkmate = False #NEWLINE# if ( ( not mateInOne ) and ( not castleBoard ) and ( not pessant ) and ( not promotion ) ) : #NEWLINE# #INDENT# self . pieces . extend ( [ Rook ( self , BLACK , C ( 0 , 7 ) ) , Knight ( self , BLACK , C ( 1 , 7 ) ) , Bishop ( self , BLACK , C ( 2 , 7 ) ) , King ( self , BLACK , C ( 3 , 7 ) ) , Queen ( self , BLACK , C ( 4 , 7 ) ) , Bishop ( self , BLACK , C ( 5 , 7 ) ) , Knight ( pawn2 , BLACK , C ( 6 , 7 ) ) , Rook ( self , BLACK , C ( 7 , 7 ) ) ] ) #NEWLINE# for x in range ( 8 ) : #NEWLINE# #INDENT# self . pieces . append ( Pawn ( self , BLACK , C ( x , 6 ) ) ) #NEWLINE# #UNINDENT# for x in range ( 8 ) : #NEWLINE# #INDENT# self . pieces . append ( Pawn ( self , WHITE , C ( x , 1 ) ) ) #NEWLINE# #UNINDENT# self . pieces . extend ( [ Rook ( self , WHITE , C ( 0 , 0 ) ) , Knight ( self , WHITE , C ( 1 , 0 ) ) , Bishop ( self , WHITE , C ( 2 , 0 ) ) , King ( self , WHITE , C ( 3 , 0 ) ) , Queen ( self , WHITE , C ( 4 , 0 ) ) , Bishop ( self , WHITE , C ( 5 , 0 ) ) , Knight ( self , WHITE , C ( 6 , 0 ) ) , Rook ( self , WHITE , C ( 7 , 0 ) ) ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if promotion : #NEWLINE# #INDENT# pawnToPromote = Pawn ( self , WHITE , C ( 1 , 6 ) ) #NEWLINE# pawnToPromote . movesMade = 1 #NEWLINE# kingWhite = King ( self , WHITE , C ( 4 , 0 ) ) #NEWLINE# kingBlack = King ( self , BLACK , C ( 3 , 2 ) ) #NEWLINE# self . pieces . extend ( [ pawnToPromote , kingWhite , kingBlack ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if pessant : #NEWLINE# #INDENT# pawn = Pawn ( self , WHITE , C ( 1 , 4 ) ) #NEWLINE# pawn2 = Pawn ( self , BLACK , C ( 2 , 6 ) ) #NEWLINE# kingWhite = King ( self , WHITE , C ( 4 , 0 ) ) #NEWLINE# kingBlack = King ( self , BLACK , C ( 3 , 2 ) ) #NEWLINE# self . pieces . extend ( [ pawn , pawn2 , kingWhite , kingBlack ] ) #NEWLINE# self . history = [ ] #NEWLINE# self . currentSide = BLACK #NEWLINE# self . points = 0 #NEWLINE# self . movesMade = 0 #NEWLINE# self . checkmate = False #NEWLINE# firstMove = Move ( pawn2 , C ( 2 , 4 ) ) #NEWLINE# self . makeMove ( firstMove ) #NEWLINE# self . currentSide = WHITE #NEWLINE# return