Code Monkey home page Code Monkey logo

rover's Introduction

Mars Rover Code Challenge

Installation

To install and run the rover, simply clone the repository

git clone https://github.com/FRTNX/Rover

then

cd Rover

python3 rover.py

So Whats Going On?

The code simulates the movements of a rover over a grid with defined limits. Due to the transmission delay in communicating with the rover on Mars, a list of commands is sent to the rover. The rover will execute these commands then return the coordinates of its final position.

The formats of the commands found in the cmds file are of the form:

8 10
12 E
MMLMRMMRRMML

The first line describes the size of the current grid. This zone's boundary is at the Cartesian coordinate (8, 10).

The second line describes the rovers initial position on the grid along with its direction. In this example the rover is facing East at point (1, 2).

The third and final line is the list of commands the rover is to execute where

M : moves the rover forward in the direction it faces

L : turns the rover 90 degrees to the left from its current direction

R : turns the rover 90 degress to right from its current direction

The values may be changed as necessary while respecting the required format described above.

The program is designed to fast and lightweight. No libraries were used in its implementation, thus limiting dependencies to simply having python 3. Tests have been included to ensure the rover is grid aware, knowing when it is out of bounds. Tests have also been included to make sure the rover turns on its axis properly.

rover's People

Contributors

frtnx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.