Skip to content
An esolang that focus on laser reflection
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src
.gitignore
LICENSE
Makefile
README
laserLANG.1

README

laserLANG(1)                General Commands Manual               laserLANG(1)

NAME
       laserLANG - An esolang that focus on laser reflection

SYNOPSIS
       laserLANG [programfile]

DESCRIPTION
       laserLANG is a esoteric programming language, which is inspired by mar‐
       ioLANG and brainfuck.

MEMORY MANAGEMENT
       Each memory cell is an signed 32 bit integer.

       >   Move memory pointer right

       <   Move memory pointer left

       -   Add one to memory cell under the pointer

       '   Subtract one from memory cell under the pointer

       =   Output ASCII character from the current memory cell

       "   Output numeric value from the current memory cell

       ~ and s
           Read ASCII character to current memory cell

CONTROL FLOW
       +   Turn  the laser 90 degree clockwise when the current memory cell is
           positive, counter clockwise when negative. Continue unhindered when
           zero.

       #   Turn  the laser 90 degree counter clockwise when the current memory
           cell is positive, clockwise when negative. Continue unhindered when
           zero.

       / and \
           Consider  these as mirrors that are hit from a 45 degree angle. The
           laser will reflect with an angle corresponding to the input angle.

       - and =
           If the laser hits these going on the y axis it will shatter, other‐
           wise it will continue unhindered.

       ' and "
           If the laser hits going on the x axis it will shatter, otherwise it
           will continue unhindered.

       ~   If the laser hits going downwards it will reflect to the right,  if
           it  hits  going  upwards  it will reflect to the left, otherwise it
           will continue unhindered.

       s   If the laser hits going left it will reflect upwards,  if  it  hits
           going  right  it will reflect downwards, otherwise it will continue
           unhindered.

       <   If the laser hits going right it will shatter,  otherwise  it  will
           continue towards left.

       >   If  the  laser  hits  going left it will shatter, otherwise it will
           continue towards right.

       ^   If the laser hits going down it will  shatter,  otherwise  it  will
           continue towards up.

       v   If  the laser hits going up it will shatter, otherwise it will con‐
           tinue towards down.

DEBUG
       p   Will print laser position and memory cell values

COMMENTS
       Anything not recognized as a command is a comment.

EXAMPLE
       An example "Hello World!" program can be written as the following:

       ----------\                    /<<<<\
                                      '
                 v                    /
                 #>------->---------->--->-/
                 >--=>-=-------==---=>--=\
                       /=---------------<<
                       \>=---=\ /=>-=>=
                                '
                                '
                              ' '
                              ' '
                              ' '
                              ' '
                              ' '
                              ' '
                              \=/

       Output: Hello World!

       The code below outputs 4:

       ----\
           "

       This gets done because `-' adds one to the memory  cell,  `\'  reflects
       the laser downwards, and `"' prints it's numeric value.

       The first part is a loop:

       ----------\                    /<<<<\
                                      '
                 v                    /
                 #>------->---------->--->-/

       The  laser  gets shot in the top left corner moving to the right (Along
       the x axis), when it reaches the `\' the first memory cell contains 10.

       The `\' will send the laser downwards where it reaches the  `v',  which
       does nothing when approached from above.

       The  `#' is a junction sending the laser 90 degree counter clockwise if
       the memory cell under the pointer is positive.

       `>' moves the memory pointer to the right.

       The laser will eventually end  at  `/',  at  which  point  it  will  be
       reflected upwards.

       `'' will subtract one from the memory cell under the pointer.

       The laser will hit the `v' from the side making it go downwards.

       The  loop  finishes with the values `0', `70', `100', `30', `10' in the
       memory cells, at which point the `#' junction will do nothing,  as  the
       cell under the cusor is zero.

                                                                  laserLANG(1)
You can’t perform that action at this time.