GithubHelp home page GithubHelp logo

semaphore's Introduction

Documentation for this code challenge

‘Getting Started’

  • Javascript versions - (Server) Node.js version 14+; (Client) Javascript for Chrome 94+
  • Package manager - Yarn

Install by

  • going to the server folder and running yarn
  • then going to the client folder and running yarn

Initialize by

  • going to the server folder and running node index.js
  • then going to the client folder and running yarn east, yarn west, yarn south, yarn north (each in a separate tab)
  • visit the lights at the following addresses as separate tabs in your browser:
  • east: localhost:1234
  • south: localhost:4321
  • west: localhost:4000
  • north: localhost:1155
  • Once those tabs are open, open a devtools console window for each one. Watch as the logs change according to time. Each light change will display as a text message in the console.

‘Code Organization’

  • I put the traffic light controller into the server folder
  • I put the lights into the client folder
  • Within the client folder there's a file for each light that's named according to direction (south.html, west.html, etc.) North is in index.html

‘Test Suite’

  • Run tests by
  • going to the server folder and running yarn test

'Unknowns/Assumptions'
That you would appreciate seeing this code even if it does not have:

  • full test coverage
  • the British use case

'What I learned during this exercise'

  • Socket.io
  • Recursive setTimeout to use non-uniform time intervals

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.