Snack
A language made to eat someone. It counts the people and asks if you are happy.
SmallBug, 2011 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
SmallBug made Snack in 2011. A program is a list of six words, and the only thing it can remember is how many people you are about to eat. Every word prints a fixed line or changes that one count by 1.
The machine
| Word | Does |
|---|---|
grave | Set the count to 0 |
get | Add 1 |
let | Take 1 away; one guy escapes |
eat | Print the count in a sentence, then set it to 0 |
slime | Print that your victims are afraid of you |
sleep | Print a refusal to go to sleep |
Words are split on any whitespace, as the C++ interpreter reads them. Every other word does nothing. Each message ends in a line feed. The count starts at 0, as in the QB64 interpreter; the C++ one leaves it unset.
Example
The example eats two people and then tries to sleep.
The example eats two people and then tries to sleep.
let can take the count below 0, and eat starts it again from 0.
The C++ interpreter would read its last word again forever at the end. The program stops, as the example output and the second interpreter in QB64 do.
Further
See also
Also in Jokes
Write your own in Run Convert a program from Snack
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: snack.
Command line
shib run snack -e 'slime'shib manual snackSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/snack.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org