Skip to content

Instantly share code, notes, and snippets.

View not-napoleon's full-sized avatar
🏠
Working from home

Mark Tozzi not-napoleon

🏠
Working from home
View GitHub Profile
"""
Iterative towers of Hanoi solution.
This is based on the idea that essentially, the towers problem is a binary
counter, with the disk that gets moved being equal to the bit that would be
set on any iteration of the counter.
The solution exploits a few other mathematical properties of the problem:
To solve an N disk towers of Hanoi requires (2^n)-1 moves (easy to prove
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@not-napoleon
not-napoleon / keybase.md
Created October 17, 2014 01:47
keybase identity

Keybase proof

I hereby claim:

  • I am not-napoleon on github.
  • I am not_napoleon (https://keybase.io/not_napoleon) on keybase.
  • I have a public key whose fingerprint is 7F1A 41CC 5A1C 7F38 013A 7391 EB00 C0E7 F50F D863

To claim this, I am signing this object: