esolang

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

Expected: Hello, World!

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

PartDoes
the first wordA whole number in decimal; the rest of the program is never read
each base 95 digitPrints the character 32 places up, from a space for 0 to ~ for 94
0 or nothingPrints 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…
Expected: !!
Expected: Number

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

Further

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 number

Source

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