#NEWLINE# def getAllMovesLegal( self , side ) : #NEWLINE# #INDENT# unfilteredMoves = list ( self . getAllMovesUnfiltered ( side ) ) #NEWLINE# legalMoves = [ ] #NEWLINE# for move in legalMoves : #NEWLINE# #INDENT# if self . moveIsLegal ( move ) : #NEWLINE# #INDENT# legalMoves . append ( move ) #NEWLINE# #UNINDENT# #UNINDENT# return legalMoves