You are viewing a single thread.
View all comments View context
3 points
*

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]);
  //looks like I missed a bit, lemme fix
  if(bug_found)
  {
    break;
  }
  i++;
}
bug_fix(lines[i]);
// Who'd've thought that I'd need to fix a bug in a joke about fixing bugs
// Now that's some tasty irony ^-^'

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

permalink
report
parent
reply
3 points

shouldn’t b loop until it’s <a instead of <=a ?

permalink
report
parent
reply
2 points

Yes

permalink
report
parent
reply

Science Memes

!science_memes@mander.xyz

Create post

Welcome to c/science_memes @ Mander.xyz!

A place for majestic STEMLORD peacocking, as well as memes about the realities of working in a lab.



Rules

  1. Don’t throw mud. Behave like an intellectual and remember the human.
  2. Keep it rooted (on topic).
  3. No spam.
  4. Infographics welcome, get schooled.

This is a science community. We use the Dawkins definition of meme.



Research Committee

Other Mander Communities

Science and Research

Biology and Life Sciences

Physical Sciences

Humanities and Social Sciences

Practical and Applied Sciences

Memes

Miscellaneous

Community stats

  • 9.3K

    Monthly active users

  • 3.2K

    Posts

  • 51K

    Comments