@ -12,7 +12,7 @@ int playRockPaperScissors(int rounds){
introundwinner=NOWINNER;
introundwinner=NOWINNER;
intwinner=NOTWONYET;
intwinner=NOTWONYET;
printf("Lets play a game\n");
printPrompt(roundsToWin);
while(winner==NOTWONYET){
while(winner==NOTWONYET){
playerInput=getPlayerInput();
playerInput=getPlayerInput();
computerInput=getComputerInput();
computerInput=getComputerInput();
@ -92,4 +92,9 @@ int wasGameWon(int roundsToWin, int playerWins, int computerWins){
winner=NOTWONYET;
winner=NOTWONYET;
}
}
returnwinner;
returnwinner;
}
voidprintPrompt(introundsToWin){
printf("Hello NAME.\nLet us play a game, shall we? I assume you are familiar with Rock-Paper-Scissors?\nIf not, here are the rules:\nThe first one to win %d rounds wins the game. Rock beats scissors, scissors beats paper and paper beats rock.\nThey are quite simple, even you should understand. Got it?\n",roundsToWin);