|
@@ -53,7 +53,7 @@ public class Craps extends DiceGame implements Gamble {
|
53
|
53
|
int sum = rollDie(2);
|
54
|
54
|
|
55
|
55
|
promptEnterKey("roll dice");
|
56
|
|
- console.println("Your roll sum equals: " + sum);
|
|
56
|
+ printRollSum(sum);
|
57
|
57
|
|
58
|
58
|
simulateCraps(currentPlayer, sum);
|
59
|
59
|
}
|
|
@@ -84,13 +84,13 @@ public class Craps extends DiceGame implements Gamble {
|
84
|
84
|
}
|
85
|
85
|
|
86
|
86
|
public void printRollAgain(int point){
|
87
|
|
- console.println("\n--------------------" +
|
88
|
|
- "\nPoint to roll for: " + point + "\n--------------------");
|
|
87
|
+ console.println("\n=====================" +
|
|
88
|
+ "\nPoint to roll for: " + point + "\n=====================");
|
89
|
89
|
promptEnterKey("roll again");
|
90
|
90
|
}
|
91
|
91
|
|
92
|
92
|
public void evalReRoll(CrapsPlayer currentPlayer, int sum, int point){
|
93
|
|
- console.println("You rolled a " + sum);
|
|
93
|
+ printRollSum(sum);
|
94
|
94
|
if (sum == 7) {
|
95
|
95
|
evalLoss(currentPlayer.getP());
|
96
|
96
|
} else if (sum == point) {
|
|
@@ -98,6 +98,11 @@ public class Craps extends DiceGame implements Gamble {
|
98
|
98
|
}
|
99
|
99
|
}
|
100
|
100
|
|
|
101
|
+ private void printRollSum(int sum) {
|
|
102
|
+ console.println("------------------------\n" +
|
|
103
|
+ "Your roll sum equals: " + sum + " \n------------------------");
|
|
104
|
+ }
|
|
105
|
+
|
101
|
106
|
public void evalLoss(Player player){
|
102
|
107
|
console.println("\n*********\nYOU LOSE!\n*********\n");
|
103
|
108
|
evaluateBet(player, -bet);
|
|
@@ -114,7 +119,8 @@ public class Craps extends DiceGame implements Gamble {
|
114
|
119
|
}
|
115
|
120
|
|
116
|
121
|
public void promptEnterKey(String str){
|
117
|
|
- String input = console.getStringInput("\nPress \"ENTER\" to " + str);
|
|
122
|
+ String input = console.getStringInput("\n>> " +
|
|
123
|
+ "Press \"ENTER\" to " + str);
|
118
|
124
|
}
|
119
|
125
|
|
120
|
126
|
@Override
|