aboutsummaryrefslogtreecommitdiff
path: root/games/cribbage/crib.c
diff options
context:
space:
mode:
Diffstat (limited to 'games/cribbage/crib.c')
-rw-r--r--games/cribbage/crib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/games/cribbage/crib.c b/games/cribbage/crib.c
index 4f7bf5c2b3c2..23c53dfe1bbf 100644
--- a/games/cribbage/crib.c
+++ b/games/cribbage/crib.c
@@ -207,9 +207,9 @@ game()
"Cut to see whose crib it is -- low card wins? ");
getline();
}
- i = (rand() >> 4) % CARDS; /* random cut */
+ i = random() % CARDS; /* random cut */
do { /* comp cuts deck */
- j = (rand() >> 4) % CARDS;
+ j = random() % CARDS;
} while (j == i);
addmsg(quiet ? "You cut " : "You cut the ");
msgcard(deck[i], FALSE);
@@ -377,7 +377,7 @@ cut(mycrib, pos)
"How many cards down do you wish to cut the deck? ");
getline();
}
- i = (rand() >> 4) % (CARDS - pos);
+ i = random() % (CARDS - pos);
turnover = deck[i + pos];
addmsg(quiet ? "You cut " : "You cut the ");
msgcard(turnover, FALSE);
@@ -387,7 +387,7 @@ cut(mycrib, pos)
win = chkscr(&cscore, 2);
}
} else {
- i = (rand() >> 4) % (CARDS - pos) + pos;
+ i = random() % (CARDS - pos) + pos;
turnover = deck[i];
addmsg(quiet ? "I cut " : "I cut the ");
msgcard(turnover, FALSE);