Drawfuck

From Esolang
Jump to navigation Jump to search

Yet another brainfuck derivative, by User:Actuallyallama.

Rather than outputting ASCII characters, it outputs a 256x256 image. By default, the image is a blank white canvas.

It also has a few extra values: R, G, B, X, and Y.

Most of the commands are the same as brainfuck, with a few additional commands.

Command Description
r Set R to the current memory cell value.
g Set G to the current memory cell value.
b Set B to the current memory cell value.
x Set X to the current memory cell value.
y Set Y to the current memory cell value.
. Set the pixel at X,Y in the image to a new colour R,G,B.
n Subtract 1 from Y. (North)
s Add 1 to Y. (South)
e Add 1 to X. (East)
w Subtract 1 from X. (West)

Example:

   +[+>+[+r<gb>y.]<x]

will produce this output:

DrawfuckExample1.png
.x+[>y+[.y+]<x+]

Gives you a totally black image.

An interpreter has been written by User:Dtp09 on December 23rd, 2021, and hosted here.

Another interpreter has been written by User:None1 in Python, on October 27, 2023, it updates the image per 1000 instructions and allows you to save the image.