Skip to content

Instantly share code, notes, and snippets.

@jiro4989
Created February 2, 2021 16:46
Show Gist options
  • Save jiro4989/8ac491c820af77e3c9b7265cf83192b5 to your computer and use it in GitHub Desktop.
Save jiro4989/8ac491c820af77e3c9b7265cf83192b5 to your computer and use it in GitHub Desktop.
世界のナベアツ.clj
(require '[clojure.string :as str])
(defn aho? [num]
(or (zero? (mod num 3))
(str/includes? (str num) "3")))
(->> (range 1 100)
(map #(if (aho? %)
"アホ"
(str %)))
println)
; $ clojure nabeatsu.clj
; (1 2 アホ 4 5 アホ 7 8 アホ 10 11 アホ アホ 14 アホ 16 17 アホ 19 20
; アホ 22 アホ アホ 25 26 アホ 28 29 アホ アホ アホ アホ アホ アホ アホ アホ アホ アホ
; 40 41 アホ アホ 44 アホ 46 47 アホ 49 50 アホ 52 アホ アホ 55 56 アホ 58 59 アホ
; 61 62 アホ 64 65 アホ 67 68 アホ 70 71 アホ アホ 74 アホ 76 77 アホ 79 80
; アホ 82 アホ アホ 85 86 アホ 88 89 アホ 91 92 アホ 94 95 アホ 97 98 アホ)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment