

Jane grabbed the stack of disks and put them on the final peg. First, you have to move the disks from peg to peg and leave the base where it is. “The goal is to move all the disks from the left side to the right side.” Before he could finish, Jane spun the base of the puzzle and announced, “Done! That is too easy!” “It's a classic puzzle”, said Melvin Frammis. The disks had a hole in their center like a Chinese coin and they got smaller toward the top of the peg. It was a board with three pegs in a row, and stack of disks on one of the end pegs. Jane Smith from Marketing sat down at the company lunch table, pulled her sandwich from a brown paper bag and picked up the toy. Bugsy Cottman, a junior programmer at International Storm Door & Software, looked up from his lunch, and said “ Yep, I was looking for my old Rubik's Cube and I found this.” “Bugsy, is that a Towers of Hanoi puzzle?” asked Melvin Frammis.
Four hanoi towers solution software#
This puzzle is one of the Sharpen Your Coding Skills series which introduces Melvin and Bugsy and the rest of the programming staff at International Storm Door and Software write beautiful code in whatever programming language they have to hand. But before that, he was an honest developer obsessed with finding good algorithms and clean code. Joe Celko is best known as the database expert who writes books on SQL, data and databases. Here you are challenged to find solutions to some variations, after first explaining the original version. Towers of Hanoi is a classic puzzle and is often used to illustrate the idea of recursion.
