BSZ
game.user_x = 1 + (BSZ - 1) / 2;
game.user_y = 1 + (BSZ - 1) / 2;
for (int i = 0; i < 1 + BSZ + 1; i++, sp++) {
for (int row = 1; row <= BSZ; row++, sp++) {
for (int col = 1; col <= BSZ; col++, sp++) {
for (int i = 0; i < BSZ + 1; i++, sp++) {
if (col > BSZ - 4) {
} else if (col == BSZ - 4) {
for (int col = 1; col <= BSZ; col++) {
mvaddch(scr_y(BSZ + 1), scr_x(col), letters[col]);
for (int row = BSZ; row >= 1; row--) {
mvprintw(scr_y(row), scr_x(BSZ) + 2, "%d", row);
int available = 3 + (1 + scr_x(BSZ) - scr_x(1)) + 3;
mvhline(BSZ + 2, 0, ' ', available);
mvprintw(BSZ + 2, x, "BLACK/%.*s (*) vs. WHITE/%.*s (O)",
for (int row = BSZ + 1; --row > 0; ) {
for (int col = 1; col <= BSZ; col++) {
for (int row = BSZ + 1; --row > 0; ) {
for (int col = 1; col <= BSZ; col++) {
mvaddstr(BSZ + 4, 0, str);
move(BSZ + 4, len);
ev.y >= scr_y(BSZ) && ev.y <= scr_y(1) &&
ev.x >= scr_x(1) && ev.x <= scr_x(BSZ) &&
mvprintw(BSZ + 3, 6, "(%c %d) ", letters[x], y);
(void)mvhline(BSZ + 3, 6, ' ', 6);
x = 1 + (x + BSZ - 1) % BSZ;
y = 1 + (y + BSZ - 1) % BSZ;
#define scr_y(by) (1 + (BSZ - 1) - ((by) - 1))
#define TRANSCRIPT_COL (3 + (2 * BSZ - 1) + 3 + 3)
move(BSZ + 4, 0);
spot_index moves[BSZ * BSZ]; /* log of all played moves */
#define BAREA ((1 + BSZ + 1) * (BSZ + 1) + 1)
#define FAREA (2 * BSZ * (BSZ - 4) + 2 * (BSZ - 4) * (BSZ - 4))
#define PT(x, y) ((x) + (BSZ + 1) * (y))
mvprintw(BSZ + 3, 0, "Black moves first. ");
move(BSZ + 3, 0);
move(BSZ + 3, 0);
return 1 <= u && u <= BSZ;
-(BSZ + 1) + 1, /* down + right */
-(BSZ + 1), /* down */
-(BSZ + 1) - 1 /* down + left */
for (int y = 1; y <= BSZ; y++)
for (int x = 1; x <= BSZ; x++)
spot_index os = PT(BSZ, BSZ); /* our spot */
spot_index ts = PT(BSZ, BSZ); /* their spot */
for (spot_index s = PT(BSZ, BSZ); s-- > PT(1, 1); ) {
for (spot_index s = PT(BSZ, BSZ) + 1; s-- > PT(1, 1); ) {
for (spot_index s = PT(BSZ, BSZ) + 1; s-- > PT(1, 1); ) {
return PT((BSZ + 1) / 2, (BSZ + 1) / 2);
for (spot_index s = PT(BSZ, BSZ) + 1; s-- > PT(1, 1); ) {
letters[s % (BSZ + 1)], s / (BSZ + 1));
while (x <= BSZ && letters[x] != letter)
if (x > BSZ)
for (ptr = buf; ptr < &buf[BSZ]; ) {
warnx("Line truncated to %d characters.", BSZ);
static char buf[BSZ];
(tl->l = malloc(BSZ)) == NULL) {
len < BSZ && (ch = getc(fp)) != EOF; ++len)