Skip to content

Conversation

@Emmakizil
Copy link

No description provided.

Copy link

@jbieniosek jbieniosek left a 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 *

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)

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!

Comment on lines +9 to +11
while len(hand_list) < 10:
random.shuffle(letter_pool_list)
hand_list.append(letter_pool_list.pop())

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)

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)

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]

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!

if high_word_length == 10 and word_length < high_word_length or word_length == high_word_length:
continue
elif word_length < high_word_length or word_length == 10:
highest_score_word = word

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants