fossilesque@mander.xyzM to Science Memes@mander.xyzEnglish · 23 hours agotickling ur spidey sensesmander.xyzimagemessage-square16fedilinkarrow-up1558arrow-down112
arrow-up1546arrow-down1imagetickling ur spidey sensesmander.xyzfossilesque@mander.xyzM to Science Memes@mander.xyzEnglish · 23 hours agomessage-square16fedilink
minus-squareIron Lynx@lemmy.worldlinkfedilinkEnglisharrow-up2·edit-24 hours agoBecause you stop searching when you find the bug. You have to not execute lines[] = Load(file.code); bool bug_found = false; i=0; while(!bug_found) { bug_found = findBug(lines[i]); } bug_fix(lines[i]); You have to run lines[] = Load(file.code); def bugs[]; a = 0; for(i=0;i<lines[].length();i++) { if (findBug(lines[i]) { bugs[a] = lines[i]; a++; } } for(b=0;b<=a;b++) { bug_fix(lines[b]); } /j
Because you stop searching when you find the bug.
You have to not execute
lines[] = Load(file.code); bool bug_found = false; i=0; while(!bug_found) { bug_found = findBug(lines[i]); } bug_fix(lines[i]);
You have to run
lines[] = Load(file.code); def bugs[]; a = 0; for(i=0;i<lines[].length();i++) { if (findBug(lines[i]) { bugs[a] = lines[i]; a++; } } for(b=0;b<=a;b++) { bug_fix(lines[b]); }
/j