Skip to content

Instantly share code, notes, and snippets.

View yurkazaytsev's full-sized avatar

Yuriy Zaytsev yurkazaytsev

View GitHub Profile
@yurkazaytsev
yurkazaytsev / 100prisoners.clj
Last active August 14, 2024 15:34
Solution for 100 prisoner task from Rosseta code in clojure
(ns prisoners
"Solution for this task https://rosettacode.org/wiki/100_prisoners")
(defn prisoner-found? [prisoner opened-drawers]
(->> opened-drawers
(drop-while (partial not= prisoner))
seq
some?))
(defmulti check-drawers (fn [strategy _drawers _prisoner] strategy))