diff options
-rw-r--r-- | main.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -67,7 +67,7 @@ static void persist(struct board *bd){ // returns false iff game over static bool spawn(struct board *bd){ - int idx=rand()%7; + int idx=random()%7; bd->stone=stones[idx]; bd->stx=WID/2-1; bd->sty=0; @@ -152,7 +152,11 @@ static void rotR(struct board *bd){ int main(void){ - srand(time(NULL)); + { + struct timeval tv; + gettimeofday(&tv,NULL); + srandom(tv.tv_sec*1000000L+tv.tv_usec); + } initkeyboard(false); atexit(endkeyboard); |