diff options
| author | mo <mo.khan@gmail.com> | 2019-06-18 17:32:01 -0600 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2019-06-18 17:32:01 -0600 |
| commit | 2536468585c49815096ed0ad2b9f6b269b99496d (patch) | |
| tree | adbe305665793ab1665d78ac2ba1cb5b5ebbbe44 | |
| parent | bf82cc693a1a6cdfabf49e4883fb7c90c6fcf266 (diff) | |
invert unless to if
| -rw-r--r-- | src/Q4/RandomSumGame.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/Q4/RandomSumGame.java b/src/Q4/RandomSumGame.java index 30080c2..260970d 100644 --- a/src/Q4/RandomSumGame.java +++ b/src/Q4/RandomSumGame.java @@ -25,11 +25,8 @@ public class RandomSumGame { public void play(int d1, int d2) { int total = d1 + d2; this.puts("You rolled: %d", total); - if (!hasValuePoint()) { - this.firstPlay(total); - } else { - this.subsequentPlay(total); - } + if (hasValuePoint()) this.subsequentPlay(total); + else this.firstPlay(total); } public void rollDice() { |
