Fizz Buzz in Pyret

Published on 15 October 2023 (Updated: 15 October 2023)

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

Current Solution

fun fizzbuzz(n :: Number):
  when n > 0 block:
    fizzbuzz(n - 1)
    var result = ""
    when num-modulo(n, 3) == 0:
      result := string-append(result, "Fizz")
    end
    when num-modulo(n, 5) == 0:
      result := string-append(result, "Buzz")
    end
    when string-equal(result, ""):
      result := tostring(n)
    end
    print(string-append(result, "\n"))
  end
end

fizzbuzz(100)

Fizz Buzz in Pyret was written by:

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.