Skip to content

Conversation

MiffyBruna
Copy link

No description provided.

Copy link
Collaborator

@kaidamasaki kaidamasaki left a comment

Choose a reason for hiding this comment

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

Great job!

I left a few small comments but everything looks good!


Use `ls` to confirm there's a new project folder

Use `ls` to confil
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is why it's good to git diff before you commit things. :-P

tup = ""

for letter, frequency in LETTER_POOL.items():
tup = tuple(letter*frequency)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Style: spacing

Suggested change
tup = tuple(letter*frequency)
tup = tuple(letter * frequency)


def uses_available_letters(word, letter_bank):
pass
compare_letters = copy.deepcopy(letter_bank)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice use of deepcopy. 😃

Comment on lines +95 to +104
if word == "":
return 0
else:
for letter in word:
score_list.append(LETTER_VALUE[letter.upper()])
if len(score_list) >= 7:
score = (sum(score_list) + bonus)
else:
score = sum(score_list)
return score
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can simplify this by reordering things a little:

Suggested change
if word == "":
return 0
else:
for letter in word:
score_list.append(LETTER_VALUE[letter.upper()])
if len(score_list) >= 7:
score = (sum(score_list) + bonus)
else:
score = sum(score_list)
return score
score = 0
for letter in word:
score_list.append(LETTER_VALUE[letter.upper()])
if len(score_list) >= 7:
score = (sum(score_list) + bonus)
else:
score = sum(score_list)
return score

(This works because if the loop never runs score stays at 0.)

Comment on lines +116 to +117
highest_score_word = ""
hst_score_and_word = ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

I recommend initializing placeholders like this to None for clarity:

Suggested change
highest_score_word = ""
hst_score_and_word = ""
highest_score_word = None
hst_score_and_word = None

This was referenced Sep 30, 2021
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.

4 participants