233 } else if (strncmp(movestr, "savepgn", MOVESTR_BUFLEN) == 0) { |
233 } else if (strncmp(movestr, "savepgn", MOVESTR_BUFLEN) == 0) { |
234 save_pgn(gamestate, gameinfo); |
234 save_pgn(gamestate, gameinfo); |
235 } else { |
235 } else { |
236 Move move; |
236 Move move; |
237 int result = eval_move(gamestate, movestr, &move, curcolor); |
237 int result = eval_move(gamestate, movestr, &move, curcolor); |
238 switch (result) { |
238 if (result == VALID_MOVE_SYNTAX) { |
239 case VALID_MOVE_SYNTAX: |
|
240 result = validate_move(gamestate, &move); |
239 result = validate_move(gamestate, &move); |
241 if (result == VALID_MOVE_SEMANTICS) { |
240 if (result == VALID_MOVE_SEMANTICS) { |
242 apply_move(gamestate, &move); |
241 apply_move(gamestate, &move); |
243 if (gamestate->checkmate) { |
242 if (gamestate->checkmate) { |
244 printw("Checkmate!"); |
243 printw("Checkmate!"); |