Skip to content

An iterative (tail recursive) version of the Towers of Hanoi in Clojure

Notifications You must be signed in to change notification settings

retnuh/clojure-hanoi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# hanoi

A version of the Towers of Hanoi, that uses an iterative algorithm,
rather that the traditional recursive algorithm.  It is actually still
a recursive algorithm, using the clojure loop/recur construct.  In
other lisps it would be tail recursive.  This is important, in that
the stack size is bounded; it could solve an arbitrarily large tower
problem without blowing the stack.

## Usage

Err, usage is a bit weak at the moment. It was developed using
Leiningen (https://github.com/technomancy/leiningen) and
Lazytest (https://github.com/stuartsierra/lazytest).

The easiest way
to run it is probably:

$ lein deps
$ java -cp "src:test:classes:lib/*:lib/dev/*" lazytest.main src test

This will run the lazytest stuff once.  If you want to play around
with stuff, you can run in watch mode:

$ java -cp "src:test:classes:lib/*:lib/dev/*" lazytest.watch src test

## License

Copyright (C) 2011 Hunter Kelly

Distributed under the Eclipse Public License, the same as Clojure.

About

An iterative (tail recursive) version of the Towers of Hanoi in Clojure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published