stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

44m 53s logged

Some complicated work done and learnt some new stuff BY MYSELF!!! :yay:
So basically, a long straight is all 5 in a row, like 1,2,3,4,5, or 2,3,4,5,6, and its going to be an if statement of doom and despair if I do it like that. SO, I put them in an array, and sort them from least to greatest, so my long straight code looks like this if (Dice[0] + 1 == Dice[1] && Dice[1] + 1 == Dice[2] && Dice[2] + 1 == Dice[3] && Dice[3] + 1 == Dice[4]) and I also remembed to make Dice a global value, so it doesnt exist only in that function, which is what I didnt realize a couple days ago, which is why it was better to start from simple to harder. and I figured this out ALL BY MYSELF, NO AI, JUST PURE LOGIC :yay2:
now for small straight, it was a bit more complicated, cus its only 4 in a row, so there can be duplicates, so theres 4 situtaions in which it can work. I got the first 2 light work, then I realized later I needed the other 2. Now here is where AI got involved, cus Im thinking if I do if (situation1) else if (situation 2) else if (situation 3 ) else if (situation 4) else and repeat the same instructions 4 times, if it can be condensed, and then Gemini told me about if ((situation 1) || (situation2) || (situation3) || (situation4)) and then only one set of instructions. Nice to know that. Happy with my progress here.

0
18

Comments 0

No comments yet. Be the first!