#include //required files #include #include #include // Define the greatest possible value: #define MAX_RANGE 1000 void doWin(); char highscore; main () { system("color 0E"); system("title Guessing Game"); char name[20]; int counter=0; long value,input; srand ( time (NULL) ); // Initialize random generator value = rand()%MAX_RANGE+1; // Get random between 1 and MAX_RANGE cout<<" You have 10 tries to guess the correct number\n"; cout<<"Please enter your name for the highscore list:"; cin>> name; if (value==666){ system("color 4C"); cout<<"Satan has compelled you to guess the correct number"<< endl; } cout << "\nEnter a number between 1 and " << MAX_RANGE << " : \n"; do { cin>> input; counter++; // increase attempts counter if (value>input) // is value grater than the input? cout << "Value is greater than " << input << ". Trys left ["<< 10-counter <<"]"; else if (value> highscore; if (highscore=='y'){ system("cls"); char buffer[256]; ifstream examplefile ("highscore.txt"); if (! examplefile.is_open()) { cout << "Error opening file"; exit (1); } while (! examplefile.eof() ){ examplefile.getline (buffer,100); cout << buffer <