Skip to content

Instantly share code, notes, and snippets.

/text.rb Secret

Created October 26, 2015 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8b021b09819cec84766e to your computer and use it in GitHub Desktop.
Save anonymous/8b021b09819cec84766e to your computer and use it in GitHub Desktop.
why isnt this working?
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