Rfghjy

From Esolang
Jump to navigation Jump to search

Rfghjy is a simple esolang based around the idea of self-modifying code. There are two registers: ! and @. Each "cycle" of the Rfghy interpreter, ! is executed, then @ is executed, and then the interpreter may optionally print the stack. All data is simply stored as code, with one number corresponding to each instruction. The code from the user is stored in a queue. When that queue is empty, the program exits. That queue may be modified by the program. The instructions are:

  • p: pop from the queue into @.
  • n: push p onto the queue.
  • i: increment the last item on the queue, resetting at 6. See the section on numbers below.
  • e: exits the program.
  • d: pops the first and last items on the queue into @ and !, then pushes @ ! times.
  • x: pops from the queue into !.

Each instruction is represented numerically as its index in the above list. Thus, p = 0, n = 1, i = 2, e = 3, d = 4, and x = 5. As stated above, all numbers all modded by 6, the number of instructions.

An example interpreter may be found here.

Examples

None yet, sorry!