From fa2fb48436845a871860d40af3ab8297d98a45e4 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 7 Jun 2017 15:20:19 -0400 Subject: [PATCH] Localize K in score.c. --- score.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/score.c b/score.c index f97cd46..3c94f83 100644 --- a/score.c +++ b/score.c @@ -9,7 +9,7 @@ void score(long mode) /* mode is <0 if scoring, >0 if quitting, =0 if died or won */ { - long i, score = 0, mxscor = 0; + long i, k, score = 0, mxscor = 0; /* The present scoring algorithm is as follows: * Objective: Points: Present total possible: @@ -32,17 +32,16 @@ void score(long mode) /* First tally up the treasures. Must be in building and not broken. * Give the poor guy 2 points just for finding each treasure. */ - for (i=MINTRS; i<=MAXTRS; i++) { if(PTEXT[i] != 0) { - K=12; - if(i == CHEST)K=14; - if(i > CHEST)K=16; + k=12; + if(i == CHEST)k=14; + if(i > CHEST)k=16; if(game.prop[i] >= 0) score=score+2; if(game.place[i] == 3 && game.prop[i] == 0) - score=score+K-2; - mxscor=mxscor+K; + score=score+k-2; + mxscor=mxscor+k; } } @@ -52,7 +51,6 @@ void score(long mode) * indicates whether he reached the endgame. And if he got as far as * "cave closed" (indicated by "game.closed"), then bonus is zero for * mundane exits or 133, 134, 135 if he blew it (so to speak). */ - score=score+(MAXDIE-game.numdie)*10; mxscor=mxscor+MAXDIE*10; if(mode == 0)score=score+4; -- 2.31.1