Book = BOOKFAIL;
Curses_ClearScreen();
Curses_UpdateDisplay(0, 0, 1, 0);
- gotoXY(TAB, 3);
+ gotoXY(TAB, 11);
printw(". Exit to main\n");
- gotoXY(TAB, 4);
+ gotoXY(TAB, 12);
printw("# Clear board\n");
- gotoXY(TAB, 5);
+ gotoXY(TAB, 13);
printw("c Change sides\n");
gotoXY(TAB, 7);
printw("Enter piece & location: ");
while(1)
{
- gotoXY(TAB, 6);
+ gotoXY(TAB, 4);
printw("Editing: %s", ColorStr[a]);
gotoXY(TAB + 2, 8);
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);
- color[sq] = a;
- board[sq] = no_piece;
for (i = NO_PIECES; i > no_piece; i--)
{
if ((s[0] == pxx[i]) || (s[0] == qxx[i]))
{
+ color[sq] = a;
if (s[3] == '+')
board[sq] = promoted[i];
else
}
}
-
- if (found == 0)
- color[sq] = neutral;
+ if (!found)
+ AlwaysShowMessage("Invalid piece type '%c'", s[0]);
DrawPiece(sq);
}