public class Hanoi extends MiniJava {
    public static byte free(byte a, byte b) {
        return (byte) (3-(a+b));
    }
    
    public static void move(int h, byte a, byte b) {
        if (h > 0) {
            byte c = free(a,b); 
            move(h-1,a,c);
            System.out.println("move "+a+" to "+b);
            move(h-1,c,b);
        }
    }    

    // Jetzt kommt das Hauptprogramm
    public static void main(String[] args) {
        int n = read("Höhe des Turms");
        move(n,(byte) 0, (byte) 2);
    } // end of main()    
}
