Class: Rubbot
- Inherits:
-
Object
- Object
- Rubbot
- Defined in:
- lib/rubbot.rb
Instance Method Summary collapse
-
#initialize(grid, options = {}) ⇒ Rubbot
constructor
A new instance of Rubbot.
- #start ⇒ Object
Constructor Details
Instance Method Details
#start ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rubbot.rb', line 18 def start while input = @stdin.gets begin cmd = Commands::parse(input) cmd.execute(@robot, output: @stdout) rescue Commands::NoCommandError, RobotInterface::Place::InvalidFormatError => e @stdout << "Invalid input: #{e.}\n" @stdout << RobotInterface::Help::print_help end end end |