Bot Engine

From Esolang
Jump to navigation Jump to search

Designed by SuperJedi224, BotEngine is an upcoming 2D programming language inspired by the game Manufactoria. Execution consists of one or more "bots", each carrying a queue of symbols, traversing the grid of instructions. Execution begins with a single bot carrying an empty queue and going EAST, which begins in the northwesternmost cell.

At each step of the execution, every bot advances 1 cell in whatever direction it is facing, unless doing so would move it into a cell which is already occupied; and every bot which successfully moved then executes the command (if any) corresponding to the cell they entered.

Bots are updated in the order they were created.

Execution halts when no bots remain.

Instructions

(Subject to change before release of language)

X  Destroy the current bot. (This will also happen when a bot exits the program bounds)
Z  Destroy all bots.
T  Destroy the current bot and print TRUE.
F  Destroy the current bot and print FALSE.
P  Destroy the current bot and print the contents of its queue.
r  Rotate the current bot's direction of travel 90 degrees clockwise.
l  Rotate the current bot's direction of travel 90 degrees counterclockwise.
R  Reverse the current bot's queue.
^  The current bot is now going NORTH.
v  The current bot is now going SOUTH.
>  The current bot is now going EAST.
<  The current bot is now going WEST.
|  Reverse the current bot's direction of travel.
C  Duplicate the current bot. Allow the original to continue in its current direction, but reverse the direction of the copy.
E  If the current bot's queue is empty, rotate its direction of travel 90 degrees clockwise.
I  Read a line from the input and add its characters to the current bot's queue.
e  Find the symbol to the left (relative to the current bot's direction of travel). Add it to the current bot's queue.
d  Duplicate the symbol at the front of the current bot's queue. A no-op if the queue is empty.
S  Find the symbol to the left (relative to the current bot's direction of travel). If the symbol at the front of the current bot's queue matches this symbol, dequeue it and rotate the bot's direction of travel 90 degrees clockwise.

A cell containing any other symbol is a no-op.

Examples

Infinite Loop

><

Cat Program

>CIEP
   Z

Truth Machine

v 0
>IS>CP
  e0
  P

Hello, World!

vHello, World!
>eeeeeeeeeeeeeP