ichabod801 / t_games

A collection of command-line interface games written in Python.
GNU General Public License v3.0
20 stars 4 forks source link

Chess invalid move error. #560

Closed ichabod801 closed 4 years ago

ichabod801 commented 4 years ago

I meant to castle, but used Kg2 instead of Kg1. Got this error:

  File "C:\Users\Craig\Documents\t_games\other_cmd.py", line 177, in handle_cmd
    return self.default(text)
  File "C:\Users\Craig\Documents\t_games\board_games\chess_game.py", line 210, in default
    return self.do_move(text)
  File "C:\Users\Craig\Documents\t_games\board_games\chess_game.py", line 306, in do_move
    sun_move = self.parse_move(arguments)
  File "C:\Users\Craig\Documents\t_games\board_games\chess_game.py", line 463, in parse_move
    return self.parse_algebraic(text, match)
  File "C:\Users\Craig\Documents\t_games\board_games\chess_game.py", line 402, in parse_algebraic
    return self.parse_piece(groups, match_type)
  File "C:\Users\Craig\Documents\t_games\board_games\chess_game.py", line 545, in parse_piece
    return (None, '{} is not a legal move.'.format(text))
NameError: name 'text' is not defined