Here's another example of nested for loops. Combinations and/or permutations with larger numbers become more complicated, but with 4 Aces and 2 choices we can pretty much hard code it (like I did in this video).
Later in this playlist I'll get to more complex examples.
Tutorial Playlist:
https://youtube.com/playlist?list=PLWYGofN_jX5Apmb8pJUD8NN3KskHW2lcy
Repository:
https://github.com/RoundBearChoi/CPP_Tutorial_Projects
Any questions/comments? Join us on discord:
https://discord.gg/hAFTgcA
intro: (0:00)
a function: (0:42)
a for loop: (1:47)
nested for loops: (3:48)
the leftovers: (5:03)
results: (6:04)
outro: (6:51)
Social
twitter: https://twitter.com/roundbeargames
facebook: https://facebook.com/roundbeargames17
hive: https://peakd.com/@roundbeargames/posts
reddit: https://reddit.com/user/roundbeargames
linkedin: https://linkedin.com/in/jangwon-choi-15041a9a
Patreon:
https://patreon.com/roundbeargames
Channel Memberships:
https://youtube.com/roundbeargames/join







▶️ 3Speak
How do you get the logic work behind your brain whilst coding 😳 I'm trying to follow your loops and logic, pretty sure even if I don't screw up the syntax, the logic will become a dead loop 😂 or probably stacked too many variables, until the combinations overlapped and crash. My previous experience in coding trading robot has the exact same problem as I described to you. A short 128kb code, ended up generate a huge 2TB data dump on a simple moving average calculation 😂
lol i already went through it once before i did the recording. i made a lot more mistakes and fixes on the first attempt, so if i recorded that instead it would look kinda like what you just described.
Nice to see content like this on Hive. It has been shared in the Game Development community.
You are more than welcome in there any time. Have a great week.
awesome. subscribed!
That's a pretty neat explanation. Loops and permutations are important for about anything, and I like how you break it down with the blackjack example.
thank you. indeed it's one of those fundamental concepts. a slightly more complicated example coming next video!