Note that there are some explanatory texts on larger screens.

plurals
  1. PORock paper scissors scoring problems
    text
    copied!<p>Please can someone tell me how to do a basic scoring system to go into this code.</p> <pre><code>import random print 'Welcome to Rock, paper, scissors!' firstto=raw_input('How many points do you want to play before it ends? ') playerscore=+0 compscore=+0 while True: choice = raw_input ('Press R for rock, press P for paper or press S for scissors, CAPITALS!!! ') opponent = random.choice(['rock', 'paper' ,'scissors' ]) print 'Computer has chosen', opponent if choice == 'R' and opponent == "rock": print 'Tie' playerscore = playerscore+0 compscore = compscore+0 elif choice == 'P' and opponent == "paper": print 'Tie' playerscore = playerscore+0 compscore = compscore+0 elif choice == 'S' and opponent == "scissors": print 'Tie' playerscore = playerscore+0 compscore = compscore+0 elif choice == 'R' and opponent == "paper": print 'CPU Wins' playerscore = playerscore+0 compscore = compscore+1 elif choice == 'P' and opponent == "scissors": print 'CPU Wins' playerscore = playerscore+0 compscore = compscore+1 elif choice == 'S' and opponent == "rock": print 'CPU Wins' playerscore = playerscore+0 compscore = compscore+1 elif choice == 'P' and opponent == "rock": print 'You Win' playerscore = playerscore+1 compscore = compscore+0 elif choice == 'S' and opponent == "paper": print 'You Win' playerscore = playerscore+1 compscore = compscore+0 elif choice == 'R' and opponent == "scissors": print 'You Win' playerscore = playerscore+1 compscore = compscore+0 print 'Player score is',playerscore print 'Computer score is',compscore if playerscore == firstto: 'You won the game :)' exit() elif compscore == firstto: 'You lost the game :(' exit() </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload