Skip to content

Commit

Permalink
Merge pull request #770 from chaotixkilla/chore-downgrade-dev-env-node6
Browse files Browse the repository at this point in the history
Downgrade dev environment to node 6
  • Loading branch information
RafaelTaranto authored Mar 9, 2022
2 parents 04bc5f2 + fb266f5 commit 7a3ef0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
9 changes: 3 additions & 6 deletions lib/bill_math.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ function unmergeCassettes(cassettes, output) {

const amountNeeded = map[it.denomination]
if (!amountNeeded) {
return response.push({ provisioned: 0, ...value })
return response.push(Object.assign({ provisioned: 0 }, value))
}

if (amountNeeded < it.count) {
map[it.denomination] = 0
return response.push({ provisioned: amountNeeded, ...value })
return response.push(Object.assign({ provisioned: amountNeeded }, value))
}

map[it.denomination] -= it.count
return response.push({ provisioned: it.count, ...value })
return response.push(Object.assign({ provisioned: it.count }, value))
}, cassettes)

return response
Expand Down Expand Up @@ -109,7 +109,6 @@ function makeChange(outCassettes, amount) {
)

if (available < amount) {
console.log(`Tried to dispense more than was available for amount ${amount.toNumber()} with cassettes ${JSON.stringify(cassettes)}`)
return null
}

Expand All @@ -136,8 +135,6 @@ function makeChangeDynamicBruteForce(outCassettes, amount, available) {
const { denomination: denomination2, count: count2 } = cassettes[2]
const { denomination: denomination3, count: count3 } = cassettes[3]

const startTime = new Date().getTime()

loop1: for (let i = 0; i <= count0; i++) {
const firstSum = i * denomination0

Expand Down
8 changes: 4 additions & 4 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
with import (fetchTarball {
name = "nixpkgs-19.03";
url = https://github.com/NixOS/nixpkgs-channels/archive/f52505fac8c82716872a616c501ad9eff188f97f.tar.gz;
sha256 = "0q2m2qhyga9yq29yz90ywgjbn9hdahs7i8wwlq7b55rdbyiwa5dy";
url = https://github.com/NixOS/nixpkgs-channels/archive/69fabc286f745bca37a8cbead3665de31758e778.tar.gz;
sha256 = "0mkqv8d4vh6r1b34n7ik0gpzqhf60sj1masd89jndlckvklqh69j";
}) {};


stdenv.mkDerivation {
name = "node";
buildInputs = [
nodejs-8_x
nodejs-6_x
openssl_1_0_2
python2Full
entr
Expand All @@ -18,4 +18,4 @@ stdenv.mkDerivation {
shellHook = ''
export PATH="$PWD/node_modules/.bin/:$PATH"
'';
}
}

0 comments on commit 7a3ef0d

Please sign in to comment.