Skip to content

Multiple error messages shown for invalid word #5

@frolino

Description

@frolino

Since the played words are represented by a list, there are multiple error messages shown whenever a word that is a prefix of multiple played words is played.

For example, suppose the words PANGS and PANGRAM have been played. Then, suppose the next player plays the word PANG. In this case, two error messages that say, "That word can't be played," are shown - one for violating "PANGS", and the other for violating "PANGRAM". This gets worse if there's a lot of prefixes. For instances, suppose "HERONS", "HERON", "HERO", "HER", and "HE" have been played. If somebody tries to play "HE" again, there will be 5 error messages shown!

One way to fix this is by simply representing the played words as a prefix trie (or, by keeping track of whether a violation has already been reported)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions