the-abe-train / globle

Use your geography knowledge to figure out the mystery country in as few guesses as possbile!
https://globle-game.com
Other
185 stars 78 forks source link

fix(guesser): remove extra spaces between words in guessed name #123

Closed owenstone closed 7 months ago

owenstone commented 2 years ago

This replaces extra spaces in guessed name with only one space to aid matching.

The reason I chose to put this together in the same line with .trim() was because they both remove extra spaces, unlike the last lines that do domain-specific replacements.

Fixes: #122

the-abe-train commented 2 years ago

How often do you think this issue happens? I worry about slowing down the guessing feature with unnecessary features, but if it's a real issue I'll merge it.

owenstone commented 2 years ago

This addition is a common/standard companion to the trim operation. I don't think it will slow things down noticebly, as long as it isn't happening inside of a loop. I can look into it to try to quantify it, though.

Anecdotally, this has happened to me more than once. (I'm guessing that I'm physically jittering on the spacebar or going back to correct my spelling, and it could be more of an issue on mobile.) It can be hard to see why the guess isn't accepted, and if I'm not sure of that answer, I might assume it's totally wrong and not guess that one again.

Thanks for the feedback!