need help building a script simulating blackjack
Mostrar comentarios más antiguos
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!
Respuestas (1)
Image Analyst
el 16 de Feb. de 2018
0 votos
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.
Categorías
Más información sobre Card games en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!