Collide

From Esolang
Jump to navigation Jump to search

Collide is an esoteric programming language invented by User:A that features balls inside a sandbox that maps its edges.

Example source code (this is not yet documented)

Put balls like this into this sandbox, where this sandbox's edges include the length as 3 balls wide and the width as 2 balls wide.
 1 
2 3
Now, move the balls like this:
* Choose the ball on row 2, column 3; move the ball left, where the force of this ball is infinity.
* Choose the ball on row 2, column 1; move the ball up, where the force of this ball is infinity.

Syntax

  1. If two balls collide each other with the opposite direction, halt the program.
  2. If two balls subsequently push each other in the same direction, halt the program.
  3. The sandbox has a mysterious mechanism that automatically maps its edges without affecting its force.
  4. If a ball pushes another ball that was set to be moving infinitely, the ball will push the ball in its direction without affecting the direction of the ball being pushed. (Use Remember directions! to enable it)

Here is what the program above will do:

:Step 1
 1
23
:Step 1.5
21 
 3 
:Step 2
21 
3  
:Step 2.5
31 
2  
:The ball 2 maps from the top to the bottom, which pushes ball 3 up. All of ball 2's forces are now transported to ball 3.
:Step 3
21
3
:Now the program has fell into an infinite loop.

Another example program:

Put balls like this into this sandbox, where this sandbox's edges include the length as 3 balls wide and the width as 2 balls wide.
1 2
   
Now, move the balls like this:
* Choose the ball on row 1, column 1; move the ball right, where the force of this ball is infinity.
* Choose the ball on row 1, column 3; move the ball down, where the force of this ball is infinity.

Process:

 1
  2

  1
  2
:Bam! now it has fell into an infinite loop.