I'm making a text based adventure game. My code is as follows:

```
case move
when "go north"
puts "you hurl yourself at the now weakened door".
when "attack"
puts "You break the weakened door!"

```

I want `"attack"` to `puts` the broken door message only if the user types `"go north"` before that. If they type `"attack"` before `"go north"`, I want it to say something else. How can I get ruby to check if a specific command has been input into a case statement?

EDIT:

This is my updated code:

states = []

```
case move
when "help"
  help
when "quit"
  quit
when "inventory"
  @inventory
when "go north"
  puts "You hurl your shackled self toward the door. The chains cut into your wrists     and ankles, but you seem to be making progress."
  states << :north # add the state to the pile
  when 'attack chains'
     if states.include? :north # does our pile of state contains :in_north
      puts "You slam your shackled fists against the wall. You broke the chains!"
    else
      puts "You smash your shackled fists on the ground. Nothing happens."
    end
when "go south"
  puts "Your back shivers against the cold surface of the stone wall."
when "go east"
  puts "You tug to your right, but the chains hold fast."
when "go west"
  puts "You tug to your left, but the chains hold fast."

else
   puts "Unknown command."
end
end

```

This doesn't work, I don't think the state :north is being added.
Any ideas?