INPUT THIS INTO RAPTOR FOR ME WITH SCREENSHOT OF PROGRAM START FUNCTION get_user_choice(): WHILE True DO PRINT "Enter your choice: (R)ock, (P)aper, or (S)cissors" user_choice = INPUT().lower() IF user_choice in ['r', 'p', 's'] THEN RETURN user_choice ELSE PRINT "Invalid input! Please enter R, P, or S." FUNCTION get_computer_choice(): choices = ['r', 'p', 's'] RETURN RANDOM.choice(choices) FUNCTION determine_winner(user, computer): IF user == computer THEN RETURN "It's a tie!" ELSE IF (user == 'r' and computer == 's') OR (user == 's' and computer == 'p') OR (user == 'p' and computer == 'r') THEN RETURN "You win!" ELSE RETURN "Computer wins!" FUNCTION play_game(): WHILE True DO user_choice = get_user_choice() computer_choice = get_computer_choice() PRINT "You chose:", user_choice PRINT "Computer chose:", computer_choice result = determine_winner(user_choice, computer_choice) PRINT result PRINT "Do you want to play again? (y/n):" play_again = INPUT().lower() IF play_again != 'y' THEN PRINT "Thanks for playing!" BREAK CALL play_game() END
INPUT THIS INTO RAPTOR FOR ME WITH SCREENSHOT OF PROGRAM
START
FUNCTION get_user_choice():
WHILE True DO
PRINT "Enter your choice: (R)ock, (P)aper, or (S)cissors"
user_choice = INPUT().lower()
IF user_choice in ['r', 'p', 's'] THEN
RETURN user_choice
ELSE
PRINT "Invalid input! Please enter R, P, or S."
FUNCTION get_computer_choice():
choices = ['r', 'p', 's']
RETURN RANDOM.choice(choices)
FUNCTION determine_winner(user, computer):
IF user == computer THEN
RETURN "It's a tie!"
ELSE IF (user == 'r' and computer == 's') OR (user == 's' and computer == 'p') OR (user == 'p' and computer == 'r') THEN
RETURN "You win!"
ELSE
RETURN "Computer wins!"
FUNCTION play_game():
WHILE True DO
user_choice = get_user_choice()
computer_choice = get_computer_choice()
PRINT "You chose:", user_choice
PRINT "Computer chose:", computer_choice
result = determine_winner(user_choice, computer_choice)
PRINT result
PRINT "Do you want to play again? (y/n):"
play_again = INPUT().lower()
IF play_again != 'y' THEN
PRINT "Thanks for playing!"
BREAK
CALL play_game()
END
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)