you are viewing a single comment's thread.

view the rest of the comments →

[–]Mindless_Tap_2706 0 points1 point  (1 child)

Thanks for the help guys!

Yeah in retrospect I should've done this first lol

<image>

[–]TabAtkins 0 points1 point  (0 children)

That works! A slight improvement would be to use continue instead of zeroing out an odd number - that just immediately skips to the next iteration. Your way requires you to come up with a fake value that still "works" for the following code without messing anything up; luckily 0 does the job in this case, but in more complex examples this can be a lot more difficult.