Skip to content

Instantly share code, notes, and snippets.

@JamesZoft
Created March 28, 2012 14:40
Show Gist options
  • Save JamesZoft/2226717 to your computer and use it in GitHub Desktop.
Save JamesZoft/2226717 to your computer and use it in GitHub Desktop.
sokoban_extract
def play
puts "Welcome to Sokoban! The aim of the game is to put all of the crates, which are the \'" + @crate_id + "\' symbols onto the storage pallets, which are the \'" + @storage_id + "\' symbols! A list of all the symbols is available if you type \"help\", and the status of the game is available if you type \"status\"."
status()
loop do
input = gets.chomp()
pp input
case input.downcase!
when "help"
help()
when "move"
puts "Move where?"
input = gets.chomp()
@move_coords = @workman.move(input)
handle_move(@move_coords)
when "status"
status()
end
tick()
end
end
def help
puts "The symbols are as follows:"
pp symbols
end
def status
pp @playing_grid
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment