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

Random guess button #70

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

Random guess button #70

wants to merge 4 commits into from

Conversation

Oreolek
Copy link

@Oreolek Oreolek commented Jan 28, 2022

Press the button to make a totally random guess!
(Not dictionary-based, sadly - performance problems. Dictionary is too big to filter for a specific word length.)

not dictionary-based, sadly - performance problems
Copy link

@SystemDisc SystemDisc left a comment

Choose a reason for hiding this comment

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

Final comment: Won't this just populate the line with pseudo-random characters? I think it would be more useful to populate the line with a random word from the wordlist - perhaps only enabled in settings as a handicap option.

src/RandomGuess.tsx Outdated Show resolved Hide resolved
src/RandomGuess.tsx Outdated Show resolved Hide resolved
@Oreolek
Copy link
Author

Oreolek commented Jan 31, 2022

Yeah it's more of a discussion than a feature. Dictionary is a performance problem.

hello-wordl's dictionary has to support all guesses from 4 to 11 letters long. The chance to get a word of a specific length in 100 random draws is not guaranteed. Filtering the whole array takes too long. So we'll have to optimize the whole dictionary format just to draw something better than a pile of letters.

@SystemDisc
Copy link

Why not just call randomTarget(currentWordLength) to get an acceptable random word?

@SystemDisc
Copy link

This is what I mean: https://github.com/Oreolek/hello-wordl/pull/1/files

use onKey and randomTarget for random word
@Oreolek
Copy link
Author

Oreolek commented Feb 1, 2022

Thank you, that's brilliant!

@SystemDisc
Copy link

Love this feature! @lynn perhaps you could make this toggle-able under settings if you don't want it available by default?

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