]> thyrsus.com Git - tetrix.git/commitdiff
Choose a reasonable default for pause.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 22 Oct 2010 04:25:17 +0000 (00:25 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 22 Oct 2010 04:25:17 +0000 (00:25 -0400)
tet.c
tetrix.xml

diff --git a/tet.c b/tet.c
index 0ad478407cd4cc915f4a6e7632df00dcaa2ba2c1..fc59008f5827bbe81d967b1f867451e24e316ee3 100644 (file)
--- a/tet.c
+++ b/tet.c
@@ -9,6 +9,20 @@
 #include <string.h>
 #include "tet.h"
 
+/*
+ * Good on a 2GHz Intel Core2 Duo in 2010.
+ * Adjust upwards as technology advances.
+ * As a matter of historical interest here
+ * are the historical values for "reasonable:
+ * 2010 = 200000
+ * 2003 = 75000
+ * 1994 = 150
+ */
+#define DEFAULT_INITPAUSE      200000
+
+#define PAUSE_DECREMENT                (DEFAULT_INITPAUSE / 150)
+
+
 #define HIGHCOUNT      10      /* count of high scorers to show */
 #define SCORELEN       10      /* max length of score string */
 #define NAMELEN                10      /* max length of user name string */
@@ -435,7 +449,7 @@ TestRows(void)
                if (IS_FREE(MINX+x,MINY+y)) { fullrow = 0; break; }
            if (fullrow) {
                marked[y]++;
-               CurrentPause--; /* speed up the game */
+               CurrentPause -= PAUSE_DECREMENT;        /* speed up the game */
            }
            else    {
                for (x=0; x<BOARD_WIDE; x++)
@@ -487,7 +501,7 @@ char **argv;
     if (argc >= 2)
        InitPause = atoi(argv[1]);
     else
-       InitPause = 150;
+       InitPause = DEFAULT_INITPAUSE;
     Init();
     for ( ; ; ) {
        NewGame();
index a196df30ca4e62499f7321b365703cf9ee967db4..0ecc6ac34cc7d7517b73f41baaea4a3a1a4cb8f0 100644 (file)
@@ -25,8 +25,7 @@
 <refsect1 id='description'><title>DESCRIPTION</title>
 <para>A clone of the Tetris game. Documentation for the commands is
 on-screen.  The optional argument is an initial delay loop count
-between moves; on 2003-era personal computers it needs to be set to
-about 75,000.
+between moves; the game tries to default to a reasonable value.
 </para>
 
 </refsect1>