Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 445 Bytes

2023-12-11-array-fizzbuzz-in-clj.md

File metadata and controls

19 lines (15 loc) · 445 Bytes
title categories
Array FizzBuzz in Clojure
apljk

This is a translation of an array-like fizzbuzz to clojure. I think it maps quite well.

(->> (range 1 20)
           (map #(vector % [(= 0 (mod % 3)) (= 0 (mod % 5))]))
           (map #({[true false] "fizz"
                   [false true] "buzz"
                   [true true] "fizzbuzz"
                   [false false] (first %)}
                  (second %))))