Skip to content

Instantly share code, notes, and snippets.

@radixm46
Created May 15, 2023 02:44
Show Gist options
  • Save radixm46/2f0989666e911467fd324cd3b82aeaf3 to your computer and use it in GitHub Desktop.
Save radixm46/2f0989666e911467fd324cd3b82aeaf3 to your computer and use it in GitHub Desktop.
fizzbuzz with hylang
#!/usr/bin/env hy
(defn fizzbuzz_match_map [num]
(print (.join
"\n"
(map (fn [i]
(match #((% i 3) (% i 5))
#(0 0) "FizzBuzz"
#(0 _) "Fizz"
#(_ 0) "Buzz"
#(_ _) (str i)))
(range 1 (+ num 1))))))
(when (= __name__ "__main__")
(fizzbuzz_match_map 500_000))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment