Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn perfectSquare[aux num numero]
- (let [auxN (+ aux num)]
- (cond (= auxN numero) auxN,
- (> auxN numero) num,
- :else (+ num (perfectSquare auxN (+ num 2) numero) ))))
- (defn test [x]
- (dotimes [n x] (def value (perfectSquare 0 1 (- n 1)))
- (if (= value n) "is a perfect quare" "isn't")
- )
- ;test 5 (should run my test 5 times using 'n' as 0 until 5 (or 4..)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement