Created
October 24, 2018 12:08
-
-
Save attentive/80be7fd8f9b29cc98fe69e00650e2d43 to your computer and use it in GitHub Desktop.
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
(ns fizzbuzz | |
(:require [clojure.core.match :refer [match]])) | |
(defn interpret [x y i] | |
(match [x y i] | |
[true true _] "FizzBuzz" | |
[true false _] "Fizz" | |
[false true _] "Buzz" | |
:else i)) | |
(defn main [] | |
(->> (map interpret | |
(cycle [false false true]) | |
(cycle [false false false false true]) | |
(iterate inc 1)) | |
(take 100) | |
(apply println))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment