jaybeau21

PlayAgain

Apr 24th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. void PlayAgain(char &again)
  2. /*Gives the player the option to play again
  3. Again returned as either y or n*/
  4. {
  5. //Deal again
  6. cout << "\nDo you want another hand dealt? Enter either 'y' or 'n': ";
  7. cin >> again;
  8.  
  9. //Error in again
  10. if(again != 'y' && again != 'n')
  11. {
  12. do
  13. {
  14. ClearScreen();
  15. cout << "Error! Please enter either 'y' or 'n': ";
  16. cin >> again;
  17. ClearScreen();
  18. }while(again != 'y' && again != 'n');
  19. }
  20. }
Add Comment
Please, Sign In to add comment