Created
April 19, 2019 14:56
-
-
Save XayOn/ef1de3c4ba3acefd111e0b828b0f13a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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