MarsExplorer.Probe (SWAP - Mars Explorer v0.1.0) View Source
Module responsible for executing probe actions
Link to this section Summary
Link to this section Types
Specs
Link to this section Functions
Specs
Moves the probe forward
Examples
iex> alias MarsExplorer.Probe
MarsExplorer.Probe
iex> probe = %Probe{north: 0, direction: :north}
%Probe{north: 0, direction: :north}
iex> probe |> Probe.move
%Probe{north: 1}
iex> probe |> Probe.move |> Probe.move
%Probe{north: 2}
Turns the probe left
Examples
iex> alias MarsExplorer.Probe
MarsExplorer.Probe
iex> probe = %Probe{direction: :north}
%Probe{direction: :north}
iex> probe |> Probe.turn_left
%Probe{direction: :west}
Turns the probe right
Examples
iex> alias MarsExplorer.Probe
MarsExplorer.Probe
iex> probe = %Probe{direction: :north}
%Probe{direction: :north}
iex> probe |> Probe.turn_right
%Probe{direction: :east}