esolang

No

Every line says no. How many O's it says decides what it does.

caird coinheringaahing, 2020 · Turing complete: no · ●●○ moderate · esolangs.org

Tested with 7 known programs · Hello World on Try It Online: identical except the line end · Test method

Run it

Expected: 10

The idea

No is a small language by caird coinheringaahing, kept together with its sibling Uno. A program is a list of refusals. Each line starts with N and some capital Os, and the number of Os picks one of 15 commands. After a ? come the arguments, joined by !, and they are written in no as well. nooo is the number 3, N with 72 os is the letter H, nn.OOO is 2.03, and yes means the result of line 0. Only the last line runs; the others run when a yes asks for them.

The machine

O'sCommandO'sCommand
1Sum9Read n lines of input
2Product10The arguments as they are
3Subtract11Command-line arguments
4Divide12Floor of each
5Floor divide13Ceiling of each
6Power14Remainder
7Is each a prime15Join characters into a string
8Print the arguments

The reductions run left to right, so NOOO?noooooooooo!nooo is 10 minus 3. Printing a line that gave a list shows the list in Python's own notation.

Example

The first adds 3, 3 and 4.
Expected: 28
Expected: [True, False, True]

The first adds 3, 3 and 4. In the second, the last line prints line 1, which multiplies line 0 (10 minus 3) by 4. The third asks which of 5, 6 and 7 are prime.

Further

Ideas it shows

No-code esolang

Write your own in Run Convert a program from No

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run no -e 'NOOOOOOOOO?noo
NOOOOOOOO?yes' --input '3
4
'
shib manual no

Source

Module
langs/tio/ports.js
Interpreter
langs/tio/no.js

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

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