* XShogi is no longer included in the GNU Shogi source, it is
available as a separate source archive.
-* Fix clobbering of board on invalid input when editing board.
+* Fixes for edit mode:
+ - fixed clobbering of board on invalid input
+ - display a message on wrong input
* Fixed Curses mode display:
- reversed column number for MiniShogi
- clock position for MiniShogi
ClearEoln();
FLUSH_SCANW("%s", s);
found = 0;
+ ClearMessage();
if (s[0] == '.')
break;
break;
}
}
-
+ if (!found)
+ AlwaysShowMessage("Invalid piece type '%c'", s[0]);
continue;
}
c = COL_NUM(s[1]);
r = ROW_NUM(s[2]);
- if ((c < 0) || (c >= NO_COLS) || (r < 0) || (r >= NO_ROWS))
+ if ((c < 0) || (c >= NO_COLS) || (r < 0) || (r >= NO_ROWS)) {
+ AlwaysShowMessage("Out-of-board '%c%c'", s[1], s[2]);
continue;
+ }
sq = locn(r, c);
}
}
+ if (!found)
+ AlwaysShowMessage("Invalid piece type '%c'", s[0]);
+
DrawPiece(sq);
}
break;
}
}
+ if (!found)
+ printf("# Invalid piece type '%c'\n", s[0]);
continue;
}
r = ROW_NUM(s[2]);
if ((c < 0) || (c >= NO_COLS) || (r < 0) || (r >= NO_ROWS)) {
+ printf("# Out-of-board position '%c%c'\n", s[1], s[2]);
continue;
}
break;
}
}
+
+ if (!found)
+ printf("# Invalid piece type '%c'\n", s[0]);
}
for (sq = 0; sq < NO_SQUARES; sq++)