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]...
-
The situation described in Exercise 43. Find the equilibrium concentration of salt in a lake in the above case. Describe the result in words by comparing the equilibrium salt level with the salt...
-
The method that determines whether two String objects are equivalent, regardless of case, is ____________. a. equalsIgnoreCase() b. toUpperCase() c. equalsNoCase() d. equals()
-
In addition to the size variables, we also have information on several binary variables. The variable URBAN is used to indicate the facility's location. It is one if the facility is located in an...
-
Elaine Jackson just had a visit from her cousin Phil. He wanted to apologize. Last year he had regaled her with stories about a small company he had discovered that had just invented a high-tech...
-
How do strategic planners integrate ethical considerations and sustainability imperatives into strategic planning processes, balancing short-term financial objectives with long-term societal and...
-
In the new system for Holiday Travel Vehicles, the system users follow a two-stage process to record complete information on all of the vehicles sold. When an RV or trailer first arrives at the...
-
Barriers to recruitment are evident for many protected characteristics. Describe recruitment barriers for one protected characteristic and show how this interacts with socio-economic status. Explain...
-
As of 2019, 19 countries in Europe had adopted the euro as their common currency. These countries are called the euro zone. According to an article in the Wall Street Journal, The European Unions...
-
German automobile manufacturer, Mercedes-Benz has repeatedly stated that it offers its customers a premium brand experience and doesnt just provide them with cars. Briefly explain what you can infer...
-
Explain each OOA analysis technique for identification of classes and objects in a problem domain.
-
During analysis, the _______ are examined to find the _______ that will provide functionality for the system. (a) classes and use cases (b) use cases and classes (c) state diagrams and classes (d)...
-
Describes how firms differentiate their products. Youve likely flown on an airliner and know that all airline seats are basically the same, particularly in coach. Think about what service an airline...
-
O. A seller wanted to net $20,000 on the sale of property. The seller had a first mortgage on the property of $61,800. The broker charged a 7% commission with the seller also having to pay $2,000 in...
-
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...
-
We studied coherent states, which we had identified as eigenstates of the lowering operator, \(\hat{a}\). A coherent state \(|\psiangle\) is defined by the eigenvalue...
-
In Example 6.1, we introduced the Hermitian number and phase operators \(\hat{N}\) and \(\hat{\Theta}\) constructed from the raising and lowering operators, \(\hat{a}^{\dagger}\) and \(\hat{a}\). In...
-
A simple model for radioactive decay of an unstable nuclear isotope is as follows.3 Consider the potential illustrated in Fig. 7.9, in which there is a hard, infinite barrier at the spatial origin, a...
Study smarter with the SolutionInn App