2/20/2023 0 Comments Blackjack program in c![]() Posted: Mon 4:49 pm Post subject: (No subject) Thanks but i figured all of that out now all i have left to do is assign values to the cards Posted: Mon 4:35 pm Post subject: (No subject) Oh I changed the name because it is confusing to have two very different things in your program so similarly named and you should only use ALL CAPS for constants. Make it a procedure and pass your array as a parameter like: Aside from the a,b problem that dude correctly pointed out your big problem is trying to result an an array of string from your function. Run it up to 100 or so to be sure they are well shuffled. I like the way you shuffle, but if you think about it there is no reason to stop at 52. Posted: Sun 11:10 pm Post subject: (No subject) It's only called a blackjack if you get it on your fist two cards obvious comments are harmfull to clarity. Posted: Sun 10:58 pm Post subject: (No subject) This doesn't work because you need to declare temp, a and b Posted: Sun 10:42 pm Post subject: (No subject) Posted: Sun 7:28 pm Post subject: (No subject) It doesnt really insult the intillegent's of the person reading it, because if your just reading the code you might not realize exactly why thats there, so the comments do help both the coder and reader understand the code. Posted: Sun 6:52 pm Post subject: (No subject) Posted: Sun 6:45 pm Post subject: (No subject)Īlso it is a habbit my computer science teacher has gotten me use to Yeah it does clutter it up, but it makes it easier if i need help anytime, easier for someone to understand my code, and easier to find something that i cant remember what it is called. Posted: Sun 6:44 pm Post subject: (No subject) It clutters things up and insults the intellegence of the person reading it. No suggestion about the code but i would suggest you leave out comments like for Posted: Sun 6:37 pm Post subject: (No subject) ![]() Put "You have 5 cards without exceeding 21! You win." You have backjack."Ĭloop := 0 %resets the starting round counter If cloop = 0 then %if this counter equals zero it starts this loopįcard := scard %makes fcard(finalcard) equal to scard(startcard)Ĭloop := cloop + 1 %makes a counter to exit this loop when it has completed this once Var fcard, hitcount, scard, cloop : int := 0 if anyone can help me with this please do so. Okay well this is my latest update to that. Posted: Sun 6:25 pm Post subject: (No subject) If numbers (i) > 21 then %if you hand is over 21 it completes this taskĮlsif numbers (i) = 21 then %if you have equals 21 it completes this task Numbers (i) := fcard %stores the random value of num into the ith element of the array Num := Rand.Int (1, 10) %gives num a random value between 1 and 10 If ans = "n" then %if the answer is no then it completes this taskĮlse %if none of the "if" or "elsif" statements happen this happensįor i : 1. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |