Implementing the program will give you experience in the development of an application using Functional Programming, where you are expected to design, implement and use your own code from scratch. Your code development is the culmination of all what you have learnt on and all your hard work for part two of this module (Functional Programming). The program you develop should become a strong addition to your programming portfolio.
There is no GUI required for this system. It is expected that the system should run on the Racket IDE REPL/console, with Pretty Big as the chosen language.
You are programming your first App in Scheme: “Seven and Half Computer-Aided Solitaire”.
Description of Game.
Copyright By PowCoder代写 加微信 powcoder
The game is very easy to play. Before starting, we must drop cards with numerals 8,9,10 as well as Jockers from initial French Deck.
Your goal is to reach a mark of 7.5, or as closer as you can, but never exceeding 7.5. For that to happen, you are given a card every round randomly by the card dealer.
Scores for your cards follow these rules:
• If it’s a face card (the Jack, the Queen or the King), it counts as 0.5.
• Otherwise, the numeral-itself of the card, that is, 6 of Spades counts as 6, 2 of Hearts as 2. For example:
• 5 of Hearts, Jack of Spades and Queen of Clubs sum to 6 since 6=5+0.5 + 0.5
• 2 of Diamonds, 5 of Hearts and King of Diamonds sum to 7.5, since 7.5 = 2 + 5 + 0.5
• 3ofHearts,2ofDiamondsand5ofDiamondssumto10,since10=3+2+5
You win double of your bet if you get 7.5. You lose 20% of your bet if you get closer. You lose all the bet if your score exceeds 7.5.
To understand how the game works, let’s how Judith and Robert play this game.
Figure 1 Conservative player. Better not to risk.
Figure 2 Risky player. Chances to exceed greater than getting closer.
game… At least, I
cannot exceed
Let’s start
first card
– I got a 4
owever, chances to exceed are high. I decide to stop
I got a 3 of cloves
are still lower than getting
Chances to
closer to 7.5
I’m very close to match 7.5!
seems easy and I need
Hehehe… This game
. I’m trying one card. accept
Oh my God! I’m lucky
H) so close to the
match…Chances t
high…But who cares?
– Oh no! I got a 7 of Clovers
been very risky!
lost my money!
Some players can cheat. See below how the program works if the cheat flag is activated. Player can see the contents of the deck!
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com