Zeryx

From Esolang
Jump to navigation Jump to search

Zeryx is a simple language designed by User:Conor O'Brien.

Suppose a program in this language is referred to as S. N starts at 0. Then, the commands of this language can be defined as:

  • ( - move the first character in S to the end of S. E.g., 1234 becomes 2341.
  • ) - move the last character in S to the beginning of S, and move forward an additional time. E.g., 1234 becomes 4123.
  • . - terminate the program, outputting the state of S.
  • # - increment N, mod length(S).

The program executes the Nth character in S until it is ..

Example executions

Program: (.)

Step 1: (N = 0) Execute (. Before: (.); after: .)(.

Step 2: (N = 0) Execute .. Before: .)(; after: .)(.

Final result: .)(


Program: ((((((.

Step 1: (N = 0) Execute (. Before: ((((((.; after: (((((.(.

Step 2: (N = 0) Execute (. Before: (((((.(; after: ((((.((.

Step 3: (N = 0) Execute (. Before: ((((.((; after: (((.(((.

Step 4: (N = 0) Execute (. Before: (((.(((; after: ((.((((.

Step 5: (N = 0) Execute (. Before: ((.((((; after: (.(((((.

Step 6: (N = 0) Execute (. Before: (.(((((; after: .((((((.

Step 7: (N = 0) Execute .. Before: .((((((; after: .((((((.

Final result: .((((((


Program: (#(.

Step 1: (N = 0) Execute (. Before: (#(.; after: #(.(.

Step 2: (N = 0) Execute #. Before: #(.(; after: #(.(.

Step 3: (N = 1) Execute (. Before: #(.(; after: (.(#.

Step 4: (N = 1) Execute .. Before: (.(#; after: (.(#.

Final result: (.(#