Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbigailGoodmanC19ATLAdagrams #129

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

AbigailGoodmanC19ATLAdagrams #129

wants to merge 4 commits into from

Conversation

argoodm
Copy link

@argoodm argoodm commented Mar 29, 2023

No description provided.

Comment on lines +52 to +54



Choose a reason for hiding this comment

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

It’s good practice to avoid committing extra or white space when submitting a PR.

Comment on lines +6 to +33
LETTER_POOL = {
'A': 9,
'B': 2,
'C': 2,
'D': 4,
'E': 12,
'F': 2,
'G': 3,
'H': 2,
'I': 9,
'J': 1,
'K': 1,
'L': 4,
'M': 2,
'N': 6,
'O': 8,
'P': 2,
'Q': 1,
'R': 6,
'S': 4,
'T': 6,
'U': 4,
'V': 2,
'W': 2,
'X': 1,
'Y': 2,
'Z': 1
}

Choose a reason for hiding this comment

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

Hi Abby! Great job completing Adagrams! Congrats on your first project at Ada 🎉 Excellent choice with this data structure 💯

letter_list = []
for letter in LETTER_POOL.keys():
letter_list += LETTER_POOL[letter] * letter
# print(letter_list)

Choose a reason for hiding this comment

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

It’s good practice to avoid committing commented out code when submitting a PR.

Choose a reason for hiding this comment

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

A better place for this code would be inside the draw_letters() function since we're only using the letter_list in this function. It should live there 👍🏾

Comment on lines +57 to +58
# letter_bank = str(input("please input an anagram "))
# while type(word) == str:

Choose a reason for hiding this comment

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

Be sure to avoid committing commented out code when submitting a PR.

Comment on lines 56 to +68
def uses_available_letters(word, letter_bank):
pass
# letter_bank = str(input("please input an anagram "))
# while type(word) == str:
list_copy = copy.deepcopy(letter_bank)

for character in word.upper():
if character in list_copy:
list_copy.remove(character)
else:
return False


return True

Choose a reason for hiding this comment

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

👍🏾

Comment on lines +72 to +73
word_score = 0
scores = {"A" : 1, "E": 1, "I": 1, "O": 1, "U": 1 ,"L": 1, "N": 1, "R": 1, "S": 1, "T": 1, "D": 2, "G": 2,"B": 3, "C": 3, "M": 3, "P": 3, "F": 4, "H": 4, "V": 4, "W": 4, "Y": 4,"K": 5, "J": 8, "X":8 ,"Q": 10, "Z": 10}

Choose a reason for hiding this comment

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

This is an optimal data structure for the letter scores, outstanding 💫

Comment on lines +77 to +78
if len(word) >= 7:
word_score += 8

Choose a reason for hiding this comment

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

Nice job with the scoring logic 🎉 We can also combine conditionals in one by checking if the length of the word is greater than 6 and less than 11. Refer to your readme for more on this

Comment on lines +81 to +84




Choose a reason for hiding this comment

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

It’s good practice to avoid committing extra or white space when submitting a PR.

adagrams/game.py Outdated
Comment on lines 85 to 106
def get_highest_word_score(word_list):
pass No newline at end of file
winning_word = ''

highest_score = 0
for word in word_list:
word_score = score_word(word)
if word_score > highest_score: # if word_score is greater than the highest score

highest_score = word_score
winning_word = word # winning words now contains the winning word
elif word_score == highest_score: # and if word_score is equal to the highest word
if len(winning_word) == 10:
pass
elif len(word) < len(winning_word) and len(winning_word) != 10: # nested conditional, if the length of the word is greater than the chosen word
winning_word = word
elif len(word) == 10 and len(winning_word) != 10:
winning_word = word



return winning_word, highest_score

Choose a reason for hiding this comment

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

Nice job translating the highest scoring word logic! Awesome job using swapping to grab the highest score and word! 😁 your comprehension of flow control is stellar & you seem to have put everything from the learn lessons together quite nicely!

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