Anyways
There was a guy called Hello World. "Ow!" it said. That's all folks!
Gusg21, 2017 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Gusg21 designed and implemented Anyways in 2017, so that a program reads like a joke routine. Every line is a sentence from a story. Under the story is one accumulator and a set of named memory slots. A guy who turns up sets the accumulator, things that happen to him do arithmetic on it, and when it says "Ow!" it is printed.
Read the story
The specification lists no loop, so every program stops.
The machine
| Line | Does |
|---|---|
There was a guy called x | Set the accumulator to x, a number or text |
"Ow!" it said. | Print the accumulator |
"What are you doing?" they said. | Read a line of input into it |
And then x happened! | Add x |
But then x happened! | Subtract x |
When x happened! | Multiply by x |
Until x happened! | Divide by x |
Then I forgot, x! | Store the accumulator in slot x |
Then I remembered, x! | Read slot x back |
That's all folks! | End; every program must have it |
The specification also has Knock Knock, condition ... Who's there? ... Banana!, which runs one part or the other. It never says what a condition looks like, so this implementation leaves it out. The interpreter is in Python and not in the specification, so a few things are choices of this implementation. A print ends with a line feed. And then joins text, and the other three need numbers.
Example
A Hello, World! and a cat.
A Hello, World! and a cat.
Arithmetic and a memory slot. Six times seven is printed, then forgotten in the pocket while the accumulator is divided by 4, then remembered.
Patterns it teaches
- Camouflage: a register machine told as a joke.
Further
- esolangs.org/wiki/Anyways
- The interpreter, in Python
See also
Also in Camouflage
Write your own in Run Convert a program from Anyways
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: anyways.
Command line
shib run anyways -e '"What are you doing?" they said.
"Ow!" it said.
That'\''s all folks!' --input 'cat'shib manual anywaysSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/anyways.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org