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]...
-
Using EES (or other) software, study the effect of variable specific heats on the thermal efficiency of the ideal Otto cycle using air as the working fluid. At the beginning of the compression...
-
What is the main function of a dispatcher? Give some examples of events when it is invoked.
-
Find the z-score that corresponds to each percentile. 1. P 5 2. P 50 3. P 90
-
1. What forms of interpersonal power does Larry Ellison use and how does he use them? 2. How do the two faces of power relate to Larry Ellisons actions? 3. Does Larry Ellison use power ethically?...
-
If the two lines intersect, then k= x-1 y-67=2+2 3 2 x=Y+1 -z+k 2
-
Combustion in a diesel engine may be modeled as a constant-pressure heat addition process with air in the cylinder before and after combustion. Consider a diesel engine with cylinder conditions of...
-
Which is the correct order of events? Hamilton submits financial plan, Adams elected, Whiskey Rebellion, Alien and Sedition Acts. Whiskey Rebellion, Adams elected, Alien and Sedition Acts, Hamilton...
-
What is the difference between hearing and listening, and why does it matter?
-
Identify the six stages of the job interview process.
-
It is _____________ for an interviewer to ask an interviewee questions relating to race, color, religion, sex, national origin, disability, or age.
-
Identify the four facial management techniques that determine the appropriate facial response for a given situation.
-
Define verbal and nonverbal communication.
-
In order to buy a house, Ryan Anderson is going to borrow $180,000 today with a 4.25 percent nominal annual rate of interest. He is going to make monthly payments over 20 years. Assume full...
-
Determine the values of the given trigonometric functions directly on a calculator. The angles are approximate. tan 0.8035
-
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...
-
Companies are facing a great amount of change in every facet of their operations today. To remain competitive, companies must keep abreast of current developments in several areas. You recently got...
-
For each of the situations listed, identify the primary standard from the IMA Statement of Ethical Professional Practice that is violated (competence, confidentiality, integrity, or credibility.)...
-
Sustainability involves more than just the impact of actions on the environment. The triple bottom line recognizes that a company has to measure its impact on its triple bottom line for its long-term...
Study smarter with the SolutionInn App