exercism

Exercism solutions.
Log | Files | Refs

commit 36f046e6e9241b73ca1877f3b48a9e44d85da138
parent 3393154d15cd0a8fcc0a0713502019ed713cd246
Author: dwrz <dwrz@dwrz.net>
Date:   Wed, 15 May 2019 02:04:50 +0000

Refactor c/beer-song sing var name for clarity

Diffstat:
Mc/beer-song/src/beer_song.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/c/beer-song/src/beer_song.c b/c/beer-song/src/beer_song.c @@ -41,13 +41,13 @@ int verse(char* response, int bottles) { void sing(char *response, int start, int finish) { char *origin = response; - for (int i = start; i >= finish; i--) { - int charsAdded = verse(response, i); + for (int bottles = start; bottles >= finish; bottles--) { + int charsAdded = verse(response, bottles); response += charsAdded; // Add a newline between verses, // except for the last verse. - if (i != finish) { + if (bottles != finish) { sprintf(response, "\n"); response += 1; }