GithubHelp home page GithubHelp logo

robotsimulator.js-dc-web-031218's Introduction

Robot Simulator

alt text

Background

Step 1

The robot factory manufactures robots that have three possible movements:

  • turn right
  • turn left
  • advance

Robots are placed on a hypothetical infinite grid, facing a particular direction (north, east, south, or west) at a set of [x, y] coordinates, e.g. [3,8].

Step 2

The factory's test facility needs a program to verify robot movements.

There are a number of different rooms of varying sizes, measured in Robot Units, the distance a robot moves when you instruct it to advance.

The floor of the room is a grid, each square of which measures 1 square RU (Robot Unit).

The rooms are always oriented so that each wall faces east, south, west, and north.

The test algorithm is to place a robot at a coordinate in the room, facing in a particular direction.

The robot then receives a number of instructions, at which point the testing facility verifies the robot's new position, and in which direction it is pointing.

alt text

Step 3

The robot factory's test facility has a simulator which can take a string of letters and feed this into a robot as instructions.

  • The letter-string "RAALAL" means:
    • Turn right
    • Advance twice
    • Turn left
    • Advance once
    • Turn left yet again
  • Say a robot starts at [7, 3] facing north.

Then running this stream of instructions should leave it at [9, 4] facing west.

Tests

To run the specs follow these commands:

learn

View Robot Simulator on Learn.co and start learning to code for free.

robotsimulator.js-dc-web-031218's People

Contributors

realandrewcohn avatar tsiege avatar fs-lms-test-bot avatar irmiller22 avatar deniznida avatar kthffmn avatar sarogers avatar octosteve avatar fislabstest avatar talum avatar tylermachen avatar vinnyalfieri avatar

Watchers

 avatar Rishikesh Tirumala avatar  avatar Victoria Thevenot avatar  avatar Joe Cardarelli avatar Katie Burke avatar Sara Tibbetts avatar  avatar Sophie DeBenedetto avatar  avatar Antoin avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Nicole Kroese  avatar Lisa Jiang avatar  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.