Skip to content

Cheetahs - Emma and Alyssa#70

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

Cheetahs - Emma and Alyssa#70
Emmakizil wants to merge 9 commits intoAda-C18:masterfrom
Emmakizil:master

Conversation

@Emmakizil
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@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.

Comment thread adagrams/game.py
@@ -1,11 +1,51 @@
import random
from adagrams.const_dicts import *
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great!

Comment thread adagrams/game.py
pass
letter_pool_list = []
for letter, number in LETTER_POOL.items():
letter_pool_list.extend([letter]*number)
Copy link
Copy Markdown

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 thread adagrams/game.py
Comment on lines +9 to +11
while len(hand_list) < 10:
random.shuffle(letter_pool_list)
hand_list.append(letter_pool_list.pop())
Copy link
Copy Markdown

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.

Comment thread adagrams/game.py
pass
word = word.upper()
new_letter_bank = []
new_letter_bank.extend(letter_bank)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread adagrams/game.py
new_letter_bank.extend(letter_bank)
for letter in word:
if letter in new_letter_bank:
new_letter_bank.remove(letter)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Very clean solution!

Comment thread adagrams/game.py
if len(word) >= 7:
sum += 8
for letter in word:
sum += SCORE_CHART_DICT[letter]
Copy link
Copy Markdown

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!

Comment thread adagrams/game.py
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
Copy link
Copy Markdown

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