()NEST()

From Esolang
Jump to navigation Jump to search

()NEST() is a very simple two command esolang/Cellular automaton(CA) made by User:Yayimhere when he was bored. Also a ()NEST() program will not halt unless its told to by the code pointer

The logo of ()NEST()

how it works

The code is layed out on a 2d infinite grid. There are two commands:

( and )

Below I will describe each command.

If a ( has a )to the right of it, it will copy itself like this(note the space):

() -> ()( 

And if a ) Has a ( (again, note the space) next to it, that will also be copied:

)(  -> )( )

However in the case that there is a ( ) next to it instead, it will put it on the line below like this:

)( ) -> )
         ( )

If there however is nothing next to it on the right, it will be copied instead:

()  -> ()
       ()

If this pattern emerges:

()()
()

It will be transformed into:

()( )
   ()

If a ( ) Is moved down onto a () It will encase the ():

()( )  ->*moves down*-> ()
   ()                     (())

And if there is a () above a ( )(note the double spaces) It will move up to it:

 () -> (())
(  )

And last but not least if there is a () left to a (()) The outer brackets move down:

()(()) -> () () 
            (  )

It is executed top to bottom left to right

examples

Osc(2 step):

()(())

Step 1:

()(())

Step 2:

() ()
  (  )

Step 3:

()(())