Lauren Green před 6 roky
rodič
revize
e725de739e

+ 3
- 9
src/main/java/io/zipcoder/casino/Console.java Zobrazit soubor

@@ -7,7 +7,7 @@ public class Console {
7 7
     private String[] gameLib = {"yahtzee", "war", "three card stud"};
8 8
     private Game game = null;
9 9
     private Player player;
10
-    private boolean running = true;
10
+    public boolean running = true;
11 11
 
12 12
     Console(){}
13 13
 
@@ -24,8 +24,7 @@ public class Console {
24 24
 
25 25
     public void chooseGame()
26 26
     {
27
-        boolean play = true;
28
-        while(play) {
27
+        while(running) {
29 28
             System.out.println("Please choose a game to play!");
30 29
             String command = getCommand();
31 30
 
@@ -54,12 +53,7 @@ public class Console {
54 53
                     Printer.noMatchingGameName(gameLib);
55 54
                     break;
56 55
             }
57
-            System.out.println("Do you want to play another game? Y or N");
58
-            Scanner in = new Scanner(System.in);
59
-            String response = in.next();
60
-            if (response.equalsIgnoreCase("N")) {
61
-                play = false;
62
-            }
56
+
63 57
         }
64 58
 
65 59
     }

+ 1
- 0
src/main/java/io/zipcoder/casino/Yahtzee.java Zobrazit soubor

@@ -50,6 +50,7 @@ public class Yahtzee extends DiceGame implements Game, Gamble {
50 50
         payout();
51 51
         dicePlayer.printBalanceAtEnd();
52 52
         System.out.println();
53
+
53 54
     }
54 55
 
55 56
     public void startRound() {