#include <iostream>
#include <stdlib.h>

using namespace std;

/* Defines */
int number;
int tries = 0;
int guess = 0;

int main() {
  /* create the number */
  srand((unsigned)time(NULL)); 
  number = rand()%100;
  
  /* start up the game */
  cout << "Guess on a number between 1 and 100" << endl;
  while( number != guess ) {
    cout << "Your guess: ";
    cin >> guess;
    tries++;

    /* compare */
    if ( number > guess ) {
      cout << "The number is bigger" << endl;
    } else {
      cout << "The number is smaller" << endl;
    }
  }
  cout << "It did take you " << tries << " tries to find the number." << endl;
  return 0;
}
