Skip to content

Commit ad5bada

Browse files
rootroot
authored andcommitted
new func-predicate isEven
1 parent 230fc5d commit ad5bada

File tree

10 files changed

+12
-12
lines changed

10 files changed

+12
-12
lines changed

bin/brain-calc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env node
2-
import readyGameCalc from "../src/BrainCacl.js";
2+
import readyGameCalc from "../src/games/BrainCacl.js";
33

44
readyGameCalc();

bin/brain-even.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env node
2-
import {gameven} from "../src/brainEven.js";
2+
import {gameven} from "../src/games/brainEven.js";
33

44
gameven();

bin/brain-gcd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
22

3-
import readygameGCD from "../src/brainGCD.js";
3+
import readygameGCD from "../src/games/brainGCD.js";
44

55
readygameGCD();

bin/brain-prime.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
22

3-
import gamePrime from "../src/brainPrime.js";
3+
import gamePrime from "../src/games/brainPrime.js";
44

55
gamePrime();

bin/brain-progression.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
22

3-
import gamePRG from "../src/brainPGRESS.js";
3+
import gamePRG from "../src/games/brainPGRESS.js";
44

55
gamePRG();

src/BrainCacl.js renamed to src/games/BrainCacl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { theMotor } from "../index.js";
1+
import { theMotor } from "../../index.js";
22
import { getRandomNum } from "./brainEven.js";
33
const description = 'What is the result of the expression?';
44
const getResultOfExpression = (firstValue, operator, secondValue) => {

src/brainEven.js renamed to src/games/brainEven.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

2-
import { theMotor } from '../index.js';
2+
import { theMotor } from '../../index.js';
33
const getRandomNum = (min, max) => Math.floor(Math.random() * (max - min + 1) + min);
4-
4+
const isEven = (number) => number % 2 === 0;
55

66
const description = '"yes" if the number is even, otherwise answer "no".';
77
const genRounds = ()=>{
88
const minNum = 1;
99
const maxNum = 100;
1010
const randomNum = getRandomNum(minNum, maxNum);
11-
const rightAnswer = randomNum % 2 === 0 ? 'yes' : 'no';
11+
const rightAnswer = isEven(description) ? 'yes' : 'no';
1212
return [randomNum, rightAnswer];
1313

1414
}

src/brainGCD.js renamed to src/games/brainGCD.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getRandomNum } from "./brainEven.js";
2-
import { theMotor } from "../index.js";
2+
import { theMotor } from "../../index.js";
33
const description = "Find the greatest common divisor of given numbers.";
44
const getNOD = (num1, num2)=>{
55
if (num1 === 0){

src/brainPGRESS.js renamed to src/games/brainPGRESS.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getRandomNum } from "./brainEven.js";
2-
import { theMotor } from "../index.js";
2+
import { theMotor } from "../../index.js";
33
const genPRG = (length, firstElem, prgStep)=>{
44
const progression = [];
55
for (let i = 0; i < length; i += 1) {

src/brainPrime.js renamed to src/games/brainPrime.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getRandomNum } from "./brainEven.js";
2-
import { theMotor } from "../index.js";
2+
import { theMotor } from "../../index.js";
33
const isPrime = (num)=>{
44
if (num <= 1){
55
return false;

0 commit comments

Comments
 (0)