#include <limits>
#include <iostream>
#include <vector>
#include "hanoi.h"
using namespace std;

//-------------------------------------------------------------------------------

int readCountOfSlicesFromUser()
{
   int count;
   for (;;)
   {
      cout << "Wie viele Scheiben: ";
      cin >> count;
      if (!(cin.fail() || count < 1 || count>19))
      {
         break;
      }
      cout << "\nBitte keinen Bloedsinn eingeben\n\n";
      cin.clear();
      cin.ignore(numeric_limits<streamsize>::max(), '\n');
   }
   return count;
}

//-------------------------------------------------------------------------------

int main()
{
   cout << "Tuerme von Hanoi 2\n\n";

   const int count = readCountOfSlicesFromUser();
   cout << "Anzahl Scheiben: " << count << '\n';

   Hanoi hanoi(count);
   hanoi.play();
}
