Giter Club home page Giter Club logo

mars-rover-rxjs's Introduction

mars-rover-rxjs

This kata is strongly inspired by a thoughtworks exercice
The purpose here is to implement an implementation using Typescript and RxJS (v4)
Instead of receiving commands "L", "R" and "F" as in the original version, the rover should be driven using the arrows keys 'left', 'right' and 'up' (as forward).

Prerequisites

You need typescript installed:

npm install typescript -g  

You also need tsd:

npm install tsd -g  

To test your installation you can run "npm test". This repository includes a complex number implementation alon with unit tests as an example.

Note: if you have installed Typescript with Visual Studio, you might have a very old version of typescript on your path. To know which version of typescript is installed on your box just type the followning command:

tsc -v // should return at least 1.7

In order to transpile typescript code within your browser using file index.html, you need to use a static file http server. One simple solution is "http-server":

npm install http-server -g

and then just run http-server from the directory where is located index.html

First step

Provide a rover implementation, without any link to the UI.

Second step

Plug your rover implementation to the keyboard and to the screen.
You can use RX.Observable.fromEvent() method to generate an observable from pressed keys. In file index.html there are two div elements:

  • A div which id=container where you can display the position and direction of the rover.
  • A div which id=rover that can move on the screen, reprensenting the rover itself

Notes

This repository contains a minimal npm build that allows to transpile typescript to es5 and run unit tests using mocha/chai/sinon. As an example of typescript class and unit tests, there is a complex number implementation. You are free to use that in the kata or not. There is also an html page containing a systemjs setup that provide live tranpilation of typescript within the browser.
Any PR aiming to improve the build process are obviously very welcome ;)

mars-rover-rxjs's People

Contributors

alexvictoor avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

pmiossec

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.