Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* @Coding-Cuddles/kata-maintainers
/.github/CODEOWNERS @Coding-Cuddles/kata-maintainers
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
[![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Implement the Mars Rover exercises in Python with pytest. Setup is complete
when the starter test passes.

## Overview

This kata complements [Clean Code: Advanced TDD, Ep. 20](https://cleancoders.com/episode/clean-code-episode-20).
Expand All @@ -15,27 +18,27 @@ test-driven development.

As a NASA engineer, you are part of the team that explores Mars by sending
remotely controlled vehicles to the planet's surface. You need to develop a
control software that translates the commands sent from Earth to instructions
that the rover understands.
control system that translates commands sent from Earth into instructions that
the rover understands.

NASA engineers treat the surface of Mars as a square grid, with side length
being a power of two, e.g., 4x4, 8x8, 16x16, etc.
NASA engineers treat the surface of Mars as a square grid whose side length is
a power of two, e.g., 4x4, 8x8, 16x16, etc.

On the grid, the rover's location is defined by coordinates (x, y) and an
orientation represented by one of the four compass directions (N, S, W, or E).
Coordinates (0, 0) represent the bottom left corner of the grid.

Given an initial rover's location, NASA sends commands encoded as a sequence
Given a rover's initial location, NASA sends commands encoded as a sequence
(string) of characters with the following meaning:

- 'L' and 'R' turn the rover 90 degrees left or right, respectively;
- 'F' and 'B' move the rover forward or backward one grid point.

### Exercise 1

For *Opportunity*, the grid had the torus (or "donut") topology, where (think
games like Snake or Pacman) the rover vanishes on the top and reappears on the
bottom (and visa versa for left and right).
For *Opportunity*, the grid had a torus (or "donut") topology. As in games like
Snake or Pac-Man, the rover vanishes at the top and reappears at the bottom
(and vice versa for the left and right edges).

> [!NOTE]
> In a 4x4 grid, the following table shows the resulting position for a
Expand All @@ -52,19 +55,18 @@ Your task is to implement Opportunity's control software.
### Exercise 2

For *Curiosity*, NASA decided to improve the accuracy of their grid system by
using a Polar coordinate system. This interpretation of the grid system lends
using a polar coordinate system. This interpretation of the grid system lends
itself to the concept of latitude and longitude: the sphere is sliced into an
even number of latitudes (central lines) and longitudes (evenly spaced lines
from North to South pole). In this model, coordinates (x, y) become abstract
representations of longitudes and latitudes.
from the North Pole to the South Pole). In this model, coordinates (x, y)
become abstract representations of longitudes and latitudes.

While this model is closer to planets, it produces some significant edge cases
that complicate the control system. For example, the behavior is undefined at
the poles if we want the poles to be represented through the coordinates.
the poles if we want the poles to be represented by coordinates.

The chief engineer decided to constrain the solution to the following: the
poles are not "on the grid," so the rover moves "over" them but never rests
on them.
The chief engineer imposed the following constraint: the poles are not "on the
grid," so the rover moves "over" them but never rests on them.

> [!NOTE]
> In a 4x4 grid, the following table shows the resulting position for a
Expand Down