Game played between two people

Assignment Help Basic Computer Science
Reference no: EM131716373

Rock-paper-scissors is a game played between two people, in which each player chooses rock, paper or scissors.  The player who chooses rock will beat another player who has chosen scissors ("rock crushes scissors") but will lose to one who has chosen paper ("paper covers rock").  A play of paper will lose to a play of scissors ("scissors cut paper"). If both players make the same choice, the game is tied. Write a Python program for two players to play a rock-paper-scissors game.  The program first asks player 1  to enter 'r' for rock, 'p' for paper or 's' for scissors.  Use an input validation loop to check player 1's choice immediately.  If player 1 has entered an invalid choice (i.e., choice that is not 'r', 'p' nor 's'), ask player 1 to re-enter his choice repeatedly until the choice entered is valid.  Do the same for player 2.  Then compare the chices entered by the two players and display the result of the game ("Player 1 wins", "Player 2 wins" or "Tie").

The following is an example:

Player 1 - Enter r for rock, p for paper, s for scissors: RInvalid inputPlayer 1 - Enter r for rock, p for paper, s for scissors: rPlayer 2 - Enter r for rock, p for paper, s for scissors: xInvalid inputPlayer 2 - Enter r for rock, p for paper, s for scissors: yInvalid inputPlayer 2 - Enter r for rock, p for paper, s for scissors: pPlayer 2 wins.

Reference no: EM131716373

Questions Cloud

Training needs assessment when there is performance gap : What are the consequences of not conducting a training needs assessment when there is a performance gap?
What academic most beneficial in your future career : what academic/research/theoretical concept do you think will be most beneficial in your future career
Discuss about the training objective : Develop an annotated bibliography to share with the advisors prior to the training that includes at least FOUR to FIVE sources.
Experienced and operational improvement plans : Describe any Financial concern your organization has experienced and the Operational improvement plans taken to correct?
Game played between two people : Rock-paper-scissors is a game played between two people, in which each player chooses rock, paper or scissors.
Explain porter generic strategies : Explain Porter’s generic strategies. Discuss whether generic strategies are true strategies in the way the textbook defines them.
Waterloo regional police services : Waterloo Regional Police Services: The CIMS Project
Discuss what types of extraordinary difficulties : Discuss what types of extraordinary difficulties could arise during construction that would justify a contractor’s charging more than the original bid.
Instead of having single source of parts : In Model 3-1, suppose that instead of having a single source of parts,

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd