Im doing this little bit of basic code and i kno that there are better ways of doing it but its just practice mu problem is that when Player 1 enters the secret number it displays on the screen
im wondering how i can make id display like ** or somthing can any one guide me in the right direction thanks in advance
int main(int argc, char* argv[])
{
int thenum = 0;
int count = 1;
int guess = 0;
cout << endl;
cout << "*****Welcome to the numbers game*****" << endl << endl;
cout << "This is a 2 player game (for now) " << endl << endl;
cout << "The rules are simple - have Player 1 choose a number between 1-100 and then Player 2 will try to guess the number in the least amount of guesses Ok!";
cout << endl << endl << endl;
cout << "Welcome Player 1 please enter you secret number: ";
cin >> thenum;
cout << endl;
cout << "Thank you now its time to guess Player 2 hope ur ready";
cout << endl;
do
{
cout << " Player 2 please enter your guess: ";
cin >> guess;
cout << endl;
if (guess < thenum)
{
cout << "Im sorry your guess was too low Pleast try again ";
cout << endl;
}
else if (guess > thenum)
{
cout << "Im sorry your guess was too high Please try again ";
cout << endl;
count++;
}
}
while (guess != thenum);
cout << "Very good you finaly got it!! ";
cout << endl;
cout << "it took you " << count << "tries, im afraid u wont make highscore with that cya";
return 0;
}