Skip to content

Snow Leopards - Irene Cho#75

Open
choirene wants to merge 9 commits intoAda-C18:masterfrom
choirene:master
Open

Snow Leopards - Irene Cho#75
choirene wants to merge 9 commits intoAda-C18:masterfrom
choirene:master

Conversation

@choirene
Copy link
Copy Markdown

No description provided.

Comment thread adagrams/game.py
letter_list = []
hand = []

for letter in LETTER_POOL.keys():
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In Python, looping over a dictionary this way uses its keys by default, so no need to call .keys(), you can just write

for letter in LETTER_POOL:

Comment thread adagrams/game.py
for num in range(LETTER_POOL[letter]):
letter_list.append(letter)

for draw in range(10):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job with this one! Since draw isn't being used, consider a while loop with a condition that looks at len(letter_list)

Comment thread adagrams/game.py
pass
try:
formatted_word = word.upper()
except AttributeError:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job handling a case where, I believe, the parameter word isn't a string! A guard clause would be my suggestion to validate that word is a string, rather than catching the exception

Comment thread adagrams/game.py
for letter in formatted_word:
score += SCORE_CHART[letter]

if len(word) >= 7:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice job with this function!

Comment thread adagrams/game.py
for letter in formatted_word:
score += SCORE_CHART[letter]

if len(word) >= 7:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Per the README, the 8 bonus points should be awarded when a word is 7, 8, 9, or 10 letters long so we'll also want to have a check that the length of the word is < 11.

Comment thread adagrams/game.py
for word in [first, second]:
if len(word) == 10:
return word
if len(first) < len(second):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job handling the tie cases!

@marciaga
Copy link
Copy Markdown

marciaga commented Oct 4, 2022

Nice job!

All your tests are passing and your code is laid out well overall.

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.

2 participants