hanoi
Tower of Hanoi algorithm for finding the smallest number of steps to move the stack.
The Towers of Hanoi is a mathematical puzzle whose solution illustrates recursion. There are three pegs which can hold stacks of disks of different diameters. A larger disk may never be stacked on top of a smaller. Starting with n
disks on one peg, they must be moved to another peg one at a time. — Wikipedia
Install
npm install hanoi
bower install hanoi
Usage
const hanoi = ; console; // 0console; // 1console; // 3console; // 7console; // 15console; // 31console; // 63console; // 127console; // 255console; // 511
Test
npm test
License
MIT