22 18_blackjack_hard - agarmstrong21/agarmstrong_swd_2019 GitHub Wiki
22-18_BlackJack_Hard
Problem Statement
User Documentation
This program plays the simple game of BlackJack. There is one thing before we start though. This game is based off of Mine House Rules which are as follows:
- Dealer is treated as a player
- Dealer can stop drawing or keep drawing whenever
- Aces are treated as ones, not elevens
- Suits do not matter
- If tie, no one wins
- We don't say hit or stay, we stay or draw
- If one stays and one draws, the player who stayed can draw again after next round
There are no linked game rules we should base out the game off of, thus, I based it off of how I played it
This program starts up a server and a client which are treated as dealer and player respectively. Dealer does all the talking and communicating, but the player can play whatever the user inputs. Each party is given two randomly selected cards that come from the 52 card deck. Then all parties can decide weather to draw or stay. If one goes over 21, they automatically lose. Then after all parties stay, they compare cards and whoever has the highest cards wins.
Developer Documentation
ServerDriver and ClientDriver start up the Server and Client respectively. Once started, the Server, or called Dealer, wait til there is a connection, or packet sent from the Client, or player. Once that is received, then the game will begin. The Dealer pushes messages out into the GUI giving information about the cards and who does what. User input is on the Player side which contains a text field and a text area. When the game starts, a new deck is created with 13 cards of each suit, then randomly grabs a card from the deck use the rdmCard method that takes in the deck. Then outputs a random card which needs to be removed from the deck. Gives it to the respectively player, then continues to ask the Player if they wish to stay or draw. If draw, the process happens again, if stays, the dealer will draw until they reach 21 or higher. The dealer will draw even if the player draws too. Once all parties stay, then the WhoWins method will be called to display who wins and what their cards and totals were.
Java Docs
The java documents are served from a local web server on this machine. To start the web server, navigate to the directory immediately above where the source code is checked out (i.e. ~/git ) and then use "python -m SimpleHTTPServer" in that directory.
cd ~/git python -m SimpleHTTPServer&
Note: if you are running python 3 (which you can check via opening a terminal and typing: python --version), then the command is:
python3 -m http.server
Java Docs for 22-18_BlackJack_Hard