Skip to content

golgobot/programming-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prereqs

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

Setup

  1. Requires Node.js
  2. Fork the repo
  3. Clone the repo and install it's dependencies:
git clone https://github.com/<your-github-username>/programming-challenge
cd programming-challenge
npm install
  1. See Usage section below for how to build/test your code.
  2. Once you feel ready, you should create a Pull Request against francoislaberge/programming-challenge
  3. Send an email to your main Jibo hiring manager.
  4. They will then review your pull request and potentially ask for some changes

Usage

Basic Usage

  1. Make changes to the code

  2. Build the project and keep watching for code changes, by running:

    npm run watch
    
  3. Run the app

    npm run exe
    
  4. Change your code, make sure there are no errors in the terminal

  5. Reload your code Command/Control+R (or use the menu: View -> Reload)

  6. Debug code via View -> Toggle DevTools

Commands

npm run build

Builds the code.

npm run watch

Builds the code then watches for changes and automatically rebuilds the project.

npm start

Same as npm run watch;

npm run clean

Deletes all files generated when building/watching your code.

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •