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

Pine C16 Eunice & Lilly #30

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Conversation

eunicegore
Copy link

No description provided.

Copy link
Collaborator

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Nice work. All the functions worked and, you hit the learning goals here. I had a few comments to make the code a bit more streamlined, but it all works. Well done.

@@ -1,11 +1,93 @@
import random
def draw_letters():
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍
Nice work!

tile_bag.remove(letter)

return tile_list


def uses_available_letters(word, 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 work, this is a clever way to solve this.

Comment on lines +35 to +41
value1=["A","E","I","O","U","L","N", "R", "S", "T"]
value_2=["D", "G"]
value_3=["B", "C", "M", "P"]
value_4=["F", "H", "V", "W", "Y"]
value_5=["K"]
value_8=["J", "X"]
value_10=["Q", "Z"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This works, but It involves a lot of hardcoded if statements. This could also be solved with a dictionary, using either a set of letters as values and scores as values, or individual letters as keys and points as values.

For example

    letter_scores = {
        {"A","E","I","O","U","L","N", "R", "S", "T"}:  1,
        {"D", "G"}: 2,
        ...

Or:

    letter_scores = {
        'A': 1,
        'B': 3,
        'C': 3,
        ...

Then you can solve the problem with a more compact loop.

total+=10
if len(modified_word)>=7:
total+=8
return(total)

def get_highest_word_score(word_list):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Clever use of max and min to determine the winner.

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