Sha256: 4c31368336ef15ca013aa0c705aaffcc67df1a43f4b8097814fe033c1eca2010
Contents?: true
Size: 905 Bytes
Versions: 327
Compression:
Stored size: 905 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
327 entries across 327 versions & 1 rubygems