Say you pick a number, you are given ten attempts to guess it right
if you're right display CONGRATULATIONS!! and then end the program.
But if you finish the ten attempts and you still don't know the number,
The program should display "I give up!"
and only one thing I need help is trying to detect cheat.
how do you detect cheat when you come so close to knowing the number and then the other person keeps saying that its higher or lower than the number guesed
i really need you help
Do you mean that if the person is falsely saying "higher" when its actaully lower, just to put them off?
if not, then specify and alos tell me about the other person and how it works.
//THe character that they sayer higher or lower to: H, L, W will be char input.
char input;
cout <<"IS the munber higher lower or I win?: ";
cin>> input;
if (input == 'L' || input =='H' && aliceNumber == chosenNumber)
{
cout << "You cheated"<<endl;
}
This if statement checks if either: first, if you input an 'L' or a 'H', using the logical operator '||' which is like an 'or' checker. so if you entered either h or l AND (&&) the number she guessed (aliceNumber) == the number ( chosenN umber) then she guessed correctly, but they entered 'l' or 'h', so it prints out "cheat"