Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE Code in Haskell! Only in Haskell! Coding the card game War There should be a dealer (the computer) and a player (the user). Both

PLEASE Code in Haskell! Only in Haskell!

Coding the card game War

There should be a dealer (the computer) and a player (the user). Both

the dealer and player will have their cards randomly dealt from the same

card shoe (a card shoe holds multiple decks of cards

Create some representation of Cards and a (card) Shoe. The Shoe should

be able to hold up to 8 decks worth of cards (416 cards total) in increments

of 52.

ou will need to implement a function that randomly shufflees the cards and

one that randomly cuts the cards. These should be called shuffles and cut respectively

Implement the \War" game according to the following speci cations:

1. The player will start with $200 to bet.

2. The player will be prompted to ask how many decks should go in the

shoe

3. The player will be prompted to place a bet before a hand is played.

4. After the player makes a bet, a hand will be played from the current

Shoe. A hand consists of the player receiving one card, then the dealer

receiving one card. The card with the higher value wins. Suits don't

matter. If there is a tie, the players go to \War".

5. If the player wins, they get their bet added to their remaining funds.

6. If the player loses, they get their bet deducted from their remaining

funds.

7. War pays out double if the player wins, but if they lose they lose

double.

8. The game continues until the player is bankrupt ($0 left to gamble) or

the cards run out

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

=+ (b) Show that no record stands forever.

Answered: 1 week ago