-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cheetahs - Emma and Alyssa #70
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on this project Emma and Alyssa! The code is very clean and easy to read. This project is green.
@@ -1,11 +1,51 @@ | |||
import random | |||
from adagrams.const_dicts import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
pass | ||
letter_pool_list = [] | ||
for letter, number in LETTER_POOL.items(): | ||
letter_pool_list.extend([letter]*number) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great way to handle the distribution!
while len(hand_list) < 10: | ||
random.shuffle(letter_pool_list) | ||
hand_list.append(letter_pool_list.pop()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well to generate a list of 10 random letters, but it's doing a lot of extra work. random.shuffle
will randomize the list, and once it's randomized, selecting the first 10 letters will give you a random hand of letters. Reshuffling between each selection isn't necessary.
pass | ||
word = word.upper() | ||
new_letter_bank = [] | ||
new_letter_bank.extend(letter_bank) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
new_letter_bank.extend(letter_bank) | ||
for letter in word: | ||
if letter in new_letter_bank: | ||
new_letter_bank.remove(letter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clean solution!
if len(word) >= 7: | ||
sum += 8 | ||
for letter in word: | ||
sum += SCORE_CHART_DICT[letter] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great SCORE_CHART_DICT
design!
continue | ||
elif word_length < high_word_length or word_length == 10: | ||
highest_score_word = word |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic solution!
No description provided.