NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/50411: very long-lived bug in tetris(6)



>Number:         50411
>Category:       bin
>Synopsis:       very long-lived bug in tetris(6)
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 06 19:45:01 +0000 2015
>Originator:     Rin Okuyama
>Release:        7.99.21
>Organization:
Department of Physics, Tohoku University
>Environment:
NetBSD XXX 7.99.21 NetBSD 7.99.21 (XXX) #0: Tue Oct  6 01:38:01 JST 2015  root@XXX:XXX amd64
>Description:
Once blocks pile up to 0th row (out of the window), they reside there
forever; If you elide a row in the window, replica of them appears at
1st row, but they are not removed. See screen shots below:

  https://twitter.com/LabDrunker/status/662711003520499712

This should be one of the most long-lived bugs in Net/4.4BSD, that is
trackable back to 1994.

By the way, black (white) blocks are not shown as "next shape":

  https://twitter.com/LabDrunker/status/662711613418377216

I've also fixed it on this occasion.
>How-To-Repeat:
Pile blocks up to 0th row, then elide rows in the window. This should
require some skills in the game ;-).

For the latter, play the game with -p option in color-capable terminals.
>Fix:
--- src/games/tetris/screen.c.orig	2015-11-07 01:39:41.000000000 +0900
+++ src/games/tetris/screen.c	2015-11-07 02:23:37.000000000 +0900
@@ -330,8 +330,8 @@
 		putstr("Next shape:");
 						
 		/* draw */
-		putpad(enter_standout_mode);
 		setcolor(nextshape->color);
+		putpad(enter_standout_mode);
 		moveto(r, 2*c);
 		putstr("  ");
 		for(i=0; i<3; i++) {
--- src/games/tetris/tetris.c.orig	2015-11-07 02:26:42.000000000 +0900
+++ src/games/tetris/tetris.c	2015-11-07 03:12:35.000000000 +0900
@@ -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