Book = BOOKFAIL;
Raw_ClearScreen();
Raw_UpdateDisplay(0, 0, 1, 0);
- fputs(". Exit to main\n", stdout);
- fputs("# Clear board\n", stdout);
- fputs("c Change sides\n", stdout);
- fputs("enter piece & location: \n", stdout);
+ printf(". Exit to main\n");
+ printf("# Clear board\n");
+ printf("c Change sides\n");
+ printf("enter piece & location:\n");
a = black;
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;
}
sq = locn(r, c);
- color[sq] = a;
- board[sq] = no_piece;
for (i = no_piece; i <= king; 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)
+ printf("# Invalid piece type '%c'\n", s[0]);
}
for (sq = 0; sq < NO_SQUARES; sq++)