Skip to content

Make it easier and quicker to iterate on 4clojure problems and track solutions in Git.

License

Notifications You must be signed in to change notification settings

curious-attempt-bunny/4clojure-offline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Purpose

Make it easier and quicker to iterate on 4clojure problems and track solutions in Git.

Getting setup

  1. Fork this repo.
  2. rm -rf problems for a clean slate.

Usage

  1. Start up a REPL. E.g. lein repl
  2. Execute (load-file "update.clj") on the REPL to populate the problems directory.
  3. Edit a problem file to append a solution.
  4. Execute (load-file "update.clj") on the REPL to test all the solutions to problems.
  5. Repeat at will (from step 3).

Example

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

Contributions are welcome. Open a pull request!

Not sure what to contribute? Pick an open issue!

Contributors

License

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.

About

Make it easier and quicker to iterate on 4clojure problems and track solutions in Git.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published