Code Monkey home page Code Monkey logo

awesome-mars-rover's Introduction

Mars-Rover-TDD

A programming kata is an exercise which helps a programmer hone his skills through practice and repetition.

Getting Start

git clone [email protected]:JimmyLv/awesome-mars-rover.git

cd awesome-mars-rover

gradle idea # or ./gradlew idea

# open MarsRover.ipr in Intellij IDEA

# run MarsRoverTest to verify

Requirement

  • 可以通过一串指令操控火星漫游者号可以在平原上移动
  • 火星漫游者号能够接收(L R M)构成的字符串指令,并返回执x行后的位置和方向
  • 火星漫游者号移动过程中不能越过平原的边界
  • 火星漫游者号应该忽略错误的指令

Test case

  • 火星漫游者号初始位置在(0, 0, N),接收指令L,结果应当是(0, 0, W)

  • 火星漫游者号初始位置在(0, 0, N),接收指令R,结果应当是(0, 0, E)

  • 火星漫游者号初始位置在(0, 0, N),接收指令M,结果应当是(0, 1, N)

  • 火星漫游者号初始位置在(1, 1, W),接收指令M,结果应当是(0, 1, W)

  • 火星漫游者号初始位置在(0, 0, N),接收指令RML,结果应当是(1, 0, N)

  • 火星漫游者号初始位置在(0, 0, N),接收指令RMLRR,结果应当是(1, 0, S)

  • TODO 火星漫游者号初始位置在(0, 0, W),接收指令M,结果应当是(0, 0, W)

  • TODO 火星漫游者号初始位置在(5, 5, N),接收指令MRMR,结果应当是(5, 5, S)

  • TODO 火星漫游者号初始位置在(0, 0, N),接收指令LMLM,结果应当是(0, 0, S)

awesome-mars-rover's People

Contributors

jimmylv avatar

Watchers

James Cloos 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.