Spoon

From Esolang
Jump to: navigation, search

Spoon is a Brainfuck derivative invented by S. Goodwin in 1998. It uses Huffman-coded binary sequences to represent each instruction.

Command set[edit]

Spoon's command set consists of the commands in Brainfuck, converted to binary sequences through Huffman coding, with two additional commands added on.

Command Description
1 Increment the memory cell under the pointer
000 Decrement the memory cell under the pointer
010 Move the pointer to the right
011 Move the pointer to the left
0011 Jump back to the matching 00100
00100 Jump past the matching 0011 if the cell under the pointer is zero
001010 Output the character signified by the cell at the pointer
0010110 Input a character and store it at the cell in the pointer
00101110 Output the entire memory array
00101111 Immediately terminate program execution

The language allows other characters to be substituted for 0 and 1, or even for 0 and 1 to be swapped, provided the interpreter is informed. It is therefore possible to make Spoon programs that are also ASCII art.

Hello world example[edit]

0101111111110010001111111111010000001101100101001011111110010001111110
1000000110111001010111111100101000101011100101001011111111111001000110
0000000000000000001000000110110000010100000000000000000000000000000000
0000000101001011111111111001000111111101000000110110010100101111110010
0011111101000000110110010101110010100000000000000000000010100000000000
0000000000000000101001011111111111001000110000000000000000000100000011
011000001010

External resources[edit]