// hanoi, solve Tower of Hanoi // num[] are the pegs that hold the disks // starting from all disks in peg1 (num[1]) // move them to peg3 (num[3]) num = array 4 to mov n from t2 | other = if n == 1 num[from] = num[from] - 1 num[t2] = num[t2] + 1 // print from printc 58 print t2 nl else other = 6 - from - t2 mov n-1 from other mov 1 from t2 mov n-1 other t2 to main | disk = disk = 6 num[0] = 0 num[1] = disk num[2] = 0 num[3] = 0 mov disk 1 3 //main