Great tutorial and thanks for making it. One question: why the 'else' branches? Couldn't I simply do three non-else conditionals underneath each other in this specific case? Sorry for the dumb question, but I always wondered and to this day I'm making it like I describend without else-branches...
Add a fork condition variable for $10 million by making it so the random variable needs to land between 1-10. Then second prize is 11-30, third is 31-60, and the common prize is 61-100. That's roughly a 10, 20, 30 and 40% chance for each outcome, respectively. The number ranges can be checked by putting two conditions into a single fork condition. For example, fork condition: gamble chance is greater than or equal to 1, then inside that fork condition, less than or equal to 10. Just remember to put the else case in the first fork, and not the second, unless you are either willing to deal with the confusion or you're making lots of comments within your code to prevent it down the line.
@@johnmoeng nice! thank you so much. working slot machines add authentic atmosphere to my creepy little bodegas. i can multiply them and tweak these variables to make each one different. you're a great teacher. thanks again
Great tutorial and thanks for making it. One question: why the 'else' branches? Couldn't I simply do three non-else conditionals underneath each other in this specific case? Sorry for the dumb question, but I always wondered and to this day I'm making it like I describend without else-branches...
excelent, is there a way to make the randomize a little more detailed, like adding some % to the chance of success?
Add a fork condition variable for $10 million by making it so the random variable needs to land between 1-10. Then second prize is 11-30, third is 31-60, and the common prize is 61-100. That's roughly a 10, 20, 30 and 40% chance for each outcome, respectively.
The number ranges can be checked by putting two conditions into a single fork condition. For example, fork condition: gamble chance is greater than or equal to 1, then inside that fork condition, less than or equal to 10. Just remember to put the else case in the first fork, and not the second, unless you are either willing to deal with the confusion or you're making lots of comments within your code to prevent it down the line.
@@johnmoeng nice! thank you so much. working slot machines add authentic atmosphere to my creepy little bodegas. i can multiply them and tweak these variables to make each one different. you're a great teacher. thanks again
👍
Nice bro!
nice thanks!