Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Feel free to optimize or correct the code at the Facebook page, your name will be added to the code ;)
- //https://www.facebook.com/AminproPastebin
- #include <stdio.h>
- int main()
- {
- int user_choice1;
- int user_choice2;
- printf("Choose Rock(0), Paper(1), or Scissors(2)");
- printf("\nPlayer One's Choice: ");
- scanf("%d", &user_choice1);
- printf("\nPlayer Two's Choice: ");
- scanf("%d", &user_choice2);
- {
- if ((user_choice1==0)&&(user_choice2==0))
- {
- printf("\nYou Tied!");
- }
- else if ((user_choice1==0)&&(user_choice2==1))
- { printf("\nPlayer 2 Wins!");
- }
- else if ((user_choice1==0)&&(user_choice2==2))
- { printf("\nPlayer 1 Wins!");
- }
- else if((user_choice1==1)&&(user_choice2==0))
- { printf("\nPlayer 1 Wins!");
- }
- else if((user_choice1==1)&&(user_choice2==1))
- { printf("\nYou tied!");
- }
- else if((user_choice1==1)&&(user_choice2==2))
- { printf("\nPlayer 2 Wins!");
- }
- else if((user_choice1==2)&&(user_choice2==0))
- { printf("\nPlayer 2 Wins!");
- }
- else if((user_choice1==2)&&(user_choice2==1))
- { printf("\nPlayer 1 Wins!");
- }
- else if((user_choice1==2)&&(user_choice2==2))
- { printf("\nYou Tied");
- }
- else
- { printf("You have select an invalid selection.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement