Git Product home page Git Product logo

programming-challenge's Introduction

To Run

git clone https://github.com/uxl/programming-challenge
npm install
npm run watch
npm electron main.js

Prereqs

Install Node.js 4.5.0. This will also install npm as a global command.

Installing

Run the command npm install to install all dependencies.

Building

Command Description
npm run build Build the project in debug mode.
npm run watch Watches files and will build every time a file is changed. Use this for development
npm run clean Deletes built JavaScript files.

Executing

Run the command electron main.js to run the project.

The Challenge

Consider a checkerboard of unknown size. On each square is an arrow that randomly points either up, down, left, or right. A checker is placed on a random square. Each turn the checker moves one square in the direction of the arrow. Visualize an algorithm that determines if the checker moves off the edge of the board or ends up in a cycle.

  • Include UI controls to play, stop, and reset the game.
  • Include UI controls to change the size of the board and to shuffle the arrows.
  • Include audio to make things more interesting.
  • Add some style to make it look good.
  • Write the algorithm in constant memory space. The brute force solution is O(n) memory space.

This challenge is meant to show off code organization, quality, and cleanliness, design patterns, and the ability to learn new languages and ecosystems. Have fun with it.

Some important notes

This project is bootstrapped to transpile TypeScript into JavaScript. TypeScript is very much like C# or ActionScript. It is a superset of JavaScript. This means that all JavaScript is valid TypeScript. Feel free to code this in vanilla ES6 JavaScript, but having type information is very helpful especially coming from a C++/Java/C# background.

To take advantage of TypeScript's strong types and an IDE's helpful autocomplete, install the Atom Editor and install the atom-typescript package.

Globally install typings. To do this, run the command npm install typings -g. typings allows you to install type information about external npm modules. For example, if you were to use the external module async, you would npm install async, and the run typings search async. It will display the name and the source. To install the typings (which will be put in the typings folder of this project) run typings install dt~async --global. Then the TypeScript compiler will know how to compile against the async module.

The entry point to the application is index.html, which in turn points immediately to index.js. The typescript files in src are all transpiled and browserified into a single JavaScript file at the root of the project, which is index.js. Do not modify this file as it is auto generated. Also do not modify main.js, which is just a bootstrap to get electron running.

Use whatever libraries you want from the npm public repository. You can find them here and install them with npm install cool-lib-i-found --save.

Included is a minimal setup for Pixi.js, a 2D scene graph library that's GPU accelerated. If you've ever programmed ActionScript, it should look very familiar. The documentation can be found here. Please use Pixi.js for all visualizations, UI, and interactions.

To debug the application goto View -> Toggle DevTools. This will bring up the DevTools debugger. This is the standard DevTools that comes with Chrome.

programming-challenge's People

Contributors

uxl avatar golgobot avatar jonathanjibo avatar

Watchers

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