Skip to content

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

License

Notifications You must be signed in to change notification settings

sw-samuraj/blog-catalan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published