Question
The language is Java using JavaFX for the GUI part. Thank you! You are going to implement a GUI blackjack program that allows a single
The language is Java using JavaFX for the GUI part. Thank you!
You are going to implement a GUI blackjack program that allows a single player to play vs a single dealer. For those who do not know blackjack, the idea is that the player and dealer are each dealt 2 cards. These cards have a point value and the goal is for the player and dealer to reach a point value of 21 (or as close as they dare) without going over. The player is allowed to chose if they want to draw another card (hit) or if they want to hold (stand). The dealer on the other hand has a set of rules which forces them to hit or stay. For those of you who do not know the basic rules and play structure of this game, please checkout this link (Links to an external site.)Links to an external site..
Rules
The player and dealer are each dealt 2 cards. All of the players cards are dealt face up, the dealers first two cards are dealt one face up and one face down. After the card dealing, the player is given the option to either hit (draw a card) or stand (end their turn). The player may hit as many times as they want until they either go over 21 or they wish to stand. If the player goes over 21, they lose the round and the dealer wins.
After the player has completed their turn, the dealer will reveal both cards and if they have a 21, will automatically win unless the player has 21 as well which results in a tie. If it is not a 21, then they have rules to follow to decide if they hit or stand. As long as the dealer's cards are less than 17, then the dealer must hit, this holds true even if the dealer is currently beating the player. If the dealer goes over 21, then they bust and the player wins by default. If the dealer gets to 17 or higher then the player and dealer compare scores to see who is closest to 21. In a tie, there is no win or loss.
For the case of our game, you are only required to use a single standard 52 card playing deck and keep track of which cards have already been played. There is an extra credit option to use more.
Card Values
Aces - these are worth 11 or 1 point based upon what is best for the player/dealer
King, Queen, Jack - These are all worth 10 points
Any non-face card is worth exactly what its number value is
Jokers - not used
Optional Variations
The program will allow for different numbers of decks to be used. When the game is started, the user will be prompted to either use a single deck or 6 decks combined like they do at Vegas. The reason multiple decks are used is to combat card counting as this makes it far more challenging to calculate the odds on the fly. This still requires tracking what has been played and ensuring you do not exceed the amounts available.
You can implement rules to double down or split. You could also implement a betting system beyond tracking win/loss where the player can select how much to bet on each hand. For those who wish to do any of these variations or others, you are welcome to view the rules here (Links to an external site.)Links to an external site. and make it as complex as you like.
Betting. Instead of tracking wins/losses you can add a betting feature to allow the player to make wagers and keep track of their virtual "winnings". Then instead of tracking an overall win/loss record, you can save and restore a list of highest winnings.
Programming Requirements
The goal of this project is to utilize lists and queues to manage which cards are in play and which ones are in play for each player and which ones have been discarded post play. There are many ways to do this, arrays, linked lists, array lists, etc. The idea is that once a card has been played, that specific card can no longer be drawn by anyone. So on a one card deck, if a King of Spades has been played, then until the deck is re-shuffled with the discard, no other King of spades will be drawn. On a multiple deck scenario, there are 6 king of spades, so you will have to track how many have been expended. It is absolutely required that every card that is in play, discarded and in the deck be tracked using an appropriate data structure. It is your choice in how to implement this.
This program will also require a GUI in order to be played. You have already experienced creating a GUI for your other projects, this is taking it a step further. The art does not have to be masterful, but it needs to be sufficient to allow a user to interact and play the game in full with just a mouse.
The program must track at a minimum wins, losses and ties for the player for a given session. Along with this, a top X (with X being at least 10) list of winners and their scores, should be tracked in a file that is automatically saved and loaded each time the game is closed and opened respectively.
The program must allow the player to chose to shuffle the cards between hands which takes all discarded, in play and in deck cards and re-shuffles them into the deck.
The program must compile 100% correctly without error, non-compiling code will not be graded.
These requirements are the bare minimum to achieve a C on this assignment. The better and more thoroughly you implement these requirements will be what will adjust your grade up beyond that.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started