Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Also assuming this is JS, there's probably a library with 38 zillion downloads to do exactly what you're trying. With little LOC improvement once you count the import statements.
-
@arazzz Lots. This was in Screeps and the while loop was really module.exports.loop, so it ran once a tick and the only sign of it was that doStuff() didn't change something it was supposed to after the first run.
-
@Conrad python and brackets? Are you mad? Also no incrementation in python. Good old fashioned += 1 only.
-
@electrineer type hints are actually possible in Python now, but still no 'var' type
I hate myself so much right now. I just spent an hour finding the bug in the following:
var counter=0
while(1){
if(counter%2==0){
doStuff()
counter++
}
}
Because I thought it was a bug in doStuff().
rant