From 4706b0b3e4324e289c7ed9dbdb6ae1174c7fcce5 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 22 Oct 2010 00:25:17 -0400 Subject: [PATCH] Choose a reasonable default for pause. --- tet.c | 18 ++++++++++++++++-- tetrix.xml | 3 +-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tet.c b/tet.c index 0ad4784..fc59008 100644 --- a/tet.c +++ b/tet.c @@ -9,6 +9,20 @@ #include #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= 2) InitPause = atoi(argv[1]); else - InitPause = 150; + InitPause = DEFAULT_INITPAUSE; Init(); for ( ; ; ) { NewGame(); diff --git a/tetrix.xml b/tetrix.xml index a196df3..0ecc6ac 100644 --- a/tetrix.xml +++ b/tetrix.xml @@ -25,8 +25,7 @@ DESCRIPTION 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. -- 2.43.0