class Robot::Game

Attributes

input[R]

Public Class Methods

call(input: $stdin) click to toggle source
# File lib/robot/game.rb, line 18
def self.call(input: $stdin)
  game = new(input: input)
  game.simulate
end
new(input: $stdin) click to toggle source
# File lib/robot/game.rb, line 7
def initialize(input: $stdin)
  @input = input
end

Public Instance Methods

simulate() click to toggle source
# File lib/robot/game.rb, line 11
def simulate
  while (command = input.gets)
    command = command.chomp
    @position = Robot::CommandProxy.new(command_string: command, position: @position).call
  end
end