need help building a script simulating blackjack

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!

回答(1 个)

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.

类别

帮助中心File Exchange 中查找有关 Card games 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by