esolang

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

Expected: !

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

LineDoes
n o'sPrint the character n and a line feed
empty, or with any other characterNothing

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.

Expected: H e l l o

The Harry Potter program stops after four lines. They print h, N, W and the control character

  1. 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

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.txt

The program is long; save it as program.txt first.

shib manual ooh

Source

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