Brainchicken
Brainfuck, one command a line, counted in chickens.
None1 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
None1 made Brainchicken as a brainfuck equivalent. Each line of a program is one brainfuck command, and the command is the number of times the word chicken appears on that line. The specification's Python interpreter turns the lines into brainfuck and runs it.
The machine
| Chickens | Brainfuck |
|---|---|
| 1 | > |
| 2 | < |
| 3 | + |
| 4 | - |
| 5 | . |
| 6 | , |
| 7 | [ |
| 8 | ] |
The interpreter looks the count up as table[count-1], so a line with no chicken at all becomes ], and a line with more than eight stops the program before it runs. The tape is a million cells that wrap at 256. Reading past the end of the input stops the run with an error, as it does in the Python interpreter.
Example
Three lines read a character, add one and print it.
Three lines read a character, add one and print it.
The cat is +[,.] in five lines. It prints all of its input and then stops with the interpreter's error, as there is nothing left to read.
The Hello World program is 106 lines and 348 chickens. It is the well known brainfuck program and prints Hello World! with a line feed.
Patterns it teaches
- Turing tarpit, as it is brainfuck under another name.
Further
See also
Brainchicken builds on Brainfuck.
Brainfuck equivalents
Brainfuck derivatives
Write your own in Run Convert a program from Brainchicken
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: brainchicken.
Command line
shib run brainchicken -e 'chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken' --input 'abc '