Top Animation

gniibe Distributed Hanoi Protocol

Terms

Initial condition

  1. One is SOURCE who has all disks.
  2. Another is DESTINATION.
  3. The other is AUXILIARY.
  1. If number of disks is odd: or else (even)
  2. DESTINATION and AUXILIARY face to SOURCE

The protocol

Each tower does repeat the following steps until finish:
  1. Exchange
    1. Compare the size of top of disks of two towers (No disk means infinite size).
    2. Winner is those who has bigger disk on the top of the tower.
    3. Winner get the top disk from loser's tower, and put it on top of the tower.
  2. Turn
      Turn to another tower.

End detection

  1. When two towers compares no disk, that's end of the game.

Demonstration

Demo (4 disks)
Number of visits: 6102
|
|
|
|
|
|
|
|
###
#########
###############
#################
###################
#####################
#######################
#############################
###############################
#################################
###################################
#####################################
#######################################
#########################################
===========================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
###########
#########################
===========================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#####
#######
#############
###########################
===========================================
$Id: gdhp.html,v 1.8 2004/03/29 12:12:31 gniibe Exp $