nskins / goby

Command-line role-playing game framework
MIT License
122 stars 56 forks source link

Allow upcase'd input. #89

Closed penguinstyles closed 7 years ago

penguinstyles commented 7 years ago

Currently, when presented with a (y/n) question if you respond with Y or N, it will prevent the action from being carried out, either by returning an empty prompt or (in the case of Selia's house) slamming a door in your face (how rude). Simply converting all input to downcase resolves this small issue.

-- Example -- · ■ ■ · · · △ ■ ■ · □ □ ¶ ■ ■ · · · · ■ △ · · · ·

This is the dojo, where martial arts students come to hone their abilities.

enter

penguinstyles enters the Dojo...

Sensei: Ah, penguinstyles, so good to see you. Would you like to train today (y/n)?: Y

nskins commented 7 years ago

Hi @penguinstyles, thank you for checking out the project and for your contribution!

First, note that not all input should be made lowercase. For instance, the player's name might be NICK. Another case is when the expected input is an integer (no need to lowercase). The main problem, as you've mentioned, is with those (y/n) questions.

Actually, in the next few days I'd like to write up a design idea that could simplify and fix this problem for the future (basically to abstract everything in the player_input function). If you'd like, I could assign you to that issue. Let me know if you'd be willing to complete that task.