A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
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.
# 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')
# Jump to Loop start
0o54 π»πΉπΉππΏπΉπΉππ Jump to 0o12 (0o11 + 1)
0o55 ππ Exit
Fizz Buzz in Unicat was written by:
If you see anything you'd like to change or update, please consider contributing.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.