A trial Clojure project for a blog post about the Catalan numbers.
Clojure
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/blog_catalan
test/blog_catalan
.gitignore
LICENSE
README.md
project.clj

README.md

blog-catalan

A trial Clojure project for a blog post about the Catalan Numbers.

Usage

core namespace

The namespace contains three basic functions:

  • factorial counts a factorial.
  • binomial counts a binomial coefficient.
  • catalan counts a Catalan number.

All these funcitons build on top of each other - catalan uses binomial which uses factorial.

Additionally, there is a function catalans which returns a lazy sequence of the Catalan numbers.

recur namespace

The namespace contains a catalan function which counts a Catalan number via recursion.

Midje tests

You can run all Midje tests by lein midje.

REPL

You can load the functions into the REPL with:

(require '[blog-catalan.core :as c]
         '[blog-catalan.recur :as r])

(c/catalan 5)
(r/catalan 5)

License

Copyright © 2017 Vít Kotačka

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.