This is supposed to be a basic game where you guess a number and the comp will tell you if you got it right or not.
I have the entire thing written, but i cannot run it!
I keep getting this:
error C2059: syntax error : '}'
Its basically saying that im missing a bracket.
I cant seem to find where the thing is though! as far as i can tell, every bracket is paired.
#include <stdlib.h>
#include <iostream>
usingnamespace std;
int main(){
int shell, guess;
int number = rand()%3 + 1;
char choice;
do{
cout << "Would you like to play the shell game? Press 'y' for yes and 'n' for no." << endl;
if (choice == 'y'){
cout << "Where is the nut? Under Shell 1, Shell 2, or Shell 3? (Only type in number of shell)";
while (guess != number){
if (guess > number) {
cout << "Wrong one, try again.";
}else{ cout << "Wrong one, try again.";
}
}while (choice !='n');
cout << "Press any key then enter. Goodbye!";
cin >> choice;
return 0;
}
}
}
Anyone care to take a look and tell me where im missing the bracket?
thanks in advance.