Created
May 15, 2023 02:44
-
-
Save radixm46/2f0989666e911467fd324cd3b82aeaf3 to your computer and use it in GitHub Desktop.
fizzbuzz with hylang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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