Sha256: 4b649267a45c09b94fc251bc2b32822df76a6b8c4a4d9979d524872888b5d1b2

Contents?: true

Size: 415 Bytes

Versions: 1

Compression:

Stored size: 415 Bytes

Contents

module Robot
  class Game
    attr_reader :input
    def initialize(input: $stdin)
      @input = input
    end

    def simulate
      while command = input.gets
        command = command.chomp

        @position = Robot::CommandProxy.new(command_string: command, position: @position).call
      end
    end

    def self.call(input: $stdin)
      game = new(input: input)
      game.simulate
    end
  end
end



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
robot_rea-0.1.4 lib/robot/game.rb