RUNNER

From Esolang
Jump to navigation Jump to search

interpreter in python

def RUNNER(code):
  number = 0
  tape = ""
  translate = ["R", "U", "N", "E", "O"]
  for letter in code:
    if letter == "R":
      number = RUNNER(tape)
      tape = ""
    elif letter == "U":
      tape += translate[number % 5]
    elif letter == "N":
      number -= 1
    elif letter == "E":
      number += 1
    elif letter == "O":
      print(number)
  return number