#you have to make those two moves first movedisks( $num-1, $from, $aux, $to ); movedisks( $num-1, $aux, $to, $from );