need help building a script simulating blackjack
Ältere Kommentare anzeigen
Build a script that, when run, will produce two cards from a deck of 52 and will output the face and suit of each card as well as the sum of the face value of the two cards. (Assume 2 – 9 carry their own value, 10 – K carry a value of 10, and A is 11.) If the user’s sum is 21, say, “Jackpot!” If it is 15 or less, say, “Hit!” If neither, say, “Stay!” Hint: You need three variables per card: suit string (spade, heart, diamond, or club), face string to be printed out, and face value that can be put into the sum. Use the GRADS method to break this problem down!
Antworten (1)
Image Analyst
am 16 Feb. 2018
0 Stimmen
For what it's worth, you might get some hints on your homework if you study my attached scripts on Monte Carlo card dealing.
I don't know what the GRADS method is that you're supposed to use.
Kategorien
Mehr zu Card games finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!