Skip to content

Commit 09fe18e

Browse files
rootroot
authored andcommitted
fix gameCalc and install new package
1 parent aa5f7e0 commit 09fe18e

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ brain-games:
44
node bin/brain-games.js
55
brain-even:
66
node bin/brain-even.js
7+
brain-calc:
8+
node bin/brain-calc.js
79
publish:
810
npm publish --dry-run
911
lint:

bin/brain-calc.js

100644100755
File mode changed.

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"main": "index.js",
77
"bin": {
88
"brain-games": "bin/brain-games.js",
9-
"brain-even": "bin/brain-even.js"
9+
"brain-even": "bin/brain-even.js",
10+
"brain-calc": "bin/brain-calc.js"
1011
},
1112
"scripts": {
1213
"test": "echo \"Error: no test specified\" && exit 1"

src/BrainCacl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const operations = ()=>{
99
const ops = ["+", "-", "*"];
1010
const minIndex = 0;
1111
const MaxIndex = ops.length-1;
12-
const randomOp = ops(getRandomNum(minIndex, MaxIndex));
12+
const randomOp = ops[getRandomNum(minIndex, MaxIndex)];
1313
return `${firstNum}${randomOp}${secondNum}`
1414
}
1515
const StartValueOPS = (exs)=>{
@@ -27,7 +27,7 @@ const StartValueOPS = (exs)=>{
2727
case '*': result = num1 * num2;
2828
break;
2929
default: throw new Error(`Unknown order state: '${exs}'!`);
30-
}
30+
}
3131

3232
return result;
3333
}

0 commit comments

Comments
 (0)