math-exercises 2.2.7 → 2.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/calcul/arithmetics/divisorsList.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/divisorsList.js +10 -7
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +0 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +0 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +0 -1
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.js +0 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts +10 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +61 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts +10 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +56 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts +9 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +57 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts +3 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.js +3 -0
- package/lib/exercises/math/calcul/fractions/simplifyFraction.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/simplifyFraction.js +0 -1
- package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.js +0 -1
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.js +0 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +0 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +0 -1
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.js +0 -1
- package/lib/exercises/math/complex/addComplex.d.ts.map +1 -1
- package/lib/exercises/math/complex/addComplex.js +0 -1
- package/lib/exercises/math/complex/conjugateComplex.ts.d.ts.map +1 -1
- package/lib/exercises/math/complex/conjugateComplex.ts.js +0 -1
- package/lib/exercises/math/complex/conjugateDivideComplex.d.ts.map +1 -1
- package/lib/exercises/math/complex/conjugateDivideComplex.js +0 -1
- package/lib/exercises/math/complex/inverseComplex.d.ts.map +1 -1
- package/lib/exercises/math/complex/inverseComplex.js +0 -1
- package/lib/exercises/math/complex/moduloFromAlgebraicComplex.d.ts.map +1 -1
- package/lib/exercises/math/complex/moduloFromAlgebraicComplex.js +0 -1
- package/lib/exercises/math/complex/mutiplyComplex.d.ts.map +1 -1
- package/lib/exercises/math/complex/mutiplyComplex.js +0 -1
- package/lib/exercises/math/conversion/aeraConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/aeraConversion.js +0 -2
- package/lib/exercises/math/conversion/capacityConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/capacityConversion.js +0 -1
- package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/lengthConversion.js +0 -2
- package/lib/exercises/math/conversion/massConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/massConversion.js +0 -2
- package/lib/exercises/math/conversion/volumeCapacityConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/volumeCapacityConversion.js +0 -2
- package/lib/exercises/math/conversion/volumeConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/volumeConversion.js +0 -2
- package/lib/exercises/math/derivation/derivative/expDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/expDerivativeOne.js +0 -1
- package/lib/exercises/math/derivation/derivative/inverseFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/inverseFunctionDerivative.js +0 -1
- package/lib/exercises/math/derivation/derivative/lnDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/lnDerivativeOne.js +0 -1
- package/lib/exercises/math/derivation/derivative/lnDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/lnDerivativeThree.js +0 -1
- package/lib/exercises/math/derivation/derivative/powerCompositionDerivation.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/powerCompositionDerivation.js +0 -2
- package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.js +0 -1
- package/lib/exercises/math/derivation/derivative/quotientDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/quotientDerivative.js +0 -1
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.js +0 -1
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.js +0 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.js +0 -1
- package/lib/exercises/math/derivation/derivativeNumberReading.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivativeNumberReading.js +0 -1
- package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +0 -1
- package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.js +0 -1
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +0 -1
- package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.js +12 -3
- package/lib/exercises/math/functions/cube/cubicEquation.js +0 -1
- package/lib/exercises/math/functions/exponential/expEquation.js +0 -1
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.js +3 -4
- package/lib/exercises/math/functions/trinoms/rootsFromFactorizedForm.js +0 -1
- package/lib/exercises/math/functions/trinoms/secondDegreeInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/secondDegreeInequation.js +0 -1
- package/lib/exercises/math/functions/trinoms/summitAbscissFromRoots.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAbscissFromRoots.js +0 -2
- package/lib/exercises/math/geometry/areas/triangleAreaV2.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/triangleAreaV2.js +0 -1
- package/lib/exercises/math/geometry/cartesian/distanceBetweenTwoPoints.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/distanceBetweenTwoPoints.js +0 -1
- package/lib/exercises/math/geometry/cartesian/midpoint.js +0 -1
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +0 -1
- package/lib/exercises/math/geometry/thales/thales.js +0 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +0 -1
- package/lib/exercises/math/geometry/vectors/alignementViaColinearity.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/alignementViaColinearity.js +0 -2
- package/lib/exercises/math/geometry/vectors/parallelogramViaEqualVectors.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/parallelogramViaEqualVectors.js +0 -2
- package/lib/exercises/math/percent/findProportion.d.ts.map +1 -1
- package/lib/exercises/math/percent/findProportion.js +1 -1
- package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/percent/percentToDecimal.js +0 -1
- package/lib/exercises/math/powers/calculateNegativePower.js +0 -1
- package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
- package/lib/exercises/math/powers/decimalToScientific.js +0 -1
- package/lib/exercises/math/powers/powersPower.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersPower.js +0 -1
- package/lib/exercises/math/powers/scientificToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/powers/scientificToDecimal.js +0 -2
- package/lib/exercises/math/primitive/expUPrimitive.js +0 -1
- package/lib/exercises/math/primitive/exponentialPrimitive.js +0 -1
- package/lib/exercises/math/primitive/logarithmePrimitive.js +0 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.js +0 -1
- package/lib/exercises/math/primitive/sinCosPrimitive.js +0 -1
- package/lib/exercises/math/primitive/sinUCosUPrimitive.js +0 -1
- package/lib/exercises/math/probaStat/cardBasicProbas.js +0 -1
- package/lib/exercises/math/probaStat/diceBasicProbas.js +0 -1
- package/lib/exercises/math/probaStat/probabilityTree.js +0 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +13 -4
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +0 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplictFormulaFirstTermRandom.js +0 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.d.ts +10 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.js +48 -0
- package/lib/exercises/math/sequences/arithmetic/index.d.ts +1 -0
- package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/index.js +1 -0
- package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +0 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.js +0 -1
- package/lib/exercises/math/sequences/geometric/geometricFindTerm.d.ts +10 -0
- package/lib/exercises/math/sequences/geometric/geometricFindTerm.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindTerm.js +48 -0
- package/lib/exercises/math/sequences/geometric/geometricRecognizeReasonFromFirstTerms.d.ts +8 -0
- package/lib/exercises/math/sequences/geometric/geometricRecognizeReasonFromFirstTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricRecognizeReasonFromFirstTerms.js +46 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts +2 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +2 -0
- package/lib/exercises/math/sets/intervals/inequalityToInterval.d.ts +2 -3
- package/lib/exercises/math/sets/intervals/inequalityToInterval.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/inequalityToInterval.js +23 -91
- package/lib/exercises/math/sets/intervals/intervalToInequality.d.ts +10 -0
- package/lib/exercises/math/sets/intervals/intervalToInequality.d.ts.map +1 -0
- package/lib/exercises/math/sets/intervals/intervalToInequality.js +112 -0
- package/lib/exercises/math/squareRoots/squareRootsSum.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsSum.js +0 -1
- package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.js +0 -1
- package/lib/exercises/pc/energy/energyTransfer.d.ts.map +1 -1
- package/lib/exercises/pc/energy/energyTransfer.js +0 -1
- package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.d.ts.map +1 -1
- package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.js +0 -1
- package/lib/exercises/pc/mecanicalWaves/elongationReading.d.ts.map +1 -1
- package/lib/exercises/pc/mecanicalWaves/elongationReading.js +0 -1
- package/lib/index.d.ts +29 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +0 -2
- package/lib/pc/constants/molecularChemistry/reaction.js +3 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +2 -2
- package/lib/tree/nodes/sets/closure.d.ts +2 -0
- package/lib/tree/nodes/sets/closure.d.ts.map +1 -1
- package/lib/tree/nodes/sets/closure.js +24 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts +3 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +13 -0
- package/lib/tree/parsers/latexParser.js +6 -6
- package/package.json +1 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inequalityToInterval = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const intervals_1 = require("../../../../math/sets/intervals/intervals");
|
|
7
|
+
const inequationNode_1 = require("../../../../tree/nodes/inequations/inequationNode");
|
|
8
|
+
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
9
|
+
const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
|
|
10
|
+
const shuffle_1 = require("../../../../utils/shuffle");
|
|
11
|
+
const getIntervalToInequalityQuestion = () => {
|
|
12
|
+
const interval = intervals_1.IntervalConstructor.random();
|
|
13
|
+
const inequalityString = interval.toInequality();
|
|
14
|
+
const answer = inequalityString;
|
|
15
|
+
const instruction = `Soit $x \\in ${interval.toTex()}$. Traduire cette appartenance en une inégalité.`;
|
|
16
|
+
const question = {
|
|
17
|
+
answer,
|
|
18
|
+
instruction: instruction,
|
|
19
|
+
keys: ["x", "inf", "sup", "geq", "leq", "infty"],
|
|
20
|
+
answerFormat: "tex",
|
|
21
|
+
identifiers: {
|
|
22
|
+
intervalMin: interval.min === -Infinity ? "-infty" : interval.min,
|
|
23
|
+
intervalMax: interval.max === Infinity ? "infty" : interval.max,
|
|
24
|
+
intervalClosure: interval.closure,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
return question;
|
|
28
|
+
};
|
|
29
|
+
const getPropositions = (n, { answer, intervalClosure, intervalMax, intervalMin }) => {
|
|
30
|
+
const switchInclusion = (symbol) => {
|
|
31
|
+
if (symbol === "\\le")
|
|
32
|
+
return "<";
|
|
33
|
+
if (symbol === "<")
|
|
34
|
+
return "\\le";
|
|
35
|
+
if (symbol === ">")
|
|
36
|
+
return "\\ge";
|
|
37
|
+
return ">";
|
|
38
|
+
};
|
|
39
|
+
const reverseInequality = (symbol) => {
|
|
40
|
+
if (symbol === "\\le")
|
|
41
|
+
return "\\ge";
|
|
42
|
+
if (symbol === "<")
|
|
43
|
+
return ">";
|
|
44
|
+
if (symbol === ">")
|
|
45
|
+
return "<";
|
|
46
|
+
return "\\le";
|
|
47
|
+
};
|
|
48
|
+
const min = intervalMin === "-infty" ? -Infinity : intervalMin;
|
|
49
|
+
const max = intervalMax === "infty" ? Infinity : intervalMax;
|
|
50
|
+
const interval = new intervals_1.Interval(min.toTree(), max.toTree(), intervalClosure);
|
|
51
|
+
const propositions = [];
|
|
52
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
53
|
+
const xNode = new variableNode_1.VariableNode("x");
|
|
54
|
+
let wrongIneqs = [];
|
|
55
|
+
if (interval.min === -Infinity) {
|
|
56
|
+
wrongIneqs = [
|
|
57
|
+
new inequationNode_1.InequationNode([xNode, new numberNode_1.NumberNode(interval.max)], switchInclusion(interval.rightInequalitySymbol)),
|
|
58
|
+
new inequationNode_1.InequationNode([xNode, new numberNode_1.NumberNode(interval.max)], reverseInequality(switchInclusion(interval.rightInequalitySymbol))),
|
|
59
|
+
new inequationNode_1.InequationNode([xNode, new numberNode_1.NumberNode(interval.max)], reverseInequality(interval.rightInequalitySymbol)),
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
else if (interval.max === Infinity) {
|
|
63
|
+
wrongIneqs = [
|
|
64
|
+
new inequationNode_1.InequationNode([xNode, new numberNode_1.NumberNode(interval.min)], switchInclusion(interval.leftInequalitySymbol)),
|
|
65
|
+
new inequationNode_1.InequationNode([xNode, new numberNode_1.NumberNode(interval.min)], reverseInequality(switchInclusion(interval.leftInequalitySymbol))),
|
|
66
|
+
new inequationNode_1.InequationNode([xNode, new numberNode_1.NumberNode(interval.min)], interval.leftInequalitySymbol),
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
wrongIneqs = [
|
|
71
|
+
new inequationNode_1.InequationNode([new numberNode_1.NumberNode(interval.min), xNode, new numberNode_1.NumberNode(interval.max)], [
|
|
72
|
+
switchInclusion(interval.leftInequalitySymbol),
|
|
73
|
+
interval.rightInequalitySymbol,
|
|
74
|
+
]),
|
|
75
|
+
new inequationNode_1.InequationNode([new numberNode_1.NumberNode(interval.min), xNode, new numberNode_1.NumberNode(interval.max)], [
|
|
76
|
+
interval.leftInequalitySymbol,
|
|
77
|
+
switchInclusion(interval.rightInequalitySymbol),
|
|
78
|
+
]),
|
|
79
|
+
new inequationNode_1.InequationNode([new numberNode_1.NumberNode(interval.min), xNode, new numberNode_1.NumberNode(interval.max)], [
|
|
80
|
+
switchInclusion(interval.leftInequalitySymbol),
|
|
81
|
+
switchInclusion(interval.rightInequalitySymbol),
|
|
82
|
+
]),
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
wrongIneqs.forEach((ineq) => {
|
|
86
|
+
(0, exercise_1.addWrongProp)(propositions, ineq.toTex());
|
|
87
|
+
});
|
|
88
|
+
return (0, shuffle_1.shuffle)(propositions);
|
|
89
|
+
};
|
|
90
|
+
const isAnswerValid = (ans, { intervalClosure, intervalMax, intervalMin }) => {
|
|
91
|
+
const min = intervalMin === "-infty" ? -Infinity : intervalMin;
|
|
92
|
+
const max = intervalMax === "infty" ? Infinity : intervalMax;
|
|
93
|
+
const interval = new intervals_1.Interval(min.toTree(), max.toTree(), intervalClosure).toTree();
|
|
94
|
+
const inequality = interval.toInequality();
|
|
95
|
+
const answer = inequality;
|
|
96
|
+
const texs = answer.toAllValidTexs();
|
|
97
|
+
return texs.includes(ans);
|
|
98
|
+
};
|
|
99
|
+
exports.inequalityToInterval = {
|
|
100
|
+
id: "intervalToInequality",
|
|
101
|
+
connector: "=",
|
|
102
|
+
label: "Traduire un intervalle en inégalité",
|
|
103
|
+
levels: ["2ndPro", "2nde", "CAP", "1reESM"],
|
|
104
|
+
isSingleStep: true,
|
|
105
|
+
sections: ["Ensembles et intervalles"],
|
|
106
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getIntervalToInequalityQuestion, nb),
|
|
107
|
+
qcmTimer: 60,
|
|
108
|
+
freeTimer: 60,
|
|
109
|
+
getPropositions,
|
|
110
|
+
isAnswerValid,
|
|
111
|
+
subject: "Mathématiques",
|
|
112
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"squareRootsSum.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/squareRoots/squareRootsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"squareRootsSum.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/squareRoots/squareRootsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;AA8EF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAchD,CAAC"}
|
|
@@ -62,7 +62,6 @@ const isAnswerValid = (ans, { answer, a, b, c, d, y, x, z }) => {
|
|
|
62
62
|
}
|
|
63
63
|
const tree = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(coeff), new sqrtNode_1.SqrtNode(new numberNode_1.NumberNode(b))).simplify();
|
|
64
64
|
const texs = tree.toAllValidTexs();
|
|
65
|
-
console.log("vea SumSQRT answer: ", answer, "texs : ", texs);
|
|
66
65
|
return texs.includes(ans);
|
|
67
66
|
};
|
|
68
67
|
exports.squareRootsSum = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findAtomEntitiesNumberFromMass.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AAMhF,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,WAAW,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"findAtomEntitiesNumberFromMass.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AAMhF,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,WAAW,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAsEF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAahE,CAAC"}
|
|
@@ -18,7 +18,6 @@ const getFindAtomEntitiesNumberFromMassQuestion = () => {
|
|
|
18
18
|
const sampleMassMeasure = new measure_1.Measure(sampleMass, 0, massUnits_1.MassUnit.kg);
|
|
19
19
|
const atomMass = atoms_1.nucleonMass.value.times(atom.masseAtomique).toSignificant(2);
|
|
20
20
|
const entitiesNumber = sampleMassMeasure.divide(atomMass).toSignificant(2);
|
|
21
|
-
console.log("entitiesNumber", entitiesNumber);
|
|
22
21
|
const instruction = `Un échantillon a une masse $m = ${sampleMassMeasure.toTex()}$ ${(0, requiresApostropheBefore_1.requiresApostropheBefore)(atom.name) ? "d'" : "de "}${atom.name}. La masse d'un atome ${(0, requiresApostropheBefore_1.requiresApostropheBefore)(atom.name) ? "d'" : "de "}${atom.name} est de $${atomMass.toTex({ scientific: 2 })}$.
|
|
23
22
|
Déterminer le nombre d'atomes ${(0, requiresApostropheBefore_1.requiresApostropheBefore)(atom.name) ? "d'" : "de "}${atom.name} composant l'échantillon.`;
|
|
24
23
|
const question = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energyTransfer.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/energy/energyTransfer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"energyTransfer.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/energy/energyTransfer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAgEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
|
|
@@ -49,7 +49,6 @@ const isAnswerValid = (ans, { answer, energy }) => {
|
|
|
49
49
|
const validanswer2 = energy.toTree().toAllValidTexs();
|
|
50
50
|
let latexs = [];
|
|
51
51
|
latexs.push(validanswer1, ...validanswer2);
|
|
52
|
-
console.log(latexs);
|
|
53
52
|
return latexs.includes(ans);
|
|
54
53
|
};
|
|
55
54
|
exports.energyTransfer = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gravitationalAttractionObjectHeight.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/forces/gravitationalAttractionObjectHeight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"gravitationalAttractionObjectHeight.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/forces/gravitationalAttractionObjectHeight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgIF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,WAAW,CAerE,CAAC"}
|
|
@@ -112,7 +112,6 @@ const isAnswerValid = (ans, { answer, h }) => {
|
|
|
112
112
|
validanswer2.toSignificant(2).toTex({ hideUnit: true }),
|
|
113
113
|
validanswer3.toSignificant(2).toTex({ hideUnit: true }),
|
|
114
114
|
];
|
|
115
|
-
console.log(latexs);
|
|
116
115
|
return latexs.includes(ans);
|
|
117
116
|
};
|
|
118
117
|
exports.gravitationalAttractionObjectHeight = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elongationReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/mecanicalWaves/elongationReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"elongationReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/mecanicalWaves/elongationReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA4FF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAanD,CAAC"}
|
|
@@ -54,7 +54,6 @@ const isAnswerValid = (ans, { answer, amplitude, period }) => {
|
|
|
54
54
|
const node = new multiplyNode_1.MultiplyNode(amplitude.toTree(), new cosNode_1.CosNode(new multiplyNode_1.MultiplyNode(frac, new variableNode_1.VariableNode("t"))));
|
|
55
55
|
const equal = new equalNode_1.EqualNode(new variableNode_1.VariableNode("y\\left(t\\right)"), node);
|
|
56
56
|
const texs = equal.toAllValidTexs({ allowRawRightChildAsSolution: true });
|
|
57
|
-
console.log(texs);
|
|
58
57
|
return texs.includes(ans);
|
|
59
58
|
};
|
|
60
59
|
exports.elongationReading = {
|
package/lib/index.d.ts
CHANGED
|
@@ -93,6 +93,20 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
93
93
|
num: number;
|
|
94
94
|
denum: number;
|
|
95
95
|
leadingPart: number;
|
|
96
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
97
|
+
denom: number;
|
|
98
|
+
num1: number;
|
|
99
|
+
num2: number;
|
|
100
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
101
|
+
num1: number;
|
|
102
|
+
num2: number;
|
|
103
|
+
denom1: number;
|
|
104
|
+
denom2: number;
|
|
105
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
106
|
+
num1: number;
|
|
107
|
+
num2: number;
|
|
108
|
+
denom1: number;
|
|
109
|
+
denom2: number;
|
|
96
110
|
}> | import("./exercises/exercise").Exercise<{
|
|
97
111
|
numbers: number[];
|
|
98
112
|
}> | import("./exercises/exercise").Exercise<{
|
|
@@ -1247,6 +1261,11 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
1247
1261
|
rank2: number;
|
|
1248
1262
|
value2: number;
|
|
1249
1263
|
rankAsked: number;
|
|
1264
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
1265
|
+
firstRank: number;
|
|
1266
|
+
firstTerm: number;
|
|
1267
|
+
reason: number;
|
|
1268
|
+
askedRank: number;
|
|
1250
1269
|
}> | import("./exercises/exercise").Exercise<{
|
|
1251
1270
|
firstValue: number;
|
|
1252
1271
|
reason: number;
|
|
@@ -1273,6 +1292,14 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
1273
1292
|
reason: number;
|
|
1274
1293
|
firstValue: number;
|
|
1275
1294
|
firstRank: number;
|
|
1295
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
1296
|
+
firstRank: number;
|
|
1297
|
+
firstTerm: number;
|
|
1298
|
+
reason: number;
|
|
1299
|
+
askedRank: number;
|
|
1300
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
1301
|
+
sequence: number[];
|
|
1302
|
+
reason: number;
|
|
1276
1303
|
}> | import("./exercises/exercise").Exercise<{
|
|
1277
1304
|
rank: number;
|
|
1278
1305
|
coeffs: number[];
|
|
@@ -1283,9 +1310,8 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
1283
1310
|
u0: number;
|
|
1284
1311
|
coeffs: number[];
|
|
1285
1312
|
}> | import("./exercises/exercise").Exercise<{
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
intervalMax: number;
|
|
1313
|
+
intervalMin: string | number;
|
|
1314
|
+
intervalMax: string | number;
|
|
1289
1315
|
intervalClosure: import("./tree/nodes/sets/closure").ClosureType;
|
|
1290
1316
|
}> | import("./exercises/exercise").Exercise<{
|
|
1291
1317
|
int1Min: number;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;QACxB,YAAY,EAAE,CAAC,QAAQ,CAAC,E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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAQjE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,qBAAa,IAAI;IACf,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC7B,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;gBACjB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK;IAkBxC,YAAY,CAAC,KAAK,EAAE,KAAK;
|
|
1
|
+
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAQjE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,qBAAa,IAAI;IACf,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC7B,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;gBACjB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK;IAkBxC,YAAY,CAAC,KAAK,EAAE,KAAK;IASzB,QAAQ,CAAC,KAAK,EAAE,KAAK;IAarB,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM;IAa5B,WAAW,MAAO,MAAM,KAAK,KAAK,KAAG,SAAS,CAmB5C;IAEF,oBAAoB,IAAI,SAAS;CAsBlC"}
|
|
@@ -40,7 +40,6 @@ class Line {
|
|
|
40
40
|
}
|
|
41
41
|
getParallele(point) {
|
|
42
42
|
if (this.isVertical) {
|
|
43
|
-
console.log(this.pointA.toTexWithCoords(), this.pointB.toTexWithCoords());
|
|
44
43
|
throw Error("Parallel vertical lines not implemented");
|
|
45
44
|
}
|
|
46
45
|
const x = new addNode_1.AddNode(point.x, new numberNode_1.NumberNode(1)).simplify();
|
|
@@ -61,7 +60,6 @@ class Line {
|
|
|
61
60
|
}
|
|
62
61
|
const x = new numberNode_1.NumberNode((0, randint_1.randint)(-10, 10));
|
|
63
62
|
const y = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(this.a, x), this.b).simplify();
|
|
64
|
-
console.log(y.toTex(), this.a.toTex(), x.toTex(), this.b?.toTex());
|
|
65
63
|
return new point_1.Point(name ?? "A", x, y);
|
|
66
64
|
}
|
|
67
65
|
getCartesianEquation() {
|
|
@@ -324,7 +324,9 @@ class ReactionConstructor {
|
|
|
324
324
|
for (const reactionSpecies of reaction) {
|
|
325
325
|
const foundMolecule = molecule_1.molecules.find((molecule) => molecule.formula === reactionSpecies.species);
|
|
326
326
|
if (!foundMolecule) {
|
|
327
|
-
console.log(
|
|
327
|
+
// console.log(
|
|
328
|
+
// `La species '${reactionSpecies.species}' n'a pas été trouvée dans molecules.`,
|
|
329
|
+
// );
|
|
328
330
|
}
|
|
329
331
|
}
|
|
330
332
|
}
|
package/lib/playground.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,UAAU,YAEtB,CAAC"}
|
package/lib/playground.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.playground = void 0;
|
|
4
|
-
const
|
|
4
|
+
const infiniteNode_1 = require("./tree/nodes/numbers/infiniteNode");
|
|
5
5
|
const playground = () => {
|
|
6
|
-
console.log(
|
|
6
|
+
console.log(infiniteNode_1.MinusInfinityNode.evaluate({}));
|
|
7
7
|
};
|
|
8
8
|
exports.playground = playground;
|
|
@@ -7,6 +7,8 @@ export declare enum ClosureType {
|
|
|
7
7
|
export declare abstract class Closure {
|
|
8
8
|
static random(): ClosureType;
|
|
9
9
|
static reverse(closure: ClosureType): ClosureType;
|
|
10
|
+
static leftReverse(closure: ClosureType): ClosureType;
|
|
11
|
+
static rightReverse(closure: ClosureType): ClosureType;
|
|
10
12
|
static switch(closure: ClosureType): ClosureType;
|
|
11
13
|
static fromBrackets(left: "[" | "]", right: "]" | "["): ClosureType;
|
|
12
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closure.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/sets/closure.ts"],"names":[],"mappings":"AAEA,oBAAY,WAAW;IACrB,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;CACH;AAED,8BAAsB,OAAO;IAC3B,MAAM,CAAC,MAAM;IAcb,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,WAAW;IAYnC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW;IAYlC,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG;CAOtD"}
|
|
1
|
+
{"version":3,"file":"closure.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/sets/closure.ts"],"names":[],"mappings":"AAEA,oBAAY,WAAW;IACrB,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;IACF,EAAE,IAAA;CACH;AAED,8BAAsB,OAAO;IAC3B,MAAM,CAAC,MAAM;IAcb,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,WAAW;IAYnC,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW;IAYvC,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,WAAW;IAYxC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW;IAYlC,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG;CAOtD"}
|
|
@@ -36,6 +36,30 @@ class Closure {
|
|
|
36
36
|
return ClosureType.FO;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
static leftReverse(closure) {
|
|
40
|
+
switch (closure) {
|
|
41
|
+
case ClosureType.FF:
|
|
42
|
+
return ClosureType.OF;
|
|
43
|
+
case ClosureType.OO:
|
|
44
|
+
return ClosureType.FO;
|
|
45
|
+
case ClosureType.FO:
|
|
46
|
+
return ClosureType.OO;
|
|
47
|
+
case ClosureType.OF:
|
|
48
|
+
return ClosureType.FF;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
static rightReverse(closure) {
|
|
52
|
+
switch (closure) {
|
|
53
|
+
case ClosureType.OF:
|
|
54
|
+
return ClosureType.OO;
|
|
55
|
+
case ClosureType.OO:
|
|
56
|
+
return ClosureType.OF;
|
|
57
|
+
case ClosureType.FO:
|
|
58
|
+
return ClosureType.FF;
|
|
59
|
+
case ClosureType.FF:
|
|
60
|
+
return ClosureType.FO;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
39
63
|
static switch(closure) {
|
|
40
64
|
switch (closure) {
|
|
41
65
|
case ClosureType.FF:
|
|
@@ -18,6 +18,9 @@ export declare class IntervalNode implements SetNode {
|
|
|
18
18
|
toMathString(): string;
|
|
19
19
|
toMathjs(): string;
|
|
20
20
|
toReversedClosure(): IntervalNode;
|
|
21
|
+
toLeftReversedClosure(): IntervalNode;
|
|
22
|
+
toRightReversedClosure(): IntervalNode;
|
|
23
|
+
toRandomDifferentClosure(): IntervalNode;
|
|
21
24
|
toComplement(): IntervalNode | UnionIntervalNode;
|
|
22
25
|
toTex(): string;
|
|
23
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/sets/intervalNode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQtD,OAAO,EAAW,WAAW,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAa,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,YAAY,CAEzD;AACD,qBAAa,YAAa,YAAW,OAAO;IAC1C,IAAI,EAAE,QAAQ,CAAC;IACf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;IAStE,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW;IAMjC,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAoBpC,YAAY,CAAC,WAAW,CAAC,EAAE,IAAI;IA4B/B,YAAY;IAIZ,QAAQ;IAIR,iBAAiB;IAGjB,qBAAqB;IAGrB,sBAAsB;IAGtB,wBAAwB;IAWxB,YAAY;IAkCZ,KAAK;CAWN"}
|
|
@@ -63,6 +63,19 @@ class IntervalNode {
|
|
|
63
63
|
toReversedClosure() {
|
|
64
64
|
return new IntervalNode(this.a, this.b, closure_1.Closure.reverse(this.closure));
|
|
65
65
|
}
|
|
66
|
+
toLeftReversedClosure() {
|
|
67
|
+
return new IntervalNode(this.a, this.b, closure_1.Closure.leftReverse(this.closure));
|
|
68
|
+
}
|
|
69
|
+
toRightReversedClosure() {
|
|
70
|
+
return new IntervalNode(this.a, this.b, closure_1.Closure.rightReverse(this.closure));
|
|
71
|
+
}
|
|
72
|
+
toRandomDifferentClosure() {
|
|
73
|
+
return new IntervalNode(this.a, this.b, Math.random() < 0.3
|
|
74
|
+
? closure_1.Closure.leftReverse(this.closure)
|
|
75
|
+
: Math.random() < 0.3
|
|
76
|
+
? closure_1.Closure.reverse(this.closure)
|
|
77
|
+
: closure_1.Closure.rightReverse(this.closure));
|
|
78
|
+
}
|
|
66
79
|
toComplement() {
|
|
67
80
|
if ((0, infiniteNode_1.isInfiniteNode)(this.a) && (0, infiniteNode_1.isInfiniteNode)(this.b))
|
|
68
81
|
return this;
|
|
@@ -101,7 +101,7 @@ const buildTree = (tokens) => {
|
|
|
101
101
|
if (token === ")" || token === "}")
|
|
102
102
|
currentDepth--;
|
|
103
103
|
}
|
|
104
|
-
console.log("depthed: ", depthedTokens);
|
|
104
|
+
// console.log("depthed: ", depthedTokens);
|
|
105
105
|
while (true) {
|
|
106
106
|
if (maxDepth === 0) {
|
|
107
107
|
const tree = buildTreeForSameDepthTokens(depthedTokens.map((el) => el.token));
|
|
@@ -119,13 +119,13 @@ const buildTree = (tokens) => {
|
|
|
119
119
|
token: tree,
|
|
120
120
|
depth: token.depth - 1,
|
|
121
121
|
});
|
|
122
|
-
console.log(`depthed after iter ${i}`, depthedTokens);
|
|
122
|
+
// console.log(`depthed after iter ${i}`, depthedTokens);
|
|
123
123
|
}
|
|
124
124
|
maxDepth--;
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
const buildTreeForSameDepthTokens = (tokens) => {
|
|
128
|
-
console.log("start: ", tokens);
|
|
128
|
+
// console.log("start: ", tokens);
|
|
129
129
|
let tempTokens = [];
|
|
130
130
|
for (let i = 0; i < tokens.length; i++) {
|
|
131
131
|
const token = tokens[i];
|
|
@@ -148,7 +148,7 @@ const buildTreeForSameDepthTokens = (tokens) => {
|
|
|
148
148
|
else
|
|
149
149
|
throw Error(`token not implemented: ${token}`);
|
|
150
150
|
}
|
|
151
|
-
console.log("after parses : ", tempTokens);
|
|
151
|
+
// console.log("after parses : ", tempTokens);
|
|
152
152
|
//1 build les fct
|
|
153
153
|
for (let i = 0; i < tempTokens.length; i++) {
|
|
154
154
|
if (typeof tempTokens[i] !== "string")
|
|
@@ -210,7 +210,7 @@ const buildTreeForSameDepthTokens = (tokens) => {
|
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
console.log("after fcts: ", tempTokens);
|
|
213
|
+
// console.log("after fcts: ", tempTokens);
|
|
214
214
|
//3 build les *
|
|
215
215
|
let currentProduct;
|
|
216
216
|
let currentProductStartIndex;
|
|
@@ -251,7 +251,7 @@ const buildTreeForSameDepthTokens = (tokens) => {
|
|
|
251
251
|
}
|
|
252
252
|
//4 build les +
|
|
253
253
|
let currentAdd;
|
|
254
|
-
console.log("beforeAdd", tempTokens);
|
|
254
|
+
// console.log("beforeAdd", tempTokens);
|
|
255
255
|
for (let i = 0; i < tempTokens.length; i++) {
|
|
256
256
|
const token = tempTokens[i];
|
|
257
257
|
if (!currentAdd) {
|