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 个)
Image Analyst
2018-2-16
0 个投票
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!