mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 15:37:51 -08:00
MAINT: Apply pre-commit
Remove byte-order-marker pre-commit check as there would be many adjustments necessary
This commit is contained in:
@@ -16,7 +16,7 @@ public class Bet {
|
||||
return ((target > 0) && (target <= 50) &&
|
||||
(amount >= 5) && (amount <= 500));
|
||||
}
|
||||
|
||||
|
||||
/* utility to return either the odds amount in the case of a win, or zero for a loss */
|
||||
private int m(boolean isWon, int odds) {
|
||||
return isWon? odds: 0;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class Roulette {
|
||||
|
||||
private BufferedReader reader;
|
||||
private PrintStream writer;
|
||||
|
||||
|
||||
private int house; // how much money does the house have
|
||||
private int player; // how much money does the player have
|
||||
private Wheel wheel = new Wheel();
|
||||
@@ -156,7 +156,7 @@ public class Roulette {
|
||||
HashSet<Integer> betsMade = new HashSet<>(); // Bet targets already made, so we can spot repeats
|
||||
ArrayList<Bet> bets = new ArrayList<>(); // All the bets for this round
|
||||
|
||||
while (bets.size() < betCount) {
|
||||
while (bets.size() < betCount) {
|
||||
Bet bet = new Bet(0, 0); // an invalid bet to hold the place
|
||||
while (!bet.isValid()) { // keep asking until it is valid
|
||||
try {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class Wheel {
|
||||
pocket = random.nextInt(38) + 1;
|
||||
} while (random.nextInt(4) > 0); // keep spinning until it stops
|
||||
}
|
||||
|
||||
|
||||
// The string representation of the number; 1-36, 0, or 00
|
||||
public String value() {
|
||||
if (pocket == 37) return "0";
|
||||
|
||||
Reference in New Issue
Block a user