From 2e210bcd36646a8da3afd07e5f309360732cb38d Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Wed, 24 Sep 1997 23:33:25 +0000 Subject: [PATCH] Convert to random() --- games/snake/snake/snake.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/games/snake/snake/snake.c b/games/snake/snake/snake.c index b9776cbbcb29..6325406b3171 100644 --- a/games/snake/snake/snake.c +++ b/games/snake/snake/snake.c @@ -585,7 +585,7 @@ struct point *sp, *np; } for(w=i=0; i<8; i++) w+= wt[i]; - vp = (( rand() >> 6 ) & 01777) %w; + vp = random() % w; for(i=0; i<8; i++) if (vp >8) & 0377)% 10; + bonus = random() % 10; ll(); pr("%d\n", bonus); delay(30);