-1 bytes :/
Every program is a number, and every number gets FizzBuzzed.
YufangTSTSU, 2024 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 6 known programs · Test method
Run it
The idea
YufangTSTSU made -1 bytes :/ in 2024, after 0 bytes XD, which came after 9 bytes :I, 13 bytes :D, 16 bytes :P and 25 bytes o:. The goal of the chain was the world's smallest interpreter. This one is an empty HQ9+fuck file named hq9+, a byte shorter than an empty HQ9+fuck program, which needs the dot of .hq9+.
Read the story
Every text is a program, and each one prints a single word or number.
The machine
The program becomes one number. Each character adds a digit, its character code less 48, so 0 to 9 give themselves, a letter gives a "digit" above 9 and a space gives -16. Then the number is FizzBuzzed.
| The number | Prints |
|---|---|
| a multiple of 3 and of 5 | FizzBuzz |
| a multiple of 3 | Fizz |
| a multiple of 5 | Buzz |
| anything else | the number |
The specification says 0 prints 0, so 0 counts as no multiple in this implementation. It also says 57 prints 57, but 57 is 3 times 19, and this implementation prints Fizz as the rule says.
Example
foo gives the digits 54, 63 and 63, and 5400 plus 630 plus 63 is 6093, which is 3 times 2031.
foo gives the digits 54, 63 and 63, and 5400 plus 630 plus 63 is 6093, which is 3 times 2031. The program FizzBuzz reads as 285165714, a multiple of 3 but not of 5, so it prints only Fizz.
Patterns it teaches
- Every text runs: any text is a number, so any text is a program.
Further
See also
Also in Jokes
Write your own in Run Convert a program from -1 bytes :/
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: 1-bytes.
Command line
shib run 1-bytes -e '0'shib manual 1-bytesSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/1-bytes.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org