Number
The whole program is one number. It prints the text that number stands for.
Turing complete: no · ●○○ easy · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
Number is a joke language with a single kind of command, a whole number. There is no input, no variable and no loop. The 95 printable ASCII characters, from the space to ~, are the digits of base 95, and a program is a text written down in that base. Hello, World! is a 26 digit number.
Read the story
The specification's text says the number counts all texts in order, so that 1 is a space, 95 is ~ and 96 is two spaces. Its own interpreter and its Hello, World! do something simpler. They read the number in plain base 95 with the space as digit 0, so 1 is ! and 96 is !!. This implementation follows the interpreter. esolangs.org files Number under Turing complete, though a program can only print one fixed text.
The machine
| Part | Does |
|---|---|
| the first word | A whole number in decimal; the rest of the program is never read |
| each base 95 digit | Prints the character 32 places up, from a space for 0 to ~ for 94 |
0 or nothing | Prints one space |
The specification also gives the converter the other way. It multiplies by 95 and adds each character's distance from the space, which is how to write any text that does not start with a space.
Example
362929154537 is 46 × 95⁵ + 85 × 95⁴ + 77 × 95³ + 66 × 95² + 69 × 95 + 82, the distances of N, u, m, b, e…
362929154537 is 46 × 95⁵ + 85 × 95⁴ + 77 × 95³ + 66 × 95² + 69 × 95 + 82, the distances of N, u, m, b, e and r from the space.
Patterns it teaches
- Encoding tricks: a text read as one number in base 95.
Further
See also
Also in Jokes
Write your own in Run Convert a program from Number
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: number.
Command line
shib run number -e '1'shib manual numberSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/number.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org