Skip to content

neverblued/vodka.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vodka.js

Overview

This project is my attempt to solve a classical exercise, explained hereinafter, by JavaScript implementation.

The outcome should be data describing exactly one litre of vodka, which is accepted as 40% solution of alcohol in water. To achieve this goal one may use just the following:

  • Unlimited actions;
  • Unlimited source of water and alcohol;
  • Two tanks: 3 and 5 litres.

Since there are no measurement instruments, one may only fill tanks totally and pour water from various sources to another tank or nowhere.

My implementation approach is focused on creating an intellectual system that would solve the exercise by itself and save lazy me from googling out the right algorithm.

Coding

  • Pure proprietary JavaScript, no external dependencies;
  • Abstraction layers are modules;
  • Clear, sensible semantics.

Development dependencies exist for testing.

Modules

  • Format defines output style;
  • Automat is charged with setting up experimental environment (?), performing serial execution of methods and checking progress (almost ready);
  • Model describes entities (Fluid, Mix, Schnapps and Tank) and protocols (ready);
  • View adds some Model and Automat output detailing via toString overriding (ready);
  • Etalon implements output standard and estimation;
  • Technology implements generating tree of Experiments and processing their output (expected);
  • Experiment instances hold a scope, a log and can be cloned to start next technological step.

Platform

Node.js

Test

user@host:/project/folder$ npm install && npm test

About

JavaScript exercise

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published