#include using namespace std; int numberGuess, numberAnswer, difC, dif, guess; int assignValue(int a, int b) { if(a == 1) { b == 10; } else if(a == 2) { b == 20; } else if(a == 3) { b == 30; } else { cout << "Error. That is incorrect. Press enter to exit.\n"; cin.get(); } } int main() { srand ( time(NULL) ); cout << "Welcome to the random number game!\n\nIn this game, you will guess the randomly generated number.\n\nPlease select a difficulty from below: \n\n"; cout << "1)Easy (0-9)\n2)Novice (0-19)\n3)Hard (0-29)\n> "; cin >> difC; assignValue(difC, dif); numberAnswer = rand() % dif; cout << "I thought of a number.....What is it?\n"; cout << "> "; cin >> numberGuess; do { guess ++; cout << "Nope! Try again!\n"; cout << "> "; cin >> numberGuess; } while(numberGuess != numberAnswer); cout << "You got it!"; cout << "\nIt also took you " << guess << "guess(es)!"; cout << "\nPress enter to quit."; cin.get(); return 0; }