diff --git a/brainfuck.go b/brainfuck.go index 6104d93..e96c046 100644 --- a/brainfuck.go +++ b/brainfuck.go @@ -86,14 +86,11 @@ func (m *Machine) Run(input []byte) { if instr == '[' { // if *ptr == 0, jump to ] if m.value() == 0 { - // fmt.Printf("Encountered a [ with *ptr = 0, loopCount=%d\n", loopCount) for lc := 1; lc > 0; { ip += 1 if input[ip] == ']' { - // fmt.Println("]: Decrementing lc", lc) lc -= 1 } else if input[ip] == '[' { - // fmt.Println("[: Incrementing lc=", lc) lc += 1 } } @@ -101,14 +98,11 @@ func (m *Machine) Run(input []byte) { } else if instr == ']' { // if *ptr != 0, go back to [ if m.value() != 0 { - // fmt.Printf("Found a ] with *ptr != 0, loopCount=%d\n", loopCount) for lc := 1; lc > 0; { ip -= 1 if input[ip] == ']' { - // fmt.Println("]: decrementing lc=", lc) lc += 1 } else if input[ip] == '[' { - // fmt.Println("[: incrementing lc=", lc) lc -= 1 } }