#include
#include
#include
int main(int argc, const char * argv[])
{
/*****************************
* rock paper scissors game *
*****************************/
int rock = 1;
int paper = 2;
int scissors = 3;
int computerSelection;
int upperLimit = 3;
int userInput;
printf("Enter 1 for rock, 2 for Paper, and 3 for scissors: ");
scanf("%d", &userInput);
srand(time(NULL));
computerSelection = rand() %upperLimit;
printf("computer selection is %d\n", computerSelection);
if (userInput < 1)
{
printf("Error, follow instructions");
}
else if(userInput == computerSelection)
{
printf("Its a tie!\n");
}
// I want the
else if (userInput == rock && computerSelection == paper)
{
printf("Paper covers rock!\n");
printf("You win!\n");
}
else if (userInput == paper && computerSelection == scissors)
{
printf("Scissors wins!");
}
else if (userInput == scissors && computerSelection == rock)
{
printf("Rock wins!");
}
return 0;
}