Fixed extraneous debug code

This commit is contained in:
Chris Sexton 2012-11-13 22:25:45 -05:00
parent 5d7e23c9fc
commit 763b188a6a
1 changed files with 0 additions and 6 deletions

View File

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