# Fizz Buzz in Unicat

Published on 28 August 2023 (Updated: 28 August 2023)

Welcome to the Fizz Buzz in Unicat page! Here, you'll find the source code for this program as well as a description of how the program works.

## Current Solution

``````# This program implements the fizz-buzz algorithm. It tests the math
# instructions

# Set up letters
0o00 π»πΉπΈπππΉπΈπΎππ Memory 0 = 0o106 (70 = 'F')
0o01 π»πΉπΉπππΉπ½πΉππ Memory 1 = 0o151 (105 = 'i')
0o02 π»πΉπΊπππΉπΏπΊππ Memory 2 = 0o172 (122 = 'z')
0o03 π»πΉπ»πππΉπΈπΊππ Memory 3 = 0o102 (66 = 'B')
0o04 π»πΉπΌπππΉπΎπ½ππ Memory 4 = 0o165 (117 = 'u')
0o05 π»πΉπ½πππΉπΊππ Memory 5 = 0o12 (10 = '\n')

# Set up constants
0o06 π»πΉπΎπππΈππ Memory 6 = 0 (n)
0o07 π»πΉπΏπππΉππ Memory 7 = 1
0o10 π»πΉπΉπΈπππ»ππ Memory 8 (0o10) = 3
0o11 π»πΉπΉπΉπππ½ππ Memory 9 (0o11) = 5

# Loop start: Increment n. If n > 100, exit
0o12 πΏππΈπΎπππΏππ Memory 6 += Memory 7 (increment n)
0o13 π»πΉπΉπΊπππΉπΌπΌππΏ Memory 10 (0o12) = -0o144 (-100)
0o14 πΏππΈπΉπΊπππΎππ Memory 10 (0o12) += Memory 6 (n - 100)
0o15 π½πΏπΉπΊπππ½πΌππ If Memory 10 (0o12) > 0, jump to 0o55 (0o54 + 1) (if n > 100)

# Indicate no output
0o16 π»πΉπΉπ»πππΈππ Memory 11 (0o13) = 0

# If n mod 3 is 0, output "Fizz" and indicate output
0o17 π»πΉπΉπΊπππΈππ Memory 10 (0o12) = 0
0o20 πΏππΈπΉπΊπππΎππ Memory 10 (0o12) += Memory 6 (n)
0o21 π»πΉπΉπΌπππΈππ Memory 12 (0o14) = 0
0o22 πΏππΈπΉπΌπππΎππ Memory 12 (0o14) += Memory 6 (n)
0o23 πΏππΏπΉπΌπππΉπΈππ Memory 12 (0o14) /= Memory 8 (0o10) (3)
0o24 πΏπππΉπΌπππΉπΈππ Memory 12 (0o14) *= Memory 8 (0o10) (3)
0o25 πΏππΊπΉπΊπππΉπΌππ Memory 10 (0o12) -= Memory 12 (0o14) (n - floor(n / 3) * 3)
0o26 π½πΏπΉπΊπππ»π»ππ If Memory 10 (0o12) > 0, jump to 0o34 (0o33 + 1)
0o27 π½πΌπΈππ Output Memory 0 ('F')
0o30 π½πΌπΉππ Output Memory 1 ('i')
0o31 π½πΌπΊππ Output Memory 2 ('z')
0o32 π½πΌπΊππ Output Memory 2 ('z')
0o33 π»πΉπΉπ»πππΉππ Memory 11 (0o13) = 1

# If n mod 5 is 0, output "Buzz" and indicate output
0o34 π»πΉπΉπΊπππΈππ Memory 10 (0o12) = 0
0o35 πΏππΈπΉπΊπππΎππ Memory 10 (0o12) += Memory 6 (n)
0o36 π»πΉπΉπΌπππΈππ Memory 12 (0o14) = 0
0o37 πΏππΈπΉπΌπππΎππ Memory 12 (0o14) += Memory 6 (n)
0o40 πΏππΏπΉπΌπππΉπΉππ Memory 12 (0o14) /= Memory 9 (0o11) (floor(n / 5))
0o41 πΏπππΉπΌπππΉπΉππMemory 12 (0o14) *= Memory 9 (0o11) (floor(n / 5) * 5)
0o42 πΏππΊπΉπΊπππΉπΌππ Memory 10 (0o12) -= Memory 12 (0o14) (n - floor(n / 5) * 5)
0o43 π½πΏπΉπΊπππ½πΈππ If Memory 10 (0o12) > 0, jump to 0o51 (0o50 + 1)
0o44 π½πΌπ»ππ Output Memory 3 ('B')
0o45 π½πΌπΌππ Output Memory 4 ('u')
0o46 π½πΌπΊππ Output Memory 2 ('z')
0o47 π½πΌπΊππ Output Memory 2 ('z')
0o50 π»πΉπΉπ»πππΉππ Memory 11 (0o13) = 1

# If no output, output n as value
0o51 π½πΏπΉπ»πππ½πΊππ If Memory 11 (0o13) > 0, jump to 0o53 (0o52 + 1)
0o52 πΌπΌπΎππ Output Memory 6 (n) as value

# Output newline
0o53 π½πΌπ½ππ Output Memory 5 ('\n')

0o55 ππ Exit

``````

Fizz Buzz in Unicat was written by:

• rzuckerm

If you see anything you'd like to change or update, please consider contributing.

## How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

## How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.