Paint

From Esolang
Jump to navigation Jump to search
Paint
Paradigm(s) Imperative
Designed by User:Evylah
Appeared in 2024
Memory system two brainfuck-like tapes
Dimensions one-dimensional
Computational class Turing complete
Reference implementation Unimplemented
File extension(s) .pt

Paint is some sort of esoteric language made by User:EvyLah. I have absolutely no idea how to describe this better.

This is still a work in progress. It may be changed in the future.

Overview

Paint contains 2 brainfuck-like tapes (which will be called tape 0 and 1) which both do the same thing. Along with a standard text output, Paint has a 16x16 pixel canvas, where each pixel can be either on or off.

Commands

Universal

Opcode Description
0 1 Select either tape 0 or 1 to modify. Anything referencing manipulating a cell means manipulating the cell on the selected tape.

Tape manipulation

Opcode Description
+ - > < Same as brainfuck.
' Toggles any cell bounds, so cells can be any positive and negative integer. Once turned back on, all cells will be set to its value mod 256.

Control flow

Opcode Description
{ } Skip the code inside if the current cell is zero, otherwise do nothing. } does nothing other than act as a point to jump to.
[ ] Same as brainfuck.

I/O

Opcode Description
, ; Take input as one character or one number in that order, and store it in the current cell. Input will be taken mod 256 if cell bounds are on. Users can input negative numbers if cell bounds are off, and decimals will be rounded.
. : Print the current cell as a Unicode character or number, in that order.

Canvas commands

Opcode Description
` Take the current cell on the currently selected tape as y, and the other tape as x. Then turn on the pixel at (x, y). (0, 0) marks the top left corner.
~ Same as ` command, but instead turns off the pixel.
c Clears canvas (sets every pixel to off).
f Fills canvas (sets every pixel to on).

Every other character is ignored.

Examples

All programs compatible with brainfuck work in Paint as well.

Hello, World!

Taken from Brainfuck+2, although any Hello, World! program will work.

>++++++++[>+++++++++>++++++++++++>+++++++++++++>++++++++++++++>++++++
>++++>+++++++++++>++++++++++++++[<]>-]>.>+++++.>++++..>-.>----.>.>-.<
<<.+++.<.<-.>>>>+.

A+B Problem

The A+B Problem requires a program takes 2 numbers as input and outputs their sum.

';>;[<+>-]<:

Implementations

The way you make the canvas is up to you, but I would use ASCII art, with an on pixel being # (but doesn't have to be) and and off being a space. It's also your choice if you have the canvas repeatedly update itself, or show it once every cycle, or just once at the end.

(When I make my implementation) I would add the text output to a variable and then show it along with the canvas at the end.