From 5c998f3bb5fe40c9bfe8e652e3f4b30490003aa1 Mon Sep 17 00:00:00 2001 From: Dave Burke Date: Fri, 11 Feb 2022 12:37:09 -0600 Subject: [PATCH] Add TODO to use fractions for bets --- 10_Blackjack/java/src/Game.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/10_Blackjack/java/src/Game.java b/10_Blackjack/java/src/Game.java index be8b987e..afb4e20e 100644 --- a/10_Blackjack/java/src/Game.java +++ b/10_Blackjack/java/src/Game.java @@ -53,6 +53,8 @@ public class Game { for(int i = 0; i < nPlayers; i++) { // Note that the bet for player "1" is at index "0" in the bets // array and take care to avoid off-by-one errors. + // TODO the BASIC version allows fractional bets (e.g. '1.5') of arbitrary precision + // We can use a float if we want--the original basic has floating point errors. Or we could use BigDecimal if we really want to fix that. bets[i] = userIo.promptInt("#" + (i + 1)); //TODO: If there isn't a need for a separate Bets in the future, combine these two lines and convert to enhanced FOR loop players.get(i).setCurrentBet(bets[i]); }