FixxBuxx
A language built for FizzBuzz, and anything else has to be talked into it.
2022 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
FixxBuxx, from 2022, has one loop and it is always FizzBuzz. The counter runs through a range and every number prints a line with the number, or Fizz, Buzz or FizzBuzz. The commands only bend that loop. They move the multiples, rename the words, change the range, swap in a line for one number, or run more commands when the counter reaches a number. So FizzBuzz itself is one command, and Hello World is a FizzBuzz of length one whose only line has been replaced.
The machine
| Command | Does |
|---|---|
Fi3Bu5 | Fizz on multiples of 3, Buzz on multiples of 5, FizzBuzz on their least common multiple |
Fizz -> word | The word printed for Fizz; also Buzz and FizzBuzz |
range(1, 10) | Count from 1 to 10; the end may be inf |
when(7)seven | Print seven for 7 instead |
if(5){...} | Run the commands when the counter reaches 5 |
in | A number read from the input, wherever a number goes |
) note | A comment to the end of the line |
The specification leaves the defaults open. In this implementation the loop starts as plain FizzBuzz, 3 and 5 from 1 to 100, and every line ends in a line feed.
Example
The truth machine reads its start from the input.
The truth machine reads its start from the input. On 0 it prints 0 and an if cuts the range to 0. On 1 the if for 1 sets the end to inf, and every number is a multiple of 1, whose word is now 1.
Counting to ten in words. Each if adds the next few when lines before they are needed.
Further
See also
Also in Jokes
Write your own in Run Convert a program from FixxBuxx
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: fixxbuxx.
Command line
shib run fixxbuxx -e 'Fi3Bu5 ) Multiples of 3 are replaced with "Fizz", and multiples of 5 are replaced with "Buzz". Multiples of lcm(3,5) = 15 are replaced with "FizzBuzz".'shib manual fixxbuxxSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/fixxbuxx.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org