-/* $NetBSD: tetris.c,v 1.29 2015/06/13 04:15:51 dholland Exp $ */
+/* $NetBSD: tetris.c,v 1.33 2020/07/21 02:42:05 nia Exp $ */
/*-
* Copyright (c) 1992, 1993
cell board[B_SIZE]; /* 1 => occupied, 0 => empty */
int Rows, Cols; /* current screen size */
+int Offset; /* used to center board & shapes */
static const struct shape *curshape;
const struct shape *nextshape;
tsleep();
while (--base != 0)
board[base + B_COLS] = board[base];
+ /* don't forget to clear 0th row */
+ memset(&board[1], 0, B_COLS - 2);
scr_update();
tsleep();
break;
scr_init();
setup_board();
- srandom(getpid());
scr_set();
pos = A_FIRST*B_COLS + (B_COLS/2)-1;
static void
usage(void)
{
- (void)fprintf(stderr, "usage: %s [-ps] [-k keys] [-l level]\n",
+ (void)fprintf(stderr, "usage: %s [-bps] [-k keys] [-l level]\n",
getprogname());
exit(1);
}