summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-01-10 01:23:21 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-01-10 01:23:21 +0000
commit62804d0e3a4083c32d48e3ad764864f676ec9364 (patch)
tree424217331b4423ad490874fda0c1ba460f06d974 /games
parent89043c4fe61158223fb871a39e3f87bb992ec690 (diff)
bonus points for completing rows, like most variants.
ok deraadt mcbride millert nick otto pjanzen
Diffstat (limited to 'games')
-rw-r--r--games/tetris/tetris.64
-rw-r--r--games/tetris/tetris.c20
2 files changed, 22 insertions, 2 deletions
diff --git a/games/tetris/tetris.6 b/games/tetris/tetris.6
index 3c2c054d5e2..6e86f6b1210 100644
--- a/games/tetris/tetris.6
+++ b/games/tetris/tetris.6
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tetris.6,v 1.12 2003/06/03 03:01:41 millert Exp $
+.\" $OpenBSD: tetris.6,v 1.13 2004/01/10 01:23:20 tedu Exp $
.\"
.\" Copyright (c) 1992, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -121,6 +121,8 @@ When the blocks stack up to the top of the screen, the game is over.
You get one point for every block you fit into the stack,
and one point for every space a block falls when you hit the drop key.
(Dropping the blocks is therefore a good way to increase your score.)
+Completing a row rewards you with a bonus corresponding to the number
+of simultaneous rows completed.
Your total score is the product of the level of play
and your accumulated
.ie t points\(em200
diff --git a/games/tetris/tetris.c b/games/tetris/tetris.c
index 2f9eccf2b07..778a5f3e72b 100644
--- a/games/tetris/tetris.c
+++ b/games/tetris/tetris.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tetris.c,v 1.18 2003/06/03 03:01:41 millert Exp $ */
+/* $OpenBSD: tetris.c,v 1.19 2004/01/10 01:23:20 tedu Exp $ */
/* $NetBSD: tetris.c,v 1.2 1995/04/22 07:42:47 cgd Exp $ */
/*-
@@ -99,6 +99,7 @@ setup_board()
static void
elide()
{
+ int rows = 0;
int i, j, base;
cell *p;
@@ -108,6 +109,7 @@ elide()
for (j = B_COLS - 2; *p++ != 0;) {
if (--j <= 0) {
/* this row is to be elided */
+ rows++;
memset(&board[base], 0, B_COLS - 2);
scr_update();
tsleep();
@@ -119,6 +121,22 @@ elide()
}
}
}
+ switch (rows) {
+ case 1:
+ score += 10;
+ break;
+ case 2:
+ score += 30;
+ break;
+ case 3:
+ score += 70;
+ break;
+ case 4:
+ score += 150;
+ break;
+ default:
+ break;
+ }
}
const struct shape *