esolang

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

Expected: Hello, World!

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

CommandDoes
Fi3Bu5Fizz on multiples of 3, Buzz on multiples of 5, FizzBuzz on their least common multiple
Fizz -> wordThe word printed for Fizz; also Buzz and FizzBuzz
range(1, 10)Count from 1 to 10; the end may be inf
when(7)sevenPrint seven for 7 instead
if(5){...}Run the commands when the counter reaches 5
inA number read from the input, wherever a number goes
) noteA 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.

Expected: 0

Counting to ten in words. Each if adds the next few when lines before they are needed.

Expected: one two three four five six seven eight nine ten

Further

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 fixxbuxx

Source

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