-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyrps.py
More file actions
62 lines (54 loc) · 2.18 KB
/
Copy pathpyrps.py
File metadata and controls
62 lines (54 loc) · 2.18 KB
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
56
57
58
59
60
61
62
import random
# or from random import randint
def rps():
print('Rock...')
print('Paper...')
print('Scissors...')
print('Choose rock, paper, or scissors to determine the fate of all human kind! Best of 3!')
count = 0
human_score = 0
computer_score = 0
while human_score < 2 and computer_score < 2:
midgame_scores = f"The score is humans: {human_score}, computers: {computer_score}"
player = input('Choose silly human!').lower()
rand_num = random.randint(0, 2)
human_victory_msg = 'You Won! Humans will remain free... for now...'
comp_victory_msg = 'I Won! MUAH. HA. HA. Bring me a byte to eat slave!'
count += 1
if rand_num == 0:
computer = 'rock'
elif rand_num == 1:
computer = 'paper'
else:
computer = 'scissors'
print(f"I choose {computer}")
if player == computer:
print("It's a draw! We will play this round again!")
count -= 0
elif player == 'rock':
if computer == 'scissors':
human_score += 1
print(f"The score is humans: {human_score}, computers: {computer_score}")
else:
computer_score += 1
print(f"The score is humans: {human_score}, computers: {computer_score}")
elif player == 'paper':
if computer == 'rock':
human_score += 1
print(f"The score is humans: {human_score}, computers: {computer_score}")
else:
computer_score += 1
print(f"The score is humans: {human_score}, computers: {computer_score}")
elif player == 'scissors':
if computer == 'rock':
computer_score += 1
print(f"The score is humans: {human_score}, computers: {computer_score}")
else:
human_score += 1
print(f"The score is humans: {human_score}, computers: {computer_score}")
else:
print('Quit stalling and make your choice!')
if computer_score == 2:
print(comp_victory_msg)
if human_score == 2:
print(human_victory_msg)