ryanb / ruby-warrior

Game written in Ruby for learning Ruby.
MIT License
3.83k stars 838 forks source link

Checking the player's initial script changes, numerical inputs and created a function for reseting profiles #95

Open IoannisNik opened 7 years ago

IoannisNik commented 7 years ago

For the first case I added an if-case for whether the player has changed the template code in his profile's player.rb at all, before running the game, along with 2 seperate functions for compairing the template file with the player's file.

I also thought it to be a good idea to check in on the user's input when trying to access or reset a profile,or choose a difficulty level so, i added a loop on the choose method of the ui.rb file, asking for input again if the numerical input exceeds the number of options.

Additionally, I added a reset function with which the player can reset a profile he wants. I also added a -r option in the parse_options method for the user to choose which profile to reset.