Codename: RGB

From Esolang
Jump to navigation Jump to search

Codename: RGB is a temporary name for a new graphical esolang "currently" worked on by Keymaker and Rune. Nothing here is final, except that the program is an image and the instruction pointer moves in 2D.

A program is an RGB image whose top left corner is placed at (0,0) on an infinite canvas. The interpreter should display the changes in the image in realtime during execution.

The Instruction Pointer moves in two dimensions and points at a pixel on the canvas.

Each pixel has an R, G and a B value (8 bits). The R is the instruction to be executed, G specifies the direction to read arguments from, and B is the argument count. The arguments are read from pixels next to the IP. Alternatively the instructions could have a fixed argument count, and the B value could be used for something else.

Suggestion for G values

> is the IP

678   812 
5>1   7^3
432   654

This means odd values of G will read arguments diagonally

Or we could just use right angles:

 4
3>1
 2

If G is 0, then only B will be used as argument

Instructions

NOP
Put (value, x, y)
Get (x, y)
Copy_Area (x1, y1, w, h, x2, y2)

Math

Add (arg1, arg2 ... argN)
Subtract 
Multiply 
Divide 

File IO

Read (x, y, w, h)  reads w*h*3 bytes from input and fills them into the specified area
Write (x, y, w, h) writes the byte values of the specified area to output.