Skip to content

Instantly share code, notes, and snippets.

@XayOn
Created April 19, 2019 14:56
Show Gist options
  • Save XayOn/ef1de3c4ba3acefd111e0b828b0f13a1 to your computer and use it in GitHub Desktop.
Save XayOn/ef1de3c4ba3acefd111e0b828b0f13a1 to your computer and use it in GitHub Desktop.
"""RPS"""
def play():
scores = {"user": 0, "computer": 0}
while not any(a==WIN for a in scores.values):
print(f'Scores: U:{scores["user"]}. C: {scores["computer"]}')
user = None
comp = random.choice(CHOICES.keys())
while user not in CHOICES.keys():
user = raw_input("rock, paper, scissors")
if user == comp:
print("draw")
continue
scores['user'] += int(CHOICES.get(user) == comp)
scores['comp'] += int(CHOICES.get(comp) == user)
if __name__ == "__main__":
play()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment