-
-
Save anonymous/8b021b09819cec84766e to your computer and use it in GitHub Desktop.
why isnt this working?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Menu | |
@@Choices = ["1 - New Game", "2 - Load Game", "3 - Options", "4 - Help"] | |
@@VirtualChoice = [1,2,3,4,5,6,7,8,9,10,11,12] | |
def main_menu() | |
puts "Devil Soldiers .Beta" | |
choice = get_input(@@Choices) | |
case choice | |
when 1 | |
new_game() #add this | |
when 2 | |
load_game() #add this | |
when 3 | |
options_menu() #add this | |
when 4 | |
help_menu() #add this | |
else | |
puts "Invalid Command." | |
choice = get_input(@@Choices) | |
end | |
end | |
def get_input(options = []) | |
puts "Choose one:" | |
options.each do |option| | |
puts "#{option}" | |
end | |
choice = gets.chomp | |
@@VirtualChoice.each do |option| | |
if choice == option | |
return choice | |
end | |
puts "Command not found..." | |
get_input(options) | |
end | |
end | |
end | |
def new_game() | |
puts "working" | |
end | |
inclue Menu | |
Menu.main_menu() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment