Getting started

Download clojure-quiz.zip.

You can import it into Eclipse using File → Import... → General → Existing projects into workspace → Archive File, if you would like to use Counterclockwise.

Or, you can just unzip it and use whatever editor you normally use for Clojure.

You will be editing the file src/clojure_quiz/core.clj.

I am not necessarily expecting you to complete the entire quiz. Just do your best. Try to get at least one function working.

Resources you may use

You may use your textbook, the course website, the Clojure MOOC website, the clojure.org website, and the clojuredocs.org website.

Your task

Complete the add-to-all, count-evens, find-min, and pairs functions. Each function has a comment describing its intended behavior, along with some example uses.

Testing

You can test your implementations by running the command lein test from the root directory of the project. The tests are in the file test/clojure_quiz/core_test.clj.

If you would like to run a Clojure REPL to test your functions, run the command lein repl from the root of the project, and then run the command (use 'clojure-quiz.core). E.g.:

[dhovemey@lobsang]$ lein repl
nREPL server started on port 41636 on host 127.0.0.1 - nrepl://127.0.0.1:41636
REPL-y 0.3.1
Clojure 1.6.0
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=> (use 'clojure-quiz.core)
nil
user=> (add-to-all [1 2 3] 4)
"I CAN HAZ HIGHER ORDER FUNCTION?"

You can also use the Counterclockwise REPL by typing Control-Alt-S when you are editing the core.clj file. (Once the REPL is active, you can type Control-Alt-S again to have the REPL reload your functions.)

Submitting

If you are using Eclipse, and have the Simple Marmoset Uploader plugin installed, just select the clojure-quiz project in the package explorer, click the blue up arrow icon, and enter your Marmoset username and password.

You can also submit from the command line by running the command make submit from the root of the project.