summaryrefslogtreecommitdiffstats
path: root/trek
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-05-24 22:57:37 +0000
committerdholland <dholland@NetBSD.org>2009-05-24 22:57:37 +0000
commit6e00638d3efd69f666cca4ae6349e404dd5c4373 (patch)
tree27dee7254c514498361e1ac42cb1b9e555b112a1 /trek
parent04b8b3500b4c9df35ceefed6fdc1f8dfa9560447 (diff)
downloadbsdgames-darwin-6e00638d3efd69f666cca4ae6349e404dd5c4373.tar.gz
bsdgames-darwin-6e00638d3efd69f666cca4ae6349e404dd5c4373.tar.zst
bsdgames-darwin-6e00638d3efd69f666cca4ae6349e404dd5c4373.zip
Sprinkle some blank lines for readability.
Diffstat (limited to 'trek')
-rw-r--r--trek/score.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/trek/score.c b/trek/score.c
index eff3f8d8..a1dff624 100644
--- a/trek/score.c
+++ b/trek/score.c
@@ -1,4 +1,4 @@
-/* $NetBSD: score.c,v 1.8 2009/05/24 22:55:03 dholland Exp $ */
+/* $NetBSD: score.c,v 1.9 2009/05/24 22:57:37 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: score.c,v 1.8 2009/05/24 22:55:03 dholland Exp $");
+__RCSID("$NetBSD: score.c,v 1.9 2009/05/24 22:57:37 dholland Exp $");
#endif
#endif /* not lint */
@@ -55,9 +55,11 @@ score(void)
double r;
printf("\n*** Your score:\n");
+
s = t = Param.klingpwr / 4 * (u = Game.killk);
if (t != 0)
printf("%d Klingons killed\t\t\t%6d\n", u, t);
+
r = Now.date - Param.date;
if (r < 1.0)
r = 1.0;
@@ -65,43 +67,54 @@ score(void)
s += (t = 400 * r);
if (t != 0)
printf("Kill rate %.2f Klingons/stardate \t%6d\n", r, t);
+
r = Now.klings;
r /= Game.killk + 1;
s += (t = -400 * r);
if (t != 0)
printf("Penalty for %d klingons remaining\t%6d\n", Now.klings,
t);
+
if (Move.endgame > 0) {
s += (t = 100 * (u = Game.skill));
printf("Bonus for winning a %s%s game\t\t%6d\n",
Skitab[u - 1].abrev, Skitab[u - 1].full, t);
}
+
if (Game.killed) {
s -= 500;
printf("Penalty for getting killed\t\t -500\n");
}
+
s += (t = -100 * (u = Game.killb));
if (t != 0)
printf("%d starbases killed\t\t\t%6d\n", u, t);
+
s += (t = -100 * (u = Game.helps));
if (t != 0)
printf("%d calls for help\t\t\t%6d\n", u, t);
+
s += (t = -5 * (u = Game.kills));
if (t != 0)
printf("%d stars destroyed\t\t\t%6d\n", u, t);
+
s += (t = -150 * (u = Game.killinhab));
if (t != 0)
printf("%d inhabited starsystems destroyed\t%6d\n", u, t);
+
if (Ship.ship != ENTERPRISE) {
s -= 200;
printf("penalty for abandoning ship\t\t -200\n");
}
+
s += (t = 3 * (u = Game.captives));
if (t != 0)
printf("%d Klingons captured\t\t\t%6d\n", u, t);
+
s += (t = -(u = Game.deaths));
if (t != 0)
printf("%d casualties\t\t\t\t%6d\n", u, t);
+
printf("\n*** TOTAL\t\t\t%14ld\n", s);
return (s);
}