New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Real World Vending Machine Feature: Reduce Coin Supply! #36
Labels
Comments
nelsonic
added a commit
that referenced
this issue
Oct 28, 2018
nelsonic
added a commit
that referenced
this issue
Oct 28, 2018
nelsonic
added a commit
that referenced
this issue
Oct 28, 2018
nelsonic
added a commit
that referenced
this issue
Oct 29, 2018
nelsonic
added a commit
that referenced
this issue
Oct 29, 2018
nelsonic
added a commit
that referenced
this issue
Oct 29, 2018
nelsonic
added a commit
that referenced
this issue
Oct 29, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As the company owning/operating vending machines - that sell delicious healthy vegan snacks,
we need to ensure that we give the correct change when people pay with cash
so that we don't accidentally short-change people and upset them.
We need to account for the "supply" of coins in the machine being reduced each time change is given and not attempt to give coins which are unavailable in the machine.
reduceCoinSupply
that takes an array of "coins available" (coinsAvail
) and an array of "coins given as change in the current transaction" (changeGiven
) and returns an third array which is thecoinsAvail
minus thechangeGiven
.Note: this is not "matrix math", it's simply removing elements from an array.
relates to #34 ... I don't want to simply switch to Tap from Tape without showing a valid use-case! 😉
The text was updated successfully, but these errors were encountered: