Getting started
Download cs340-lab18.zip. It is an Eclipse project, so you can import it into Eclipse using File→Import…→General→Existing projects into workspace→Archive file. You should see a project called cs340-lab18 in your Eclipse workspace.
Your task
This is a Clojure review lab. It is intended to prepare you for Exam 2.
Complete the rotate-triple, make-repeated-applicator, make-triple-rotator, make-pairs, count-nested, and my-eq functions in src/clojure_review3/core.clj
. Each function is described by a detailed comment with example inputs and expected results.
You can test your functions by running the command lein test
in a terminal window from the root of the project.
You can also start a Clojure REPL (in Eclipse) by right-clicking in core.clj
and choosing Clojure→Load file in REPL. This is very useful for testing your functions interactively.
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.
Note that this lab is not graded, but it is intended to be a (second) preview of Exam 2, so you should try to complete it using only the resources listed above (which you will also have access to for Exam 2.)
Solutions
Here are my solutions: lab18.clj. Do not look at these until you have completed all of the functions on your own.