From Esolang
Jump to navigation Jump to search

256 is a Stack-based esoteric programming language made by Areallycoolusername. It was made for Code Golf, and it's a Turing tarpit.


256 has 4 commands. Each of these commands are integers, and they deal with input, output, loops, control flow, and the stack.

Commands Function
2 Reads input to the stack
5 Declares a variable
6 label for Goto
^ If statement


On first glance, 256 looks highly imcomplete, and doesn't look viable for use in competitive golfing. However, this language has the few instructions it has to create new functions. Any character in the program that doesn't match one of these commands, or isn't an argument in one of these commands, is printed during execution. Commands and their arguments are separated by a semicolon.


The input commamd, 2, reads one character from the user, and pushes it to the top of the stack. This command doesn't need any parameters, in order to minimize program size. e.g: 2;


The variable command, 5, declares a variable. This command has 2 arguments. This first is the variable name, which can only be 1 byte in lenth, and can be any Unicode character. The variable name length being only 1 byte is arbitrary, and doesn't affect us Turing completeness of this language, as the name is just a shell. The thing that matters is The value. The second argument is the value, which can be an integer, string, character, or boolean. e.g: 5i99;


The label command, 6, is (arguably) the most essential command in this language. Without it, loops would not be allowed, and 256's use in competitive golfing would be nonexistent. In order to use this instruction, just put it anywhere in the program where you want to initiate a loop. Then, you can jump to it by calling 6 again, followed by what order that 6 is in. e.g:


This program declares a 6. It is the first 6 in the program, so in order to jump to it, you have to declare 6 again, followed by a 1. This is done after the character "h" is printed. Another 6 is declared. It's the second 6 in the program, so in order to jump to it, a 6 has to be declared, followed by a 2. This is done after the character "e", is printed. However, the program will.never get past the first jump instruction, as the program has entered an infinite loop. So "h" is printed indefinitely.


The if statement, ^, is the fourth and last command in 256. When used, it must be followed by a condition, another ^ to tell the program what to do it the condition is met, and, optionally, another ^ to tell the program what to do otherwise. e.g:


This program declares the variable z, with value 99. It then checks if a is more than 0. If it is, then z is printed, decremented, and the program jumps back to the start of the if statement. Otherwise, the program jumps to the second 6 I. The program, and halts.

Computational class

256 is Turing complete, as it can enter an infinite loop, and the stack is unbounded. Due to its use of only 4 commands, this language can also be considered a Turing tarpit.


Here are examples of popular problems in 256. Each example has the amount of bytes used in each program, in order to prove that 256 can still be used in competitive golfing.

Hello World Program

13 bytes in total.

Hello, world!

Truth Machine

18 bytes in total.


When a variable has the command 2 as it's value, it must be separated by a semicolon.

Infinite Loop

4 bytes in total.


Unofficial instructions

Due to 256's extreme simplicity, a program is very hard to golf in.

Integers instruction; i.e. the Looping counter (integers from top of stack down to 0), 25 28 bytes


Call this instruction by typing ι; as an instruction.