|
|
@ -1787,6 +1787,76 @@ void b_epic_game() { |
|
|
|
B_write_review(); |
|
|
|
} |
|
|
|
|
|
|
|
void v_play_rockpapersciss(){ |
|
|
|
int player_choice, computer_choice, player_score = 0, computer_score = 0; |
|
|
|
srand(time(NULL)); |
|
|
|
|
|
|
|
while (1) |
|
|
|
{ |
|
|
|
printf("Enter your choice:\n"); |
|
|
|
printf("1. Rock\n2. Paper\n3. Scissors\n"); |
|
|
|
printf("Your Choice:"); |
|
|
|
scanf("%d", &player_choice); |
|
|
|
computer_choice = (rand() % 3) + 1; |
|
|
|
if (player_choice == ROCK) |
|
|
|
{ |
|
|
|
if (computer_choice == ROCK) |
|
|
|
{ |
|
|
|
printf("Tie! Both picked Rock\n"); |
|
|
|
} |
|
|
|
else if (computer_choice == PAPER) |
|
|
|
{ |
|
|
|
printf("You lose! Computer picked Paper\n"); |
|
|
|
computer_score++; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
printf("You win! Computer picked Scissors\n"); |
|
|
|
player_score++; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (player_choice == PAPER) |
|
|
|
{ |
|
|
|
if (computer_choice == ROCK) |
|
|
|
{ |
|
|
|
printf("You win! Computer picked Rock\n"); |
|
|
|
player_score++; |
|
|
|
} |
|
|
|
else if (computer_choice == PAPER) |
|
|
|
{ |
|
|
|
printf("Tie! Both picked Paper\n"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
printf("You lose! Computer picked Scissors\n"); |
|
|
|
computer_score++; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (player_choice == SCISSORS) |
|
|
|
{ |
|
|
|
if (computer_choice == ROCK) |
|
|
|
{ |
|
|
|
printf("You lose! Computer picked Rock\n"); |
|
|
|
computer_score++; |
|
|
|
} |
|
|
|
else if (computer_choice == PAPER) |
|
|
|
{ |
|
|
|
printf("You win! Computer picked Paper\n"); |
|
|
|
player_score++; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
printf("Tie! Both picked Scissors\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
printf("Invalid choice!\n"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void feedbackForm(void){ |
|
|
@ -1881,7 +1951,8 @@ int main(int argc, char *argv[]) { |
|
|
|
printf("5. Guess the Word!\n"); |
|
|
|
printf("6. Smart Brain\n"); |
|
|
|
printf("7. Epic Game\n"); |
|
|
|
printf("8. Exit\n"); |
|
|
|
printf("8. Rock,Paper,Scissors!\n"); |
|
|
|
printf("9. Exit\n"); |
|
|
|
printf("Enter your choice: "); |
|
|
|
scanf("%d", &choice); |
|
|
|
v_progress_bar(argc,argv); |
|
|
@ -1916,6 +1987,10 @@ int main(int argc, char *argv[]) { |
|
|
|
jump_to_menu = 1; |
|
|
|
break; |
|
|
|
case 8: |
|
|
|
v_play_rockpapersciss(); |
|
|
|
jump_to_menu = 1; |
|
|
|
break; |
|
|
|
case 9: |
|
|
|
printf("\nThank you for trying our C code!\n"); |
|
|
|
break; |
|
|
|
default: |
|
|
|