stack-glass-problem
v1.0.1
Published
Solving amount of water dispensed in glasses stacked in triangular pattern
Downloads
6
Maintainers
Readme
stack-glass-problem
Solving amount of water dispensed in glasses stacked in triangular pattern following the image This will find out the amount of liquid in any glass depending on amount poured on topmost one.
Table of Contents
Usage
The mode of using the program is via CLI. Some flavour or Linux environment is recommended as it it tested on similar environment. But Windows should work fine as well. To run the program, you need to fulfil the prerequisites:
node >= 10.x.x
. Checkout this linknpm >= 6.x.x
. THe previous command should already installnpm
. Checkout NodeJS docs or forum for troubleshooting.yarn >= 1.15.x
This project has made use ofyarn
rather thannpm
. So you can installyarn
by usingnpm i -g yarn
. But neverthelessnpm
will also work. Only drawback is that,package-lock.json
is not included in the repository, so the packages version installed may not quite match with those installed on the developer workdirectory.
Check your environment using node -v && npm -v
. This assumes that you have node
and npm
executable in you OS PATH
.
Then assuming that you have cloned the repository, do the following, from project root:
- If you yarn installed then run
yarn install
. Otherwise if you have npm then runnpm install
. node ./bin/index.js
and follow the prompt
Folder Structure
- bin (D) (the CLI executable script)
- src (D) (all source codes)
- test (D) (test specs)
- package.json (F) (nodejs package manifest)
... (F) (all other supporting files)
Test
Run the script:
npm run test
or to run specific test do:
./node_modules/.bin/ava <test file location>
Check out the docs for ava for details of tests.
Roadmap
- Add more code coverage.
- Add custom Error class using helpful error codes to help debugging.
- Publish the tool as REST API using
restify
for integrating with any UI that can talk REST. - Develop an web app to visualize the scenario and interactive form using React or VueJS.
Contributors
| Name | Website | | ------------------ | ------------------------------------ | | Miraz Al-Mamun | https://codarrior.mirazalmamun.xyz |
If you would like to contribute, here are some guidelines:
- Follow clean coding and put docblock using JSDoc format.
- This project uses
prettier and xo
for linting. - Make sure put right commit message. This gets help from
husky
.