Skip to content
梶塚太智 edited this page Oct 3, 2024 · 2 revisions

This program is to solve the FizzBuzz problem.

(define '(fizzbuzz i:number)
    '(if-else (= 0 (% i 15)):bool
        "FizzBuzz":string
        '(if-else (= 0 (% i 3)):bool
            "Fizz":string
            '(if-else (= 0 (% i 5)):bool
                "Buzz":string
                '(cast i "string")
            ):list
        ):list
    ):list
):function
(print (join (map (range 1 101):list fizzbuzz:function):list new-line:string):string)
Clone this wiki locally