summaryrefslogtreecommitdiff
path: root/src/Q4/RandomSumGame.java
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2019-06-18 17:32:01 -0600
committermo <mo.khan@gmail.com>2019-06-18 17:32:01 -0600
commit2536468585c49815096ed0ad2b9f6b269b99496d (patch)
treeadbe305665793ab1665d78ac2ba1cb5b5ebbbe44 /src/Q4/RandomSumGame.java
parentbf82cc693a1a6cdfabf49e4883fb7c90c6fcf266 (diff)
invert unless to if
Diffstat (limited to 'src/Q4/RandomSumGame.java')
-rw-r--r--src/Q4/RandomSumGame.java7
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() {