Created
November 17, 2010 00:26
-
-
Save kjellski/702785 to your computer and use it in GitHub Desktop.
This file contains 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
def getClues(guess, secretNum): | |
# Returns a string with the pico, fermi, bagels clues to the user. | |
if guess == secretNum: | |
return 'You got it!' | |
clue = [] | |
for i in range(len(guess)): | |
if guess[i] == secretNum[i]: | |
clue.append('Fermi') | |
elif guess[i] in secretNum: | |
clue.append('Pico') | |
if len(clue) == 0: | |
return 'Bagels' | |
clue.sort() | |
return ' '.join(clue) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment