diff --git a/src/c/rockPaperScissors.c b/src/c/rockPaperScissors.c index 25c0f0f..c5105cd 100644 --- a/src/c/rockPaperScissors.c +++ b/src/c/rockPaperScissors.c @@ -12,7 +12,7 @@ int playRockPaperScissors(int rounds){ int roundwinner = NOWINNER; int winner = NOTWONYET; - printf("Lets play a game\n"); + printPrompt(roundsToWin); while (winner == NOTWONYET){ playerInput = getPlayerInput(); computerInput = getComputerInput(); @@ -92,4 +92,9 @@ int wasGameWon(int roundsToWin, int playerWins, int computerWins){ winner = NOTWONYET; } return winner; +} + + +void printPrompt(int roundsToWin){ + 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); } \ No newline at end of file diff --git a/src/c/rockPaperScissors.h b/src/c/rockPaperScissors.h index 3c655e2..7d9c11f 100644 --- a/src/c/rockPaperScissors.h +++ b/src/c/rockPaperScissors.h @@ -28,5 +28,6 @@ int wasGameWon(int roundsToWin, int playerWins, int computerWins); bool validatePlayerInput(int playerInput); int getPlayerInput(); int playRockPaperScissors(int rounds); +void printPrompt(int roundsToWin); #endif \ No newline at end of file