//
you're reading...
Uncategorized

Clojure Programming Quiz #1

This quiz is inspired by http://www.4clojure.com/problems
Replace each __ with a valid clojure form so that each expression evaluates to true
Please submit your solutions to BB.


;; (= (- 10 (* 2 3)) __)
;; (= (list __) '(:a :b :c))
;; (= __ (conj '(3 4) 2 1))
;; (= __ (conj [1 2] 3 4))
;; (= #{1 2 3 4} (conj #{1 4 3} __))
;; (= __ (:b {:a 10, :b 20, :c 30}))
;; (= __ ((fn [x] (+ x 5)) 3))
;; (= __ ((partial + 5) 3))
;; (= (__ 7) 14
;; (= (__ 1 8 3 9 4) 9)
;; (= (__ "Jenn") "Hello, Jenn!")
;; (= (__ (list 1 2 3 4 5)) 5)
;; (= (__ (list 1 2 3 4 5)) 4)
;; (= __ (let [x 3, y 10] (- y x)))
;; (= (__ #{1 2 3 4 5}) '(1 3 5))
;; (= (__ [1 1 2 1 3 1 1 3]) 5 )
;; (= (__ [1 2 3]) {1 1, 2 2, 3 3}
;; (= (__ [1 2 3]) '([1 1] [2 2] [3 3]))
;; (= (__ [1 2 3 4 5 6]) '(2 3 4 5 6 1))
;; (= (__ 2 [1 2 3 4 5 6]) '(3 4 5 6 1 2))

Advertisement

Discussion

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: