repl.it
@JOHNATHANSMITH2/

Rock paper scissors

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import random
ScoreAi = 0
ScorePlayer = 0
while True:
  print('Hi player one, You can either be')
  print('1) Rock')
  print('2) Paper')
  print('3) Scissors')
  PlayerOne = int(input('Pick 1, 2, or 3. \n'))
  Computer = random.randint(1,3)
  print('The Computer chose ' + str(Computer))
  if PlayerOne == Computer:
    print('It is a tie!')
    ScoreAi = ScoreAi + 1
    ScorePlayer = ScorePlayer + 1
  elif PlayerOne == 1 and Computer == 2:
    print(' Computers Paper beats your rock! You lose! ')
    ScoreAi = ScoreAi + 1
  elif PlayerOne == 1 and Computer == 3:
    print('Your Rock beats Computers scissors! You win!')
    ScorePlayer = ScorePlayer + 1
  elif PlayerOne == 2 and Computer == 3:
    print('Computers Scissors beats your paper! You Lose!')
    ScoreAi = ScoreAi + 1
  elif PlayerOne == 2 and Computer == 1:
    print('Your Paper beats Computers rock! You Win!')
    ScorePlayer = ScorePlayer + 1
  elif PlayerOne == 3 and Computer == 2:
    print('Your Scissors beats Computers paper! You Win!')
    ScorePlayer = ScorePlayer + 1
  elif PlayerOne == 3 and Computer == 1:
    print('Computers Rock beats your paper! You Lose!')
    ScoreAi = ScoreAi + 1
  print('Do you want to keep playing?')
  print('1) Yes')
  print('2) No')
  Choice = input('Choose 1 or 2.\n')

  if Choice == '2':
    print('You won ' + str(ScorePlayer) + ' games and the computer won ' + str(ScoreAi) + ' games.')
    if ScorePlayer > ScoreAi:
      print('Congratulations! You win!')
    elif ScorePlayer < ScoreAi:
      print('The computer won most of the games. You lose!')
    else:
      print('Tie!')
    print('Thank you for playing!')
    break






Fetching token
?