hryanjones / guess-my-word

A word guessing game, where you only know whether my word is before or after your guess. (An unofficial clone of the game previously available on simbase.org)
https://hryanjones.com/guess-my-word/
MIT License
64 stars 26 forks source link

Press up or down arrows to select previous/next word #25

Open CosmicBara opened 4 years ago

CosmicBara commented 4 years ago

Sometimes when guessing a word, I just want to make 1 letter adjustments to words I've already guessed. It would be nice if I could press up or down to select the previous closest or next closest word, respectively, and put that word in the input box.

Imagine the CMD prompt or Powershell or pretty much any terminal interface, and you've got the idea.

KTamas commented 4 years ago

This is not a dunk on you but that kind of feels like not within the spirit of the game?

CosmicBara commented 4 years ago

@KTamas Is it? I guess I'm just thinking of ways to improve the user experience. I found myself pressing up/down to select previous words almost naturally, so it felt like a good extension to the base game.

hryanjones commented 4 years ago

What do you think about this behavior: if there's common starting letters shared by the top and bottom words, then the input box will put those letters into the input, but selected. The idea is mainly to help folks who are a bit new to the game, but the selection would be so that if someone is typing quickly it would simply get replaced as they're typing.

For example let's say the word is before 'corn' and after 'cork', then 'cor' would show up as highlighted in the input box.

Also, I wouldn't be opposed to the up/down arrow idea, so if someone wanted to send a PR on that, that'd be cool.

CosmicBara commented 4 years ago

@hryanjones For your suggestion, I assume it would kick in once the word prior and after match at least 1 character, correct? So an example:

bad
_____ -> nothing would be input
dead
bad
b____ -> b matches both "bad" and "brain", so it gets auto-filled
brain
bad
ba____ -> ba now matches both words, so gets auto-filled
baron 

I like this idea, and it would definitely save some time!