-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more comments, minor fixes and recompile project.
- Loading branch information
Showing
11 changed files
with
491 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,44 @@ | ||
# Traffic Stop Lights Simulation | ||
Simply open the `index.html` on a Chrome browser. | ||
A simulation of traffic in an intersection. | ||
The traffic lights are designated (N, S) and (E, W) like a compass. | ||
|
||
# Assumptions | ||
- When switching from green to red, the yellow light must be displayed for 30 seconds prior to it switching to red. | ||
- The lights will change automatically every 5 minutes. | ||
- Provide the output for the light changes which occur during a given thirty minute period. | ||
|
||
# Install | ||
`$ npm install` | ||
|
||
# Run in command line | ||
`$ npm start` | ||
|
||
``` | ||
⚡ npm start | ||
> [email protected] start | ||
> babel-node src/index.js | ||
Sun Feb 25 2018 23:34:26 GMT+1300 (NZDT) The program will run for 110s | ||
Sun Feb 25 2018 23:34:26 GMT+1300 (NZDT) Start! | ||
Sun Feb 25 2018 23:34:26 GMT+1300 (NZDT) All lights are red | ||
Sun Feb 25 2018 23:34:26 GMT+1300 (NZDT) {"NS":"green","NE":"green","SN":"green","SW":"green"} | ||
Sun Feb 25 2018 23:34:33 GMT+1300 (NZDT) {"NS":"orange","NE":"orange","SN":"orange","SW":"orange"} | ||
``` | ||
|
||
# Run website | ||
Simply open the `index.html` on a Chrome browser or do | ||
|
||
`$ npm run web` | ||
|
||
<img src="traffic-light-simulation.jpg"/> | ||
|
||
# Run tests | ||
`$ npm test` | ||
|
||
# Build project using webpack | ||
Run this whenever there's a change in the code or config file | ||
|
||
`$ npm run webpack` | ||
|
||
** Note: For the interest of time, the compiled project has faster delays. It will run for a total of 110seconds, the green lights are on for 7seconds and the yellow lights are on for 4seconds. |
Oops, something went wrong.