From 2536468585c49815096ed0ad2b9f6b269b99496d Mon Sep 17 00:00:00 2001 From: mo Date: Tue, 18 Jun 2019 17:32:01 -0600 Subject: invert unless to if --- src/Q4/RandomSumGame.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/Q4/RandomSumGame.java') 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() { -- cgit v1.2.3