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
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's | Command | O's | Command |
|---|---|---|---|
| 1 | Sum | 9 | Read n lines of input |
| 2 | Product | 10 | The arguments as they are |
| 3 | Subtract | 11 | Command-line arguments |
| 4 | Divide | 12 | Floor of each |
| 5 | Floor divide | 13 | Ceiling of each |
| 6 | Power | 14 | Remainder |
| 7 | Is each a prime | 15 | Join characters into a string |
| 8 | Print 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.
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
- The reference interpreter, no.py, in Python
Ideas it shows
See also
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 noSource
- 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