|
@@ -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
|
}
|