Square-like

From Esolang
Jump to navigation Jump to search

Square-like is a minimal and semi-simple two dimensional language based on Re:direction and RECT4n=GLE. It is functionally also similar to Emmental. It was created by User:Yayimhere

Syntax & semantics

Every Square-like program is a rectangle with no empty/space characters. A command pointer points to the current command, and can go in any direction within the program space, initially going down. The program space is infinite, however the pointer starts in the uppermost left corner of the actual program, which expands in all directions of ascii 0/NUL. There is also a queue, in which every command ran is enqueued. It has the below commands:

  • : NOP
  • : Copy the whole program upwards, such that no commands overlap, and then rotate the command pointer by 90 degrees.
  • : Copy the whole program downwards such that no commands overlap, and rotate the command pointer by 90 degrees.
  • : Copy the whole program to the left such that no commands overlap, and rotate the command pointer by 90 degrees.
  • : Copy the whole program to the right such that no commands overlap, and rotate the command pointer by 90 degrees.
  • ⌸ to ⌼, ⍁ to ⍄, ⍯, ⍰, and ⎕: do a right rotate on the last command ran plus N commands that are above/below/left/or right(same as current pointer direction) it in program space, where N is the unicode value of this command minus 9013. This does not affect the command pointer however
  • NUL/Ascii 0: Halt
  • any ascii char: Peek the queue from the top N elements, where N is the characters ascii value subtracted by 33. Now, every time this character is ran again, it will do that sequence of commands. A command definition is itself not pushed to the queue, but that is the only case where it is such.

As you can see, Square-like's command definition is quite similar to Emmental's command redefinition, as well as Re:directions command queue. Square-like can either be seen as a Befunge style esolang, or as a Cellular automata. A simple thing to note is that the only way to halt is to send the pointer out of bounds of the current program(this is however only a side-effect of the fact that the out of bounds is full of ascii NUK). All rotations of the pointer are counter clockwise.

Examples

Looping counter with growth rate f(x)=x*8. note the e's are redundant and only for visual aid, and technically make the growth rate f(x)=x*8+2:

≮≮e
≮≮e

Which with one cycle complete makes the program look like this:

≮≮e≮≮e≮≮e≮≮e≮≮e
≮≮e≮≮e≮≮e≮≮e≮≮e