Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 1.02 KB

README.md

File metadata and controls

33 lines (22 loc) · 1.02 KB

four-clojure

Problems from 4clojure, tested with Speclj.

For when you want to do some 4clojure problems, but don't want to write the code in the browser.

Installation

Using homebrew:

  • brew cask install adoptopenjdk
  • brew install leiningen

Adding a problem

If the problem you want to solve isn't tested in fourclojure.core-spec yet:

  • Find the problem on 4clojure
  • Add the spec to fourclojure.core-spec, using the number as the describe and the description as the it
  • Add any restricted functions using with-restrictions (Note: functions with :inline meta, like nth, can't be redeffed, so with-restrictions may not always work)
  • Add the assertions as the should(s), replacing the underscores with a function named as the problem number

Solving a problem

  • $ script/restart if you want to start from scratch
  • Add your function to fourclojure.core
  • Run the specs
$ lein spec -a