testing3/bf.scala
changeset 161 6ea450e999e2
parent 160 863feeb5c760
child 167 349d706586ef
equal deleted inserted replaced
160:863feeb5c760 161:6ea450e999e2
    45     case ('[', l) => jumpLeft(prog, p - 1, l - 1)
    45     case ('[', l) => jumpLeft(prog, p - 1, l - 1)
    46     case (']', l) => jumpLeft(prog, p - 1, l + 1)
    46     case (']', l) => jumpLeft(prog, p - 1, l + 1)
    47     case (_, l) => jumpLeft(prog, p - 1, l)
    47     case (_, l) => jumpLeft(prog, p - 1, l)
    48   }
    48   }
    49 }
    49 }
       
    50 
    50 
    51 
    51 
    52 
    52 // (2c) Complete the run function that interpretes (runs) a brainf***
    53 // (2c) Complete the run function that interpretes (runs) a brainf***
    53 // program: the arguments are a program, a program counter,
    54 // program: the arguments are a program, a program counter,
    54 // a memory counter and a brainf*** memory. It Returns the
    55 // a memory counter and a brainf*** memory. It Returns the