Below is a copy of my programming assignment for my class. I have no idea where
ID: 3623533 • Letter: B
Question
Below is a copy of my programming assignment for my class. I have no idea where to begin and I've been working on it for hours. Can you please help?
InBetween
Objectives:
1. To practice working with structs, enums and static_cast
2. To practice program design
3. To practice using random values
In this assignment you will create a progam that will manage a two player verison of the card
game: Inbetween. See http://www.onlinepoker.net/Card-Games/In-Between.php for a general
description of the game; required rules are specified below.
Rules:
• Each player should begin with 100 points.
• The maximum bet is the lesser of: the player’s current stake or 10.
• When an Ace is drawn as either ‘boundary’ card, the player must be asked to make the
Ace high or low.
• If the two boundary cards have the same face value or are different by 1; an inbetween
card is NOT drawn: the player loses 10 points.
• If there are two or fewer cards remaining in the deck at the beginning of a player’s turn,
then the deck should be reshuffled – making all cards available once again.
• Winning/Losing
o When the inbetween card is strictly between the two boundary card values, the
player wins the round; their bet is added to their stake.
o When the inbetwen card matches either boundary card (in value), the player loses
twice their bet.
o Otherwise the player simply loses their bet.
Requirements ( they’re more like guidelines):
This assignment is purposefully somewhat open-ended. You will need to think about program
design and make design choices. A significant portion of your score will be an evaluation of
your design/implementation. This includes: modularity, readability (code & output) and
program organization.
Explanation / Answer
Make a 2D array of card objects. One dimension for the suit and the other for the value of the card (4 by 13). Each card does not necessarily need to have a variable for its value since you can use the array index for that, but you may find it helpful to do so. Each card should however, have a boolean as to whether or not it is in the deck currently. When you reshuffle, this boolean needs to be reset. You should first have an input asking for the number of players. Then create an array of player objects (rules state that you may have 2 to 8 players). The players should have score variables and current bet variables, and also should have references to whatever card objects they have. You could do this with an arraylist "hand" that changes as the game progresses. It would also be good to have a boolean for whether or not the player has folded. Hopefully, these ideas can help you get started. Figuring out objects and how to set them up can be the toughest part on these types of assignments. To help think out the gameplay, it may help to physically play out a hand or two as you are coding.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.