
public class Hanoi {

    /**
     * <code>moveDisks</code> - print instructions for moving
     * <code>numDisks</code> disks from peg <code>fromPeg</code> to
     * peg <code>toPeg</code> using the other peg
     * <code>usingPeg</code>. This is to be implemented recursively.
     *
     * @param numDisks an <code>int</code> value - number of disks to move
     * @param fromPeg an <code>int</code> value - source peg of disks
     * @param toPeg an <code>int</code> value - target peg for disks
     * @param usingPeg an <code>int</code> value - other peg
     */
    public static void moveDisks(int numDisks, 
				 int fromPeg, 
				 int toPeg, 
				 int usingPeg) 
    {
	// implement
    }

    public static void main(String[] args) 
    {
	if (args.length != 1) {
	    System.out.println("Usage: java Hanoi <disks>");
	    System.exit(1);
	}
	try {
	    int disks = Integer.parseInt(args[0]);
	    if (disks < 1)
		throw new IllegalArgumentException();
	    moveDisks(disks, 1, 3, 2);
	}
	catch (Exception e) {
	    e.printStackTrace();
	}
    }

}
