Skip to content

Commit

Permalink
Added a chance counter and renamed file
Browse files Browse the repository at this point in the history
  • Loading branch information
imsamroy authored Feb 28, 2022
1 parent 02cc5eb commit c1f3e7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Number-guessing-game.cpp → Number-Guessing-Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ int main()

if (guess==randomNumber && chances<=chanceLimit)
{
cout<<"That was correct! You won!"<<endl;
cout<<"That was correct! You won! (Chances: "<<chances<<"/"<<chanceLimit<<")"<<endl;
break;
}
else if (guess!=randomNumber && chances<chanceLimit)
{
cout<<"Wrong, please retry"<<endl;
cout<<"Wrong, please retry (Chances: "<<chances<<"/"<<chanceLimit<<")"<<endl;
}
else if (guess!=randomNumber && chances<=chanceLimit)
{
cout<<"Sorry, out of guesses. You Lost. The number was "<<randomNumber<<endl;
cout<<"Sorry, out of chances! You Lost! The number was: "<<randomNumber<<endl;
}

}
Expand Down

0 comments on commit c1f3e7b

Please sign in to comment.