Rock Paper Scissors is a guessing game played between two people, Player 1 (P1) and Player...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Rock Paper Scissors is a guessing game played between two people, Player 1 (P1) and Player 2 (P2). Each player has three buttons, namely rock, paper, and scissors. The player makes a choice among the three buttons and chooses one. The other player does the same with his set of buttons at the same time. Depending on the choices they make the game ends with one of the players winning or a tie. The Rules are as follows: P1 wins if 1. P1 chooses rock and P2 chooses scissors or 2. P1 chooses paper and P2 chooses rock or 3. P1 chooses scissors and P2 chooses paper. I P2 wins if 1. P1 chooses rock and P2 chooses paper or 2. P1 chooses paper and P2 chooses scissors or 3. P1 chooses scissors and P2 chooses rock. Every other case is a tie. Design a circuit that implements the game. Each player gets 3 switches. There are 2 outputs indicating which player has won; connect the outputs to green LEDs. If there is a tie, both green LEDS must be off. Also, if any player presses more than one switch, a red LED for that player has to turn on, indicating the cheating. Rock Paper Scissors is a guessing game played between two people, Player 1 (P1) and Player 2 (P2). Each player has three buttons, namely rock, paper, and scissors. The player makes a choice among the three buttons and chooses one. The other player does the same with his set of buttons at the same time. Depending on the choices they make the game ends with one of the players winning or a tie. The Rules are as follows: P1 wins if 1. P1 chooses rock and P2 chooses scissors or 2. P1 chooses paper and P2 chooses rock or 3. P1 chooses scissors and P2 chooses paper. I P2 wins if 1. P1 chooses rock and P2 chooses paper or 2. P1 chooses paper and P2 chooses scissors or 3. P1 chooses scissors and P2 chooses rock. Every other case is a tie. Design a circuit that implements the game. Each player gets 3 switches. There are 2 outputs indicating which player has won; connect the outputs to green LEDs. If there is a tie, both green LEDS must be off. Also, if any player presses more than one switch, a red LED for that player has to turn on, indicating the cheating.
Expert Answer:
Answer rating: 100% (QA)
C implementation of the above approach include using namespace std Function that returns 1 if first player wins 0 in case of a draw and 1 if second player wins int comparechar first char second If bot... View the full answer
Related Book For
Posted Date:
Students also viewed these mathematics questions
-
Some members of the city council in Washington, DC, recently proposed requiring every taxi to have a medallion, which is essentially a permit to drive a cab. Under the proposal, the number of...
-
What might happen if there was no requirement for probable cause?
-
The GDP Fund composed from the other three funds would have a weight in Utility Fund equal to (a) -2.2; (b) -3.2; or (c) .3. Orb Trust (Orb) has historically leaned toward a passive management style...
-
Fill in the blanks in the chart below: Year Years since 1960 1960 1965 1970 1975 1980 1985 1990 1995 1996 1997 1998 1999 2000 2001 2003 2005 2006 2007 2008 2009 2010 2011 0 5 [a] [b] [c] [d] [e] [f]...
-
Do you think that the doctrine of promissory estoppel serves a useful purpose? Would it not be easier if the law simply insisted that all contractual variations be supported by consideration?
-
Lorraine Newman, CPA, has developed considerable tax expertise in business acquisitions and is widely recognized in her geographic practice area as the go-to person for such transactions. She is...
-
Justify a corporations decision to split its stock when the stock price has risen significantly.
-
Owl-Eye Radiologists (OR) does various types of diagnostic imaging. Radiologists perform tests using sophisticated equipment. ORs management wants to compute the costs of performing tests for two...
-
Sintell has USD $16 million in excess cash that it has invested in China at an annual interest rate of 9%. The US interest rate is 2%. By how much would the Chinese yuan have to depreciate to cause...
-
Suppose the current USD/euro exchange rate is 1.2000 dollar per euro. The six month forward exchange rate is 1.1950. The six month USD interest rate is 1% per annum continuously compounded? Estimate...
-
In a conditional sales contract, a contract is a ________ if the seller allows the buyer to take possession of the goods before deciding whether to complete the contract by making the purchase....
-
Explain why and when dividends on non-cumulative preferred shares must be subtracted from earnings to compute basic EPS.
-
What is the difference between a dilutive security and an anti-dilutive security? Why is the distinction important in EPS considerations?
-
How is interest on the defined benefit obligation measured?
-
If common shares are issued during the year under a contract that involved meeting a contingent requirement, as of what date are the shares included in the weighted average ordinary share calculation?
-
List and define the five continuing components of pension expense.
-
The Walton Toy Company manufactures a line of dolls and a sewing kit. Demand for the company??s products is increasing, and management requests assistance from you in determining an economical sales...
-
Differentiate. y = ln(3x + 1) ln(5x + 1)
-
President Vladimir Putin of Russia proposed re-placing in- kind subsidies such as free public trans-portation and rent- free apartments for government workers with cash subsidies of between $ 20 and...
-
Athletes who win Olympic gold medals also receive a cash award of $ 25,000. In 2012, President Obama supported legislation proposed by Senator Marco Rubio to exempt these winnings from federal...
-
During the 2012 presidential campaign, President Barack Obama proposed lowering the corporate tax rate from 35 percent to 28 percent. Evaluate the effect of this proposal on efficiency, equity, and...
-
What is the key question that an auditor should ask according to the Panel on Audit Effectiveness?"
-
What change in auditing may have caused Enron, WorldCom, Xerox, and the other fraudulent situations?
-
What are some of the main points of SASNo. 99 ?
Study smarter with the SolutionInn App