|
@@ -50,10 +50,9 @@ public class Craps extends DiceGame implements Gamble {
|
50
|
50
|
|
51
|
51
|
public void play(CrapsPlayer currentPlayer) {
|
52
|
52
|
placeBet(currentPlayer);
|
53
|
|
- int sum = rollDie(2);
|
54
|
|
-
|
|
53
|
+ int sum;
|
55
|
54
|
promptEnterKey("roll dice");
|
56
|
|
- printRollSum(sum);
|
|
55
|
+ printRollSum(sum = rollDie(2));
|
57
|
56
|
|
58
|
57
|
simulateCraps(currentPlayer, sum);
|
59
|
58
|
}
|
|
@@ -77,12 +76,6 @@ public class Craps extends DiceGame implements Gamble {
|
77
|
76
|
} while (sum != point && sum != 7);
|
78
|
77
|
}
|
79
|
78
|
|
80
|
|
- public void print(){
|
81
|
|
- for(int i = 0; i < crapsPlayers.size(); i++){
|
82
|
|
- System.out.println(crapsPlayers.get(i).getP().getChipBalance());
|
83
|
|
- }
|
84
|
|
- }
|
85
|
|
-
|
86
|
79
|
public void printRollAgain(int point){
|
87
|
80
|
console.println("\n=====================" +
|
88
|
81
|
"\nPoint to roll for: " + point + "\n=====================");
|
|
@@ -107,6 +100,7 @@ public class Craps extends DiceGame implements Gamble {
|
107
|
100
|
console.println("\n*********\nYOU LOSE!\n*********\n");
|
108
|
101
|
evaluateBet(player, -bet);
|
109
|
102
|
}
|
|
103
|
+
|
110
|
104
|
public void evalWin(Player player){
|
111
|
105
|
console.println("\n*******************************\n" +
|
112
|
106
|
"WINNER WINNER CHICKEN DINNER!\n" +
|
|
@@ -120,8 +114,14 @@ public class Craps extends DiceGame implements Gamble {
|
120
|
114
|
|
121
|
115
|
public void promptEnterKey(String str){
|
122
|
116
|
String input = console.getStringInput("\n>> " +
|
|
117
|
+
|
123
|
118
|
"Press \"ENTER\" to " + str);
|
124
|
119
|
}
|
|
120
|
+ public void print(){
|
|
121
|
+ for(int i = 0; i < crapsPlayers.size(); i++){
|
|
122
|
+ System.out.println(crapsPlayers.get(i).getP().getChipBalance());
|
|
123
|
+ }
|
|
124
|
+ }
|
125
|
125
|
|
126
|
126
|
@Override
|
127
|
127
|
public void promptContinue(){}
|