489
edits
Script 10k (talk | contribs) |
|||
Line 72: | Line 72: | ||
:Oh, good point! Sorry I changed your pseudocode and didn't think about why you used "!=" instead of "<". Before I fix the page, let me ask, shouldn't I just set it back to the "for" loop that you wrote before? Is there a reason why the "do-while" loop above is preferable? --[[User:Iritscen|Iritscen]] ([[User talk:Iritscen|talk]]) 22:41, 2 November 2017 (CET) | :Oh, good point! Sorry I changed your pseudocode and didn't think about why you used "!=" instead of "<". Before I fix the page, let me ask, shouldn't I just set it back to the "for" loop that you wrote before? Is there a reason why the "do-while" loop above is preferable? --[[User:Iritscen|Iritscen]] ([[User talk:Iritscen|talk]]) 22:41, 2 November 2017 (CET) | ||
:: Hi, yes I used the "!=" in the for loop because the reason above. Turns out that it was also wrong! Because it would also fail for this example: | |||
schedule dprint("Is this annoying yet?") repeat 0 every 20; | |||
for (int i = 0; i != 0; i++) | |||
{ | |||
print("Is this annoying yet?"); # this would never run with this code because 0 == 0 | |||
wait(20); | |||
} | |||
See, it would also never run using my code for 0, so the do while loop is the correct equivalent imo. |
edits