Code Monkey home page Code Monkey logo

mars-explorer's Introduction

MarsExplorer

A library to simulate that multiple explorers were sent to mars, landed on a plateau and need to move around through commands to send video back to earth .

Each explorer starts with (x, y) coordinates and a direction. Eg: (0, 0, N) . It means the explorer is on the center of plateau and turned to North .

Explorers can receive commands to move or turn 90 degress to right or left

Possible commands are "L", "R" and "M". From those, "L" and "R" make the explorer turn 90 degress to right or left, and "M" is to move to any direction explorer is pointed to .

Installation

  1. Import to your workspace as a Maven project
  2. Set Tomcat as your runtime server

Usage

Start service on port 8080, and make a curl passing Initial position separed by "-", and commands .

$ curl http://localhost:8080/mars-explorer/3-3-E/MMRMMRMRRM

Output will be a json similar to this one below:

{"string":"5 1 E"}

Examples

Start coordinates - 1 2 N
Commands          - LMLMLMLMM
Expected Output   - 1 3 N
Start coordinates - 3 3 E
Commands          - MMRMMRMRRM
Expected Output   - 5 1 E

Contributing

Source

The source for this project is now kept at GitHub:

https://github.com/digaoddc/mars-explorer

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

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.