<s> """<STR_LIT>""" <EOL> from board import print_moves <EOL> from engines import Engine <EOL> class HumanEngine ( Engine ) : <EOL> """<STR_LIT>""" <EOL> def get_move ( self , board , color , move_num = None , <EOL> time_remaining = None , time_opponent = None ) : <EOL> """<STR_LIT>""" <EOL> legal_moves = board . get_legal_moves ( color ) <EOL> input = raw_input ( "<STR_LIT>" ) <EOL> move = HumanEngine . parse_input ( legal_moves , input ) <EOL> while move is None : <EOL> print "<STR_LIT>" <EOL> print_moves ( legal_moves ) <EOL> input = raw_input ( "<STR_LIT>" ) <EOL> move = HumanEngine . parse_input ( legal_moves , input ) <EOL> return move <EOL> @ staticmethod <EOL> def parse_input ( legal_moves , input ) : <EOL> """<STR_LIT>""" <EOL> if len ( input ) == <NUM_LIT:2> : <EOL> xc = input [ <NUM_LIT:0> ] <EOL> yc = input [ <NUM_LIT:1> ] <EOL> if xc >= '<STR_LIT:a>' and xc <= '<STR_LIT:h>' and yc >= '<STR_LIT:1>' and yc <= '<STR_LIT>' : <EOL> x = ord ( xc ) - ord ( '<STR_LIT:a>' ) <EOL> y = int ( yc ) - <NUM_LIT:1> <EOL> move = ( x , y ) <EOL> if move in legal_moves : <EOL> return move <EOL> else : <EOL> return None <EOL> engine = HumanEngine </s>
