The Towers of Hanoi is a classic logical puzzle that you have almost certainly played, maybe even written a computer program to solve it. It involves stacking several pieces in height order onto one of three pegs.
In this chapter, we are going to create that game in a simple sort of way. Don't worry if you have never played it before; I'll explain before each tutorial what we are going to make next.
Here we see a side-view of a tower being built. The peg is shown in brown, the red block is resting on the peg, and the green block is being added to the peg. The height of the tower is the number of blocks on its peg.
In this tutorial, we will make a peg graphic onto which we can put building blocks. The blocks will arrive on the peg (actually, just a LinearLayout)
using a tween animation. This is the way a tower is formed in the game.
1. Create a new Android project with the following settings:
Project name: Towers of Hanoi
Build Target: Android...