Make it easier and quicker to iterate on 4clojure problems and track solutions in Git.
- Fork this repo.
rm -rf problems
for a clean slate.
- Start up a REPL. E.g.
lein repl
- Execute
(load-file "update.clj")
on the REPL to populate theproblems
directory. - Edit a problem file to append a solution.
- Execute
(load-file "update.clj")
on the REPL to test all the solutions to problems. - Repeat at will (from step 3).
Here's an incorrect solution to problem 5:
problems/elementary/05_lists_conj.clj
:
; When operating on a list, the conj function will return a new list with one or more items "added" to the front.
; http://www.4clojure.com/problem/5
; (= __ (conj '(2 3 4) 1))
; (= __ (conj '(3 4) 2 1))
(conj [2 3 4] 1)
Running update.clj
results in each test case being echoed, along with evaluation of the form containing the substition, and if the test passed:
"(= __ (conj '(2 3 4) 1))"
=> [2 3 4 1]
false
"(= __ (conj '(3 4) 2 1))"
=> [2 3 4 1]
false
Contributions are welcome. Open a pull request!
Not sure what to contribute? Pick an open issue!
- All the authors of problems for 4clojure - see the commit history for data_set.clj.
- Merlyn Albery-Speyer.
The source code this repository is available under the Eclipse Public License v 1.0 (the same licensing terms as 4clojure). For more information, see LICENSE.html
.