Sha256: 814793562350c748ec2369f0bfa8f066358fead9c14ba0e93077bb606f763a00

Contents?: true

Size: 900 Bytes

Versions: 69

Compression:

Stored size: 900 Bytes

Contents

defmodule RobotSimulator do
  @doc """
  Create a Robot Simulator given an initial direction and position.

  Valid directions are: `:north`, `:east`, `:south`, `:west`
  """
  @spec create(direction :: atom, position :: {integer, integer}) :: any
  def create(direction \\ nil, position \\ nil) do
  end

  @doc """
  Simulate the robot's movement given a string of instructions.

  Valid instructions are: "R" (turn right), "L", (turn left), and "A" (advance)
  """
  @spec simulate(robot :: any, instructions :: String.t()) :: any
  def simulate(robot, instructions) do
  end

  @doc """
  Return the robot's direction.

  Valid directions are: `:north`, `:east`, `:south`, `:west`
  """
  @spec direction(robot :: any) :: atom
  def direction(robot) do
  end

  @doc """
  Return the robot's position.
  """
  @spec position(robot :: any) :: {integer, integer}
  def position(robot) do
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.179 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.178 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.177 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.176 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.175 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.174 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.173 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.172 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.171 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.170 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.169 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.167 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.166 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.165 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.164 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.163 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.162 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.161 tracks/elixir/exercises/robot-simulator/robot_simulator.exs
trackler-2.2.1.160 tracks/elixir/exercises/robot-simulator/robot_simulator.exs