Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/tetris PR/50411: Rin Okuyama: fix two bugs:
details: https://anonhg.NetBSD.org/src/rev/e508d10f5c42
branches: trunk
changeset: 341451:e508d10f5c42
user: christos <christos%NetBSD.org@localhost>
date: Fri Nov 06 19:53:37 2015 +0000
description:
PR/50411: Rin Okuyama: fix two bugs:
- clear blocks in the 0 row, otherwise the pile up forever.
- black (white) blocks are not shown as "next shape":
diffstat:
games/tetris/screen.c | 4 ++--
games/tetris/tetris.c | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diffs (37 lines):
diff -r e2ccd9c7cf4a -r e508d10f5c42 games/tetris/screen.c
--- a/games/tetris/screen.c Fri Nov 06 19:42:57 2015 +0000
+++ b/games/tetris/screen.c Fri Nov 06 19:53:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: screen.c,v 1.30 2015/07/07 22:53:25 nat Exp $ */
+/* $NetBSD: screen.c,v 1.31 2015/11/06 19:53:37 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -330,8 +330,8 @@
putstr("Next shape:");
/* draw */
+ setcolor(nextshape->color);
putpad(enter_standout_mode);
- setcolor(nextshape->color);
moveto(r, 2*c);
putstr(" ");
for(i=0; i<3; i++) {
diff -r e2ccd9c7cf4a -r e508d10f5c42 games/tetris/tetris.c
--- a/games/tetris/tetris.c Fri Nov 06 19:42:57 2015 +0000
+++ b/games/tetris/tetris.c Fri Nov 06 19:53:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tetris.c,v 1.30 2015/06/13 04:53:13 dholland Exp $ */
+/* $NetBSD: tetris.c,v 1.31 2015/11/06 19:53:37 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -116,6 +116,8 @@
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;
Home |
Main Index |
Thread Index |
Old Index