
haveknife = false
haverope = false
haveaxe = false
useroped = false
bleeding = false


def begining1
  puts "------------"
  puts "You wake up in a field. You can see a river north to you, and a forest in the east, There are a couple objects around you."
  puts "HINT! you can walk by typing \"north\", \"south\", \"east\" and \"west\""
  puts "------------"
  c1b = gets.chomp()
  case c1b
  when "check objects"
    puts "there is a knife, some rope and a couple shards of glass"
    begining1
  when "take knife"
    haveknife = true
    puts "you took the knife"
    begining1
  when "take rope"
    haverope = true
    puts "you took the rope"
    begining1
  when "take shards"
    puts "the glass shards cut you. You can't take them. You are bleeding."
    bleeding = true
    begining1
  when "take glass"
    puts "the glass shards cut you. You can't take them. You are bleeding."
    bleeding = true
    begining1
  when "QUIT"
    quitter
  when "help"
    puts "commands:"
    puts "north"
    puts "south"
    puts "east"
    puts "west"
    puts "take"
    puts "talkto"
    puts "use"
    puts "help"
    puts "check"
    puts "QUIT"
    begining1
  when "north"
    north
  else
    puts "invalid command"
    begining1
  end
end
def north
  puts "------------" #twelwe dashes
  puts "up north is the river. across it is a tree and a house. the river is too wide to jump, you need a bridge."
  puts "------------"
  c2n = gets.chomp()
  case c2n
  when "use rope"
    useroped = true
    puts "you throw the rope onto the tree and you are able to climb it.you made it to the other side."
    north2
  when "use knife"
    if useroped == true
      puts "the rope is stuck, You can cross it, but not cut it."
    else
      puts "there is nothing to use it at."
      north
    end

  when "south"
    begining1
  when "east"
    northeast
  when "west"
    northwest
  when "north"
    if useroped == true
      puts "you cross the river thru the rope"
      north2
    else
      puts "there is no way to cross it right now."
      north
    end
  when "help"
    puts "commands:"
    puts "north"
    puts "south"
    puts "east"
    puts "west"
    puts "take"
    puts "talkto"
    puts "use"
    puts "help"
    puts "check"
    puts "QUIT"
    north
  else
    puts "invalid command"
    north
  end
end

def north2
  puts "------------"
  puts "you see a house. there lives an old man. near the house is a massive tree, a hundred meters high. next to the river is a \"normal\" tree, witch you attached your rope to."
  puts "------------"
  c2n2 = gets.chomp()
  case c2n2
  when "south"
    puts "you cross the river thru the rope"
    north
  when "talkto man"
    puts "you knock on the door.after a while, an old man walks out. He says to you:"
    puts "-A VISITOR! ugh, finnaly, after 40 years someone shows up. also, I am mr.minuter."
    puts "well hello. It looks like were stuck here together here. See, this place is surrounded by a forest so thick, you can't go in it. How did I get here? in a plane crash. it landed in the river. Only I survived."
    puts "Oh! and also, take this axe. it might help you."
    haveaxe = true
    if bleeding == true
      puts "-oh! It looks like you're bleeding! bring me some leaves and I wil heal you."
    end
  when "talkto old man"
    puts "you knock on the door.after a while, an old man walks out. He says to you:"
    puts "-A VISITOR! ugh, finnaly, after 40 years someone shows up. also, I am mr.minuter."
    puts "well hello. It looks like were stuck here together here. See, this place is surrounded by a forest so thick, you can't go in it. How did I get here? in a plane crash. it landed in the river. Only I survived."
    puts "Oh! and also, take this axe. it might help you."
    haveaxe = true
    if bleeding == true
      puts "-oh! It looks like you're bleeding! bring me some leaves and I wil heal you."
    end
  when "help"
    puts "commands:"
    puts "north"
    puts "south"
    puts "east"
    puts "west"
    puts "take"
    puts "talkto"
    puts "use"
    puts "help"
    puts "check"
    puts "QUIT"
  when "use axe"
    if haveaxe == true
      puts "You chop down the small tree. Now you have wood."
      wood = true
      if bleeding == true
        print "you also collect the leaves and the man heals you."
        bleeding = false
      end
    end


  end

end

def quitter
  puts "thanks for playing."
end

puts "NOTE: THE GAME IS UNFINISHED"
puts "hello! welcome to this text adventure"
puts "enter your name"
namme = gets.chomp()
puts ("hello, " + namme)
puts "type in \"START\" to start or \"QUIT\" to quit"
qors = gets.chomp()
if qors == 'START'
begining1
else
  quitter
end
