diff options
author | ache <ache@FreeBSD.org> | 1997-09-24 23:33:25 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-09-24 23:33:25 +0000 |
commit | 2c123b9bffc82973887b119e363f497af390a08c (patch) | |
tree | 1461047583ae69ba093b932c0e7d062d7c39254c /games/snake | |
parent | ee017c7e5d0a30a65f28679c30525ce96bb3a418 (diff) | |
download | FreeBSD-src-2c123b9bffc82973887b119e363f497af390a08c.zip FreeBSD-src-2c123b9bffc82973887b119e363f497af390a08c.tar.gz |
Convert to random()
Diffstat (limited to 'games/snake')
-rw-r--r-- | games/snake/snake/snake.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/games/snake/snake/snake.c b/games/snake/snake/snake.c index b9776cb..6325406 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 <wt[i]) break; @@ -787,7 +787,7 @@ pushsnake() { surround(&you); i = (cashvalue) % 10; - bonus = ((rand()>>8) & 0377)% 10; + bonus = random() % 10; ll(); pr("%d\n", bonus); delay(30); |