esolang

NH₃

Ammonia. The N does nothing, the H says hello and the 3 sings three bottles of beer.

None1, 2023 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 5 known programs · Test method

Run it

Expected: Hello World!

The idea

None1 made NH₃ in 2023 after HQ9+. Its name is the formula of ammonia, and its commands are the characters of that formula. H prints Hello World!, 3 prints the song of 3 bottles of beer, and N does nothing, like every other character.

Read the story

So the text Hello World! is a quine. Its one H prints it, and the other eleven characters are silent.

The machine

CommandDoes
NNothing
HPrint Hello World! and a line break
3Print 3 bottles of beer, down to No bottles of beer on the wall

Everything else does nothing too. The Python interpreter reads the program with input(), so only the first line runs, and every print ends its line.

Example

The specification also gives an interpreter for APLWSI in NH₃.
Expected: Hello World!
Expected: 3 bottles of beer on the wall, 3 bottles of beer. Take one down and pass it around, 2 bottles of beer on the wall. 2 bottles of beer on the wall, 2 bottles of beer. Take one down and pass it around, 1 bottle of beer on the wall. 1 bottle of beer on the wall, 1 bottle of beer. Take one down and pass it around, No bottles of beer on the wall.

The specification also gives an interpreter for APLWSI in NH₃. It is N, or any text without an H or a 3, such as Nothing here but something here.

Patterns it teaches

  • Quine: a program that is its own greeting.

Further

Also in Jokes

Write your own in Run Convert a program from NH₃

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: nh3.

Command line

shib run nh3 -e 'H'
shib manual nh3

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/nh3.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org