Coder Social home page Coder Social logo

twuc-tdd-frontend-mars-rover's Introduction

Mars Rover

一辆火星车正在探测火星上的一块矩形区域。该区域被分割成了网状结构以方便导航。火星车所在的位置通过坐标来表示,比如0,0,N ,表示火星车位于矩形的左下角,并且面朝北方。除此之外,人们通过一些简单的指令来管理火星车的移动,指令包括 'L','R'和'M'。 'L' 和 'R' 能够使车向左或向右旋转90度,'M' 能够使车向前移动一格。

程序要求对应的输入输出如下所示。

输入:

  • 第一行输入表示矩形区域的大小,即矩形的右上坐标,左下坐标假定为0,0。
  • 火星车有两行输入。第一行给出了火星车的初始位置和指向,第二行是一系列指令,告诉火星车如何移动。
  • 位置由两个整数和一个空格分隔的字母组成,分别对应x、y坐标和火星车的方位。

输出:

  • 输出每个火星车的最终坐标和航向。

Example:

Input:

5 5
1 2 N
LMLMLMLMM

Expected Output:

1 3 N

How to run

在终端中执行

npm install
npm run test

twuc-tdd-frontend-mars-rover's People

Contributors

suiyijj avatar nanshan231 avatar yyan-lfc 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.