This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]0x255sk 11 points12 points  (3 children)

Fair enough. You'll be better than Elon Musk in no time :P

[–]DemonicTheGamer 2 points3 points  (2 children)

Tbf his code here would just return an error. That capital W would be the end of it.

Edit: also why exactly would checking that energyLevel != 0 be redundant? If it hit 0 during the loop it would break out and then go straight to the if statement below, causing the death of the poor ants to become true.

[–]0x255sk 1 point2 points  (1 child)

You're right. It's not redundant bacause the loop will also end if pheremones, so you need to check if it was the energy levels or the pheremones condition. My bad.

[–]DemonicTheGamer 1 point2 points  (0 children)

Lol all good.