int mycnt1, mycnt2;
-#define MARGIN (4)
+#define MARGIN (5)
#define TAB (58)
#define VIR_C(s) ((flag.reverse) ? (NO_COLS - 1 - column(s)) : column(s))
}
-static const short x0[2] = { 54, 2 };
-static const short y0[2] = { 20, 4 };
+static const short x0[2] = { MARGIN + 5*NO_COLS + 4, 2 };
+static const short y0[2] = { 4 + 2 * (NO_ROWS - 1), 4 };
/*
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);
}
s = 0;
if (player == black)
- gotoXY(20, (flag.reverse) ? 2 : 23);
+ gotoXY(20, (flag.reverse) ? 2 : (5 + 2*NO_ROWS));
else
- gotoXY(20, (flag.reverse) ? 23 : 2);
+ gotoXY(20, (flag.reverse) ? (5 + 2*NO_ROWS) : 2);
/* printw("%d:%02d %ld ", m, s, dt); */
printw("%d:%02d ", m, s);