Jul-04-2018, 09:53 PM
(This post was last modified: Jul-04-2018, 09:53 PM by gontajones.)
I tried to keep your logic.
# The idea is to have the player play against the computer without knowing the values of their choices # then to guess the high middle low choice import random d_moves = {} def alpha(**kwargs): if(d_moves): # Merge if d_moves already exists return {**d_moves, **kwargs} return kwargs #def bravo(*values): # bravo.values = values or bravo.values # return bravo.values #bravo.values =() d_moves = alpha(a=5, b=3, c=2) d_moves = alpha(d=2, e=5, f=3) def choice(): choice = "" while choice != "a" and choice != "b" and choice != "c": print("choose a, b or c") choice = input() # Get the int using a,b,c as key of the dict choice = d_moves[choice] return choice def check(choice): compmove = ('d', 'e', 'f') comp = random.choice(compmove) comp = d_moves[comp] if (choice) == (comp): print("draw") print(choice) print(comp) elif (choice) > (comp): print("player") print(choice) print(comp) elif (choice) < (comp): print("comp") print(choice) print(comp) def loop(): guesses = 0 while guesses < 6: move = choice() check(move) guesses = guesses + 1 loop()