You are here: > Programming Languages > 4Clojure Problems

4Clojure Problems


During this activity, students should be able to:

This activity helps the student develop the following skills, values and attitudes: ability to analyze and synthesize, capacity for identifying and solving problems, and efficient use of computer systems.

Activity Description

This activity can be developed individually or in pairs.

Solve the following problems from the 4Clojure web site:


For each individual problem, write a Clojure source file called problem_n.clj (where n is the problem number) using the following structure:

; Problem and authors info.
(use 'clojure.test)

(def p
  ;;; Clojure code that solves the problem.


(deftest test-p

  ;;; Unit tests.



The unit tests should be same ones provided for that specific problem.

For example, for problem 21. Nth Element, the corresponding Clojure source file problem_21.clj would be:

; Problem 21: Nth Element
; Date: March 17, 2016.
; Authors:
;          A01166611 Pepper Pots
;          A01160611 Anthony Stark

(use 'clojure.test)

(def p
  #(first (drop %2 %1))


(deftest test-p
  (is (= (p '(4 5 6 7) 2) 6))
  (is (= (p [:a :b :c] 0) :a))
  (is (= (p [1 2 3 4] 1) 2))
  (is (= (p '([1 2] [3 4] [5 6]) 2) [5 6])))


Create a ZIP file containing all ten Clojure source files. Call this file

✔ Upload Instructions

To deliver the file, please provide the following information:

Request PIN

Due date is Thursday, March 17.


This activity will be evaluated using the following criteria:

DA One ore more programs were plagiarized.
10-100 Depending on the amount of exercises that were solved correctly.