So for the first project, we need to make a simple blackjack game. This is the sample program output example given.
Welcome to the COMP 51 Casino!
Let’s Play Blackjack!
You have been dealt a 5 and a 9. Your hand is 14.
Would you like to (h)it or (s)tay: h
You have been dealt a 1. Your hand is 15.
Would you like to (h)it or (s)tay: H
You have been dealt a 10. Your hand is 25.
Would you like to (h)it or (s)tay: h
You have been dealt a 3. Your hand is 28.
You can’t hit anymore. I hope your hand is enough!
The dealer’s hand is 22.
You busted! I’m sorry, you lose!
As we haven't done loops yet, I'm not expecting him to grade whether or not we use it. However, without it, my code seems so bulky, and when I read on tutorials about loops, I can't seem to figure out how to apply it to my code for hit/stay. If using only If/Else statements, I would imagine the code would end up very long if I add 2-3 more hits. Or am I missing something? So I'm basically asking what I can do to simplify my code, reading material would be great if anything. FYI, this is only my third week into my first programming class, so my knowledge is a bit limited, sorry if I'm a little slow.