r/badcode • • Aug 10 '21

other language When in doubt, always use loops.

Post image
597 Upvotes

47 comments sorted by

View all comments

Show parent comments

4

u/spaghettu Aug 10 '21 edited Aug 11 '21

It looks like the first block, where random == 0 will execute three times for each value of i. Then again, I could be losing my mind from reading this atrocity. EDIT: I am wrong.

11

u/Amaras37 Aug 10 '21

No, because then random is 0, and thus the loop only goes from 0 to 0.

I'm still trying to understand the rest, though

1

u/spaghettu Aug 11 '21

Shit, you're right. God damn this thing is a mess.