Skip to content

Instantly share code, notes, and snippets.

@jsrn
Last active December 30, 2015 02:59
Show Gist options
  • Save jsrn/7766690 to your computer and use it in GitHub Desktop.
Save jsrn/7766690 to your computer and use it in GitHub Desktop.
Flowers in Ruby
class Flowers
require "core/player.rb"
def initialize
print_banner
set_up_game
enter_game_loop
end
def print_banner
puts ".----------------------------- FLOWERS -----------------------------."
puts "| A(n) ORG_NAME_HERE Adventure |"
puts "| dot|not ToxicVenom jsrn |"
puts "`-------------------------------------------------------------------'"
end
def handle_input(input)
puts input
end
def enter_game_loop
while 1 do
print "> "
input = gets.chomp
handle_input(input)
end
end
def set_up_game
@player = Player.new
@player.pick_name
end
# Create a new object from the class "Flowers" and store it in the variable
# "game"
game = Flowers.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment