X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Frain.c;h=646ab96ee639f7b10af6dc42fa260287fbe22309;hp=4132a43826fe5948435c91a1ee08e1653b2c499d;hb=0eb88fc5281804773e2a0c7a488a4452463535ce;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1 diff --git a/test/rain.c b/test/rain.c index 4132a438..646ab96e 100644 --- a/test/rain.c +++ b/test/rain.c @@ -1,5 +1,5 @@ /* - * $Id: rain.c,v 1.11 1997/09/18 18:36:46 tom Exp $ + * $Id: rain.c,v 1.13 1999/10/23 01:31:26 tom Exp $ */ #include @@ -100,6 +100,12 @@ float c; curs_set(1); endwin(); return(EXIT_SUCCESS); + case 's': + nodelay(stdscr, FALSE); + break; + case ' ': + nodelay(stdscr, TRUE); + break; #ifdef KEY_RESIZE case(KEY_RESIZE): r = (float)(LINES - 4); @@ -122,10 +128,6 @@ onsig(int n GCC_UNUSED) static float ranf(void) { - float rv; - long r = rand(); - - r &= 077777; - rv =((float)r/32767.); - return rv; + long r = (rand() & 077777); + return ((float) r / 32768.); }