Skip to content

Cedar - Citlalli Z#31

Open
MiffyBruna wants to merge 11 commits intoAda-C16:masterfrom
MiffyBruna:master
Open

Cedar - Citlalli Z#31
MiffyBruna wants to merge 11 commits intoAda-C16:masterfrom
MiffyBruna:master

Conversation

@MiffyBruna
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
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!

Comment thread README.md

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

Use `ls` to confil
Copy link
Copy Markdown
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

Comment thread adagrams/game.py
tup = ""

for letter, frequency in LETTER_POOL.items():
tup = tuple(letter*frequency)
Copy link
Copy Markdown
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)

Comment thread adagrams/game.py

def uses_available_letters(word, letter_bank):
pass
compare_letters = copy.deepcopy(letter_bank)
Copy link
Copy Markdown
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 thread adagrams/game.py
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
Copy Markdown
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 thread adagrams/game.py
Comment on lines +116 to +117
highest_score_word = ""
hst_score_and_word = ""
Copy link
Copy Markdown
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