Skip to content

Instantly share code, notes, and snippets.

@katsuyan
Created July 22, 2017 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katsuyan/306d5eb4af59137a0ba25b98776272d7 to your computer and use it in GitHub Desktop.
Save katsuyan/306d5eb4af59137a0ba25b98776272d7 to your computer and use it in GitHub Desktop.
数学パズルonClojure-Q9
(ns puzzule.q9)
(defn path-recur [b g]
(cond (or (= b g) (= (- b g) 10)) 0
(or (= b 0) (= g 0)) 1
:else (+ (path-recur (- b 1) g)
(path-recur b (- g 1)))))
(defn path [b g]
(path-recur (- b 1) g))
(path 20 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment