Rflct

From Esolang
Jump to: navigation, search

rflct or reflect, invented by Joey Haas, is an esoteric language based on Argh!. Like Argh!, it is laid out in two dimensions. But unlike Argh, rflct has no code boundaries. If you've ever tried coding in Argh!, this language is a piece of cake for you.

The name is because the code can reflect off 'surfaces', this essentially makes a command differ in function when the instruction pointer comes from a different direction. This is a valid program:

vHey!   
>PPPP--:
       |  :)
   /---/-PPPo
   :---/

And it will ouput 'Hey! :)'. '|' and '-' are simple 'NOP' commands and don't do anything except move the instruction pointer. ':' and '/' function as mirrors for the pointer.

The program for "Hello, world!" is easy to write and is written in this way:

v
>mHo
 H
 e
 l
 l
 o
 ,
  
 W
 o
 r
 l
 d
 !
 /
 ;

The parser starts reading at 0,0. There MUST be a directional pointer here, and it can not point up or left: #, > and v. The # is for the people whose system supports executables by doing #!path. Thusly, the only way the # is accepted is if there's a ! behind it. If this is the case, it will point downward.

It then notices another directional pointer, this time to the right. The direction is changed. Here it comes to command 'm', also called 'mass save'. It'll add every value under it to the stack until it strikes /;. It can't save more than 64 values per run. 'H' will output the whole stack as one string. This will NOT clear the stack. At last, 'o' will stop the program.

The parser is written in PHP. Eventually, when the parser is 100% done, the source will be free to download and to host on your own server.

External resources