Fixed extraneous debug code
This commit is contained in:
parent
5d7e23c9fc
commit
763b188a6a
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue