Hi, I got a question here and I need to add some command to Matlab, but I really don't know the codes, can anyone please help me?
Here is the situation: The player throws two dice, and if the sum is seven or eleven, then she wins. If the sum is two, three or twelve, then she loses. If the sum is anything else, then she continues throwing until she either throws that number again (in which case she wins) or she throws a seven (in which case she loses).
Now, I need to add code for: the code such that player obtain a 7 or 11; the condition that we keep playing until the player either wins or loses; condition such that player wins; condition such that player loses.
Can anyone please teach me what should be the code for above parts? Thanks a lot.
Try something like (warning untested code):
Originally Posted by tsang
Originally Posted by CaptainBlack
Thanks a lot, I will try it first. I'm not very good with programming, my friend kind of said to me it can be done easily, like the above question I had, he said because it is more about understanding the situation, not the code. He said if I can't do the code, that means I actually don't understand the situation.
I'm not sure, but I guess I'll try to learn. Thanks again.