summaryrefslogtreecommitdiffstats
path: root/games/cribbage
diff options
context:
space:
mode:
authorbillf <billf@FreeBSD.org>1999-09-07 06:00:03 +0000
committerbillf <billf@FreeBSD.org>1999-09-07 06:00:03 +0000
commit3e1d9f25c8a992fb915d18ffaccb3a266e8ad0a4 (patch)
treea392a79dd376bd7e8273e85fac9e7af604437b66 /games/cribbage
parent33adb981d4021526b69c31fe25c2fc524378289f (diff)
downloadFreeBSD-src-3e1d9f25c8a992fb915d18ffaccb3a266e8ad0a4.zip
FreeBSD-src-3e1d9f25c8a992fb915d18ffaccb3a266e8ad0a4.tar.gz
Avoid ambigious if() if() else().
Diffstat (limited to 'games/cribbage')
-rw-r--r--games/cribbage/crib.c3
-rw-r--r--games/cribbage/score.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/games/cribbage/crib.c b/games/cribbage/crib.c
index 22dddba..1655053 100644
--- a/games/cribbage/crib.c
+++ b/games/cribbage/crib.c
@@ -570,7 +570,7 @@ peg(mycrib)
prhand(ph, pnum, Playwin, FALSE);
prhand(ch, cnum, Compwin, TRUE);
prtable(sum);
- if (last)
+ if (last) {
if (played) {
msg(quiet ? "I get one for last" :
"I get one point for last");
@@ -583,6 +583,7 @@ peg(mycrib)
if (chkscr(&pscore, 1))
return TRUE;
}
+ }
return (FALSE);
}
diff --git a/games/cribbage/score.c b/games/cribbage/score.c
index ecfed9a..073a04a 100644
--- a/games/cribbage/score.c
+++ b/games/cribbage/score.c
@@ -152,21 +152,23 @@ scorehand(hand, starter, n, crb, do_explain)
sorthand(h, n + 1); /* sort by rank */
i = 2 * fifteens(h, n + 1);
score += i;
- if (do_explain)
+ if (do_explain) {
if (i > 0) {
(void) sprintf(buf, "%d points in fifteens", i);
strcat(expl, buf);
} else
strcat(expl, "No fifteens");
+ }
i = pairuns(h, n + 1);
score += i;
- if (do_explain)
+ if (do_explain) {
if (i > 0) {
(void) sprintf(buf, ", %d points in pairs, %d in runs",
pairpoints, runpoints);
strcat(expl, buf);
} else
strcat(expl, ", No pairs/runs");
+ }
return (score);
}
OpenPOWER on IntegriCloud