hi im programming my first game and but a good dent into it however i got stuck. what im trying to do is an option to play again. if the user decides to play again then i want the options to execute again and if the user choses not to play again then i want the game to show the scores. does anyone know how to do that?
here is what i have so far:
Code:
// Purpose: Play the Rock-Paper-Scissors-Lizard-Spock Game
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
int player_One_Choice, player_Two_Choice,ready,retry;
printf ("Are YOU ready to play Rock-Paper-Scissors-Lizard-Spock? \n");
printf ("0 for NO \n1 for YES ");
scanf ("%d", &ready);
printf ("Player One!! ENTER YOUR CHOICE \n1 = Rock \n2 = Paper \n3 = Scissors \n4 = Lizard \n5 = Spock \n");
scanf ( "%d", &player_One_Choice);
printf ("Player Two!! ENTER YOUR CHOICE \n1 = Rock \n2 = Paper \n3 = Scissors \n4 = Lizard \n5 = Spock \n");
scanf ( "%d", &player_Two_Choice);
if (player_One_Choice == 1 && player_Two_Choice == 1 || player_One_Choice == 2 && player_Two_Choice == 2 || player_One_Choice == 3 && player_Two_Choice == 3 || player_One_Choice == 4 && player_Two_Choice == 4 || player_One_Choice == 5 && player_Two_Choice == 5){
printf("\nPlayer 1 selected: %d\n", player_One_Choice);
printf("\nPlayer 2 selected: %d\n", player_Two_Choice);
printf("\nYou tied, we cant end things like this, TRY AGAIN!!!???\n0 for NO \n1 for YES \n");
}
if (player_One_Choice == 1 && player_Two_Choice == 4 || player_One_Choice == 1 && player_Two_Choice == 3 || player_One_Choice == 2 && player_Two_Choice == 1 || player_One_Choice == 2 && player_Two_Choice == 5 || player_One_Choice == 3 && player_Two_Choice == 2 ||
player_One_Choice == 3 && player_Two_Choice == 4 || player_One_Choice == 4 && player_Two_Choice == 5 || player_One_Choice == 4 && player_Two_Choice == 2 || player_One_Choice == 5 && player_Two_Choice == 3 || player_One_Choice == 5 && player_Two_Choice == 1){
printf("\nPlayer 1 selected: %d\n", player_One_Choice);
printf("\nPlayer 2 selected: %d\n", player_Two_Choice);
printf("\nPlayer 1, victory!, TRY AGAIN???\n0 for NO \n1 for YES \n");
}
if (player_One_Choice == 4 && player_Two_Choice == 1 || player_One_Choice == 3 && player_Two_Choice == 1 || player_One_Choice == 1 && player_Two_Choice == 2 || player_One_Choice == 5 && player_Two_Choice == 2 || player_One_Choice == 2 && player_Two_Choice == 3 ||
player_One_Choice == 4 && player_Two_Choice == 3 || player_One_Choice == 5 && player_Two_Choice == 4 || player_One_Choice == 2 && player_Two_Choice == 4 || player_One_Choice == 3 && player_Two_Choice == 5 || player_One_Choice == 1 && player_Two_Choice == 5){
printf("\nPlayer 1 selected: %d\n", player_One_Choice);
printf("\nPlayer 2 selected: %d\n", player_Two_Choice);
printf("\nPlayer 2, victory!, TRY AGAIN???\n 0 for NO \n1 for YES \n");
}
scanf ( "%d", &retry);
return 0;
}