Home › Coding › Below is an instruction that describes a task. Write a respo...
Below is an instruction that describes a task. Write a respo...
Coding · Gemini, GPT-5.6, Claude · Coding
55Quality
89%Useful
86Reliability
The prompt
Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Implement a decision-making algorithm for a rock-paper-scissors game using Python. ### Input: ### Output: # Rock, paper, scissors game! def play_game(player1, player2): # Define the winning rules rules = {'rock': 'scissors', 'scissors': 'paper', 'paper': 'rock'} if player1 == player2: return 'It is a draw!' elif rules[player1] == player2: return 'Player 1 wins!' elif rules[player2] == player1: return 'Player 2 wins!' # Get user input player1 = input('Player 1, make a choice: rock, paper, or scissors? ').lower() player2 = input('Player 2, make a choice: rock, paper, or scissors? ').lower() # Start the game and get the result result = play_game(player1, player2) print(result)