Commit Graph

31 Commits

Author SHA1 Message Date
Mitch Peck
1592263258 Update player with split fields, stub out playSplit, and playSplit tests 2022-02-19 18:06:20 -06:00
Mitch Peck
5f28cd03fe Implement compareHands method, add compareHands tests and fix UserIO Test 2022-02-18 19:35:54 -06:00
Dave Burke
db1e32a314 Use double to store bets
The original basic allowed fractional bets.
2022-02-11 13:02:22 -06:00
Dave Burke
df86d49bb7 Fix print call syntax 2022-02-11 12:37:15 -06:00
Dave Burke
5c998f3bb5 Add TODO to use fractions for bets 2022-02-11 12:37:09 -06:00
Dave Burke
a6cf574479 Add notes about insurance 2022-02-09 21:51:31 -06:00
Dave Burke
f65c2de058 Add comments and tasks 2022-02-09 21:40:27 -06:00
Dave Burke
2b2f9327f7 Implement play() and scoreHand() 2022-02-09 21:19:04 -06:00
Dave Burke
0760f22494 Add example i/o test 2022-02-07 21:59:02 -06:00
Dave Burke
0b1f57ae4f Refactor to allow testing side effects
By externalizing the source of i/o and randomness for shuffling, we can
inject non-interactive and deterministic behavior during unit tests.
2022-02-07 21:59:02 -06:00
Dave Burke
15c26cbe09 Limit number of decks to 1
The subroutine to get a card shuffles 52 cards when the deck is run
through:

100 REM--SUBROUTINE TO GET A CARD.  RESULT IS PUT IN X.
110 IF C<51 THEN 230
120 PRINT "RESHUFFLING"
130 FOR D=D TO 1 STEP -1
140 C=C-1
150 C(C)=D(D)
160 NEXT D
170 FOR C1=52 TO C STEP -1
180 C2=INT(RND(1)*(C1-C+1))+C
190 C3=C(C2)
200 C(C2)=C(C1)
210 C(C1)=C3
220 NEXT C1
230 X=C(C)
240 C=C+1
250 RETURN
2022-02-03 08:31:04 -06:00
Dave Burke
914f123bfc Implement unit tests for Blackjack Java 2022-02-02 21:36:16 -06:00
Mitch Peck
1b06396308 Implement print initial deal 2022-02-02 19:15:37 -06:00
Mitch Peck
20c7869232 Update Player object and initialize Players 2022-02-01 20:21:30 -06:00
Dave Burke
ea6ec35044 Remove a junk TODO 2022-01-25 21:25:16 -06:00
Dave Burke
9d71f4ea8c Add a couple more notes 2022-01-25 21:19:15 -06:00
Dave Burke
ff2859e0d0 Add Blackjack/java outline with TODO placeholders 2022-01-25 21:16:26 -06:00
Dave Burke
080d6ccee4 Implement shuffled deck 2022-01-23 21:36:57 -06:00
Dave Burke
51f173c9da Make Card immutable 2022-01-23 21:36:42 -06:00
Dave Burke
7bf2a0443b Fix imports in Player 2022-01-23 21:17:22 -06:00
Dave Burke
83c1e65278 Make Suit an enum in Card 2022-01-23 21:17:10 -06:00
Dave Burke
bd00700d18 Fix inputs to match original BASIC behavior. 2022-01-23 21:07:19 -06:00
Mitch Peck
3411d33f18 Add Player and Card objects 2022-01-22 20:15:09 -06:00
Dave Burke
92da37d0d5 Prompt for bets and add notes on classes 2022-01-21 13:01:03 -06:00
Dave Burke
71c7dc4d91 Formatting fixes 2022-01-21 13:00:35 -06:00
Dave Burke
f941ef42fe Refactor input prompts
After experimenting with both versions, I find System.console() to
produce more readable code than using a Scanner.
2022-01-20 21:56:51 -06:00
Dave Burke
3f42a86e65 Implement instructions prompt 2022-01-18 12:55:21 -06:00
Dave Burke
e460dac3a4 Add stub implementation of Blackjack in Java 2022-01-18 12:36:16 -06:00
Zev Spitz
75def2707d Add sln and csroj/vbproj files where missing 2022-01-16 08:17:31 +02:00
LukasMurdock
7e3304c907 add 1-16
16:Bug
“If you elect to see all the pictures, this program has the ability of consuming well over six feet of terminal paper per run. We can only suggest recycling the paper by using the other side.”
2022-01-02 19:06:19 -05:00
Chris Reuter
d26dbf036a Removed spaces from top-level directory names.
Spaces tend to cause annoyances in a Unix-style shell environment.
This change fixes that.
2021-11-21 18:30:21 -05:00