Git Product home page Git Product logo

lyka-warehouse-robot's Introduction

Lyka Coding Exercise

Part One - First Round Technical Test - Warehouse Robot

Assumption:

  • Program is set up to take in commands to guide the robot moving in the warehouse
  • One command will be skipped to next command if it causes the robot to move out of the boundary
  • Commands sequence will be dropped as whole if there is any invalid command
  • Result output is the concluded coordinates of the robot in the warehouse
  • Warehouse grid size is default to 10x10 and the robot will start at coordinates of 1:1
  • Coordinate system is running from left to right, down to bottom start from 1:1 to 10:10

Quick Start

Install dependency

yarn

Run program

yarn start [options]

Eg.

yarn start -s 10:10 -p 1:1 -c "S W S W N E"

Output:
------ BEGIN ------
ROBOT:  { x: 1, y: 1 }
------ END ------
ROBOT:  { x: 2, y: 2 }
Options:
  -s, --warehouse-size <num>:<num>  Warehouse grid size (default: {"x":10,"y":10})
  -p, --position <num>:<num>        Initial position of the robot (default: {"x":1,"y":1})

  -c, --commands <string>           [REQUIRED] Commands for robot to move
                                    Commands: N(North) S(South) E(East) W(West)
                                    eg. N E N E W S

  -h, --help                        Display help for command

Run unit test

yarn test:unit

Run compiling test

yarn test:compile

lyka-warehouse-robot's People

Watchers

Duc Duong 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.