Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 23 lines (16 sloc) 0.685 kb
#!/usr/bin/ruby
require File.expand_path("../init.rb", __FILE__)
fi = File.open(InputFile)
fo = File.open(OutputFile, "w")
first_line = fi.readline #
plateau = Plateau.new(first_line) # Initialize plateau object
while !fi.eof?
initial_position = fi.readline
instructions = fi.readline
# Initialize the rover with the -
rover = Rover.new(initial_position, plateau) # - initial poistion on the plateau
rover.explore(instructions) # Ask it to explore according to the instructions
fo.write "#{rover.position_and_direction}\n"
end
fo.close
fi.close
Jump to Line
Something went wrong with that request. Please try again.