ooh
One letter. A line of o's prints the character whose code is its length.
Turing complete: no · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
ooh has one instruction, o, and the line break that ends it. The specification admits that makes two. Each o adds 1, and the end of the line prints the character with that code. A character costs its code in o's, so an H takes 72 of them and programs get big. The specification puts one that prints the first Harry Potter book at 5,847,284,722,283,091,839 characters.
Read the story
The specification has a Python implementation, and this implementation follows it. Each line runs on its own. A line that holds only o's prints its character and then a line feed, as Python's print does. An empty line or a line with anything else in it prints nothing.
The machine
| Line | Does |
|---|---|
| n o's | Print the character n and a line feed |
| empty, or with any other character | Nothing |
Example
Thirty-three o's print !.
Thirty-three o's print !.
The Hello world, which it says only writes hello. Its first line holds 72 o's, so the H is a capital, and each letter comes out on a line of its own.
The Harry Potter program stops after four lines. They print h, N, W and the control character
- The note after them is a line with other characters, so it prints nothing.
Patterns it teaches
- Every text runs: any text is a program, and lines with other characters are skipped.
Further
See also
Also in Jokes
Write your own in Run Convert a program from ooh
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: ooh.
Command line
shib run ooh program.txtThe program is long; save it as program.txt first.
shib manual oohSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/ooh.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org