#include <stdio.h>

/*! forward declarations */
void move_right(int id);
void move_left(int id);

unsigned int indent = 0;

void doindent()
{
  for (unsigned int i = 0; i < indent; ++i) putchar(' ');
}

void shift_left(int id)
{
  printf("Shift disc %d one peg to left.\n", id);
}

void shift_right(int id)
{
  printf("Shift disc %d one peg to right.\n", id);
}

void move_right(int id)
{
  if (0 == id)
    return;
  move_left(id - 1);        /* move id - 1 discs one peg to left */
  shift_right(id);
  move_left(id - 1);        /* move id - 1 discs one peg to left */
}

void move_left(int id)
{
  if (0 == id)
    return;
  move_right(id - 1);        /* move id - 1 discs one peg to right */
  shift_left(id);
  move_right(id - 1);        /* move id - 1 discs one peg to right */
}

int main(void)
{
  move_left(4);      /* solve 4 disc problem */
  return 0;
}
