Answered step by step
Verified Expert Solution
Question
1 Approved Answer
NOTE: All functions should be implemented in Haskell! Question 2: Rock-Paper-Scissors (20 points) In the game rock-paper-scissors, each player picks one of the three options.
NOTE: All functions should be implemented in Haskell!
Question 2: Rock-Paper-Scissors (20 points) In the game rock-paper-scissors, each player picks one of the three options. If one player chooses rock and the other paper, paper will win. If one chooses paper and the other scissors, scissors will win. If one chooses scissors, and the other rock, then rock will win. If both players pick the same option, it is a tie. 2.1 Create a data type that can be used for this game. [4 points] 22 Using the type from part (2.1), write the type description for a function, rps, that will take two players' moves and return either 1 if player 1 wins, 2 if player 2 wins, or 0 if it's a tie. [4 points]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started