FixxBuxx

From Esolang
Jump to navigation Jump to search

FixxBuxx is a joke language. It is used for writing FizzBuzz Programmes, but you can write other programmes too!

Commands

Command Description
Fimultiple1Bumultiple2 Changes the standard multiples for activating the “Fizz”, “Buzz”, and “FizzBuzz” outputs to the integer multiple1 for “Fizz” and the integer multiple2 for “Buzz”. “FizzBuzz” is computed using the least common multiple (lcm) in this mode: lcm(integer1, integer2).
Fizz -> string Sets the string to print for multiples of “Fizz” to string.
Buzz -> string Sets the string to print for multiples of “Buzz” to string.
FizzBuzz -> string Sets the string to print for multiples of “FizzBuzz” to string.
range(start, end) Sets the loop counter start value to the integer start and its inclusive end value to end, which might be an integer or the inf constant for an infinite repetition.
when(counter)string Associates the string with the integer counter. If the program loop counter matches the counter, the string is printed instead of the usual message. This behavior overwrites all other output, including “Fizz”, “Buzz”, “FizzBuzz”, and the verbatim counter printing.
if(counter){code} Associates the code with the integer counter. If the program loop counter matches the counter, the zero or more commands of the code are executed.
in Queries the input conduit for an integer value, admissible in any position which accepts integer literals.
)annotation Inserts the commentary annotation text into the code.

Examples

Hello, World!

range(1,1)            ) The range is from 1 to 1
when(1)Hello, World!  ) When you need to print 1, print "Hello, World!" instead.
Fi1Bu1                ) Multiples of 1(Only 1), print "FizzBuzz". But you need to print "Hello, World!" because of the "when" command.

FizzBuzz

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".

Truth Machine

range(in,1)           ) If input is 0, the range is from 0 to 0. If input is 1, the range is from 1 to 1
Fizz -> 1             ) Change "Fizz" into "1".
Buzz -> 1             ) Change "Buzz" into "1".
FizzBuzz -> 1         ) Change "FizzBuzz" into "1".
when(0)0              ) When you need to output 0, output 0.
if(0){range(0,0)}     ) If the first output is 0 (the input is 0), the range is 0 to 0.
if(1){range(1,inf)}   ) If the first output is 1 (the input is 1), the range is 1 to infinity.
Fi1Bu1                ) Multiples of lcm(1,1) = 1, print "FizzBuzz", but it's replaced by "1".

Spelling Out Numbers

This program, covering the counter range from inclusive 1 to inclusive 10, employs various techniques to spell out the counter values:

range(1, 10)
when(1)one
if(1){when(2)two}
if(2){when(3)three
  when(4)four
  when(5)five}
if(5){
  when(6)six
  when(7)seven
  when(8)eight}
Fi9Bu10
Fizz -> nine
Buzz -> ten

See also

DIVSPL, a domain-specific language for solving the FizzBuzz problem

Interpreter

  • Common Lisp implementation of the FixxBuxx programming language.