Skip to content

Instantly share code, notes, and snippets.

@max-giro
Created October 28, 2012 07:54
Show Gist options
  • Select an option

  • Save max-giro/3968006 to your computer and use it in GitHub Desktop.

Select an option

Save max-giro/3968006 to your computer and use it in GitHub Desktop.
Function call: playHand({'a': 2, 'p': 1, 'r': 1, 'e': 2, 't': 1}, '<edX internal wordList>', 7)
Test 5: Full hand transcript - using all letters
Your output:
Current Hand: a a p r e e t
Enter word, or a "." to indicate that you are finished: pear
"pear" earned 24 points. Total: 24 points
Current Hand: a e t
Enter word, or a "." to indicate that you are finished: tea
"tea" earned 33 points. Total: 33 points
Run out of letters. Total score: 33 points.
None
Correct output:
Current Hand: a a p r e e t
Enter word, or a "." to indicate that you are finished: pear
"pear" earned 24 points. Total: 24 points
Current Hand: a e t
Enter word, or a "." to indicate that you are finished: tea
"tea" earned 9 points. Total: 33 points
Run out of letters. Total score: 33 points.
None
Function call: playHand({'a': 2, 'p': 2, 'r': 1, 'z': 1, 'e': 1}, '<edX internal wordList>', 7)
Test 6: Full hand transcript - can't use every letter
Your output:
Current Hand: a a p p r z e
Enter word, or a "." to indicate that you are finished: pear
"pear" earned 24 points. Total: 24 points
Current Hand: a p z
Enter word, or a "." to indicate that you are finished: za
"za" earned 46 points. Total: 46 points
Current Hand: p
Enter word, or a "." to indicate that you are finished: p
Invalid word, please try again.
Current Hand: p
Enter word, or a "." to indicate that you are finished: .
Goodbye! Total score: 46 points.
None
Correct output:
Current Hand: a a p p r z e
Enter word, or a "." to indicate that you are finished: pear
"pear" earned 24 points. Total: 24 points
Current Hand: a p z
Enter word, or a "." to indicate that you are finished: za
"za" earned 22 points. Total: 46 points
Current Hand: p
Enter word, or a "." to indicate that you are finished: p
Invalid word, please try again.
Current Hand: p
Enter word, or a "." to indicate that you are finished: .
Goodbye! Total score: 46 points.
None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment