diff --git a/src/c/rockPaperScissors.c b/src/c/rockPaperScissors.c index c5105cd..5309aa4 100644 --- a/src/c/rockPaperScissors.c +++ b/src/c/rockPaperScissors.c @@ -97,4 +97,29 @@ int wasGameWon(int roundsToWin, int playerWins, int computerWins){ 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); +} + + +void printResult(int playerInput, int computerInput, int roundWinner, int playerWins, int computerWins){ + switch (playerInput){ + case ROCK: printf("So you chose rock.\n"); break; + case PAPER: printf("So you chose paper.\n"); break; + case SCISSORS: printf("So you chose scissors.\n"); break; + } + + switch (roundWinner) + { + case PLAYERWINSROUND: printf("Seems you win this round, I chose "); break; + case COMPUTERWINSROUND: printf("Too bad for you. I win this one, I chose "); break; + case NOWINNER: printf("Looks like it's a draw, I also chose "); break; + } + + switch (computerInput) + { + case ROCK: printf("rock.\n"); break; + case PAPER: printf("paper.\n"); break; + case SCISSORS: printf("scissors.\n"); break; + } + + printf("With this, you are at %d wins and I am at %d.\n", playerWins, computerWins); } \ No newline at end of file diff --git a/src/c/rockPaperScissors.h b/src/c/rockPaperScissors.h index 7d9c11f..ba5b38f 100644 --- a/src/c/rockPaperScissors.h +++ b/src/c/rockPaperScissors.h @@ -29,5 +29,6 @@ bool validatePlayerInput(int playerInput); int getPlayerInput(); int playRockPaperScissors(int rounds); void printPrompt(int roundsToWin); +void printResult(int playerInput, int computerInput, int roundWinner, int playerWins, int computerWins); #endif \ No newline at end of file