#include "func_hanoi.h"

int hanoi_recursif(char pic_depart, char pic_destination, char pic_transition, int nb_disques)
{
  unsigned int nb_move = 0;
  
  if (nb_disques == 1)
    {
      nb_move = 1;
    }
  else
    {
      //on modifie les positions des palets 
      nb_move += hanoi_recursif(pic_depart     , pic_transition  , pic_destination, nb_disques - 1);
      nb_move += hanoi_recursif(pic_depart     , pic_destination , pic_transition , 1             );
      nb_move += hanoi_recursif(pic_transition , pic_destination , pic_depart     , nb_disques - 1);
    }
  return nb_move;
}

int hanoi(int nb_disques)
{
  return(hanoi_recursif('1', '2', '3', nb_disques));
}
