Skip to content

The mars rover kata, docker container with minimal php setup

License

Notifications You must be signed in to change notification settings

istepaniuk/mars-rover-php-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mars Rover Kata

Source: Widespread kata, generally attributed to the Dallas Hack Club.

drawing

Requirements

  • A POSIX shell (Linux, OSX, WSL)
  • Docker

Setup

  • Clone this repository and run ./setup.sh in it. You only need to do this once.
  • Running ./run-tests.sh will run the tests in the 'tests' folder.
  • Add your tests in tests/MarsRoverTests.php
  • Make the tests pass by editing src/MarsRover.php
  • Refactor, rinse and repeat.

Your Task

You’re part of the team that explores Mars by sending remotely controlled vehicles to the surface of the planet. Develop an API that translates the commands sent from earth to instructions that are understood by the rover.

Description

  • You are given the initial starting point (x,y) of a rover and the initial direction (N,S,E,W) it is facing, also called bearing.
  • The rover receives a character array of commands.
  • The commands are used to move forward and backward (F,B) and to turn left or right by 90 degrees (L, R).
  • The coordinate system is such that the grid wraps around its edges. (planets are spheres after all)
  • Given a list of coordinates that represent obstacles, the rover must stop at the last possible position and report the obstacle.

Rules

  • TDD as if you mean it. No Excuses!

About

The mars rover kata, docker container with minimal php setup

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published