1.0.4 • Published 4 years ago

coin-master v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

What is this?

This is a change return algorithm for a vending machine. It is universal in terms of coin values and it has infinite amount of coins of all types. However for the user it is crucial that the machine returns smallest amount of coin possible.

Installation

npm i coin-master --save

import { coin } from 'coin-master';

coin({
  coins: [1, 2, 5],
  total: 12
})

Parameters

We have 2 required parameters:

  • coins - 1, 2, 5 (array of available coins, element 1 is required)
  • total - integer (amount of rest)
1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.0

4 years ago