math-exercises 3.0.28 → 3.0.30

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.
Files changed (58) hide show
  1. package/lib/exercises/math/calcul/fractions/fractionSquare.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/fractions/fractionSquare.js +4 -0
  3. package/lib/exercises/math/calcul/fractions/fractionsProduct.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/fractions/fractionsProduct.js +4 -0
  5. package/lib/exercises/math/calcul/fractions/fractionsSubstraction.d.ts +11 -0
  6. package/lib/exercises/math/calcul/fractions/fractionsSubstraction.d.ts.map +1 -0
  7. package/lib/exercises/math/calcul/fractions/fractionsSubstraction.js +106 -0
  8. package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
  9. package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/fractions/index.js +1 -0
  11. package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +23 -7
  13. package/lib/exercises/math/calcul/proportionality/rectangleSideAfterReduction.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/proportionality/rectangleSideAfterReduction.js +4 -0
  15. package/lib/exercises/math/calcul/sign/signFromAx.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/sign/signFromAx.js +4 -0
  17. package/lib/exercises/math/calculLitteral/distributivity/index.d.ts +1 -1
  18. package/lib/exercises/math/calculLitteral/distributivity/index.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/distributivity/index.js +1 -1
  20. package/lib/exercises/math/calculLitteral/distributivity/simpleDistri.d.ts +9 -0
  21. package/lib/exercises/math/calculLitteral/distributivity/simpleDistri.d.ts.map +1 -0
  22. package/lib/exercises/math/calculLitteral/distributivity/simpleDistri.js +116 -0
  23. package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -1
  24. package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.js +5 -1
  25. package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.d.ts.map +1 -1
  26. package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.js +4 -0
  27. package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts.map +1 -1
  28. package/lib/exercises/math/dataRepresentations/functionGraphReading.js +4 -0
  29. package/lib/exercises/math/dataRepresentations/pieChartReading.d.ts.map +1 -1
  30. package/lib/exercises/math/dataRepresentations/pieChartReading.js +4 -0
  31. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
  32. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +4 -0
  33. package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -1
  34. package/lib/exercises/math/geometry/lines/linesRelativePositions.js +4 -0
  35. package/lib/exercises/math/geometry/thales/thales.d.ts +9 -9
  36. package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
  37. package/lib/exercises/math/geometry/thales/thales.js +153 -88
  38. package/lib/exercises/math/geometry/thales/thalesCalcul.js +2 -2
  39. package/lib/exercises/math/percent/findRightCalculForPriceEvolution.d.ts +10 -0
  40. package/lib/exercises/math/percent/findRightCalculForPriceEvolution.d.ts.map +1 -0
  41. package/lib/exercises/math/percent/findRightCalculForPriceEvolution.js +117 -0
  42. package/lib/exercises/math/percent/index.d.ts +1 -1
  43. package/lib/exercises/math/percent/index.d.ts.map +1 -1
  44. package/lib/exercises/math/percent/index.js +1 -1
  45. package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
  46. package/lib/exercises/math/powers/powersOfTenToDecimal.js +4 -0
  47. package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
  48. package/lib/exercises/math/powers/powersProduct.js +10 -14
  49. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -1
  50. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +4 -0
  51. package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -1
  52. package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.js +4 -0
  53. package/lib/index.d.ts +19 -18
  54. package/lib/index.d.ts.map +1 -1
  55. package/lib/tree/nodes/geometry/lengthNode.d.ts +2 -1
  56. package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
  57. package/lib/tree/nodes/geometry/lengthNode.js +7 -1
  58. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { AlgebraicNode } from "../algebraicNode.js";
2
2
  import { Node, NodeIds, NodeOptions, NodeType } from "../node.js";
3
3
  export declare function isLengthNode(a: Node): a is LengthNode;
4
+ export declare const length: (a: string) => LengthNode;
4
5
  export declare class LengthNode implements AlgebraicNode {
5
6
  opts?: NodeOptions | undefined;
6
7
  segmentName: string;
@@ -17,7 +18,7 @@ export declare class LengthNode implements AlgebraicNode {
17
18
  toMathjs(): string;
18
19
  toTex(): string;
19
20
  evaluate(vars?: Record<string, number>): number;
20
- simplify(): this;
21
+ simplify(): LengthNode;
21
22
  equals(node: AlgebraicNode): boolean;
22
23
  toDetailedEvaluation(vars: Record<string, AlgebraicNode>): this;
23
24
  derivative(varName?: string | undefined): AlgebraicNode;
@@ -1 +1 @@
1
- {"version":3,"file":"lengthNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/lengthNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MA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EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW;IAUnD,cAAc;IAGd,aAAa;;;;IAMb,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAOpC,YAAY;IAGZ,QAAQ;IAIR,KAAK;IAIL,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAQtC,QAAQ;IAOR,MAAM,CAAC,IAAI,EAAE,aAAa;IAG1B,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAGxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAGxD"}
@@ -2,6 +2,9 @@ import { NodeIds, NodeType } from "../node.js";
2
2
  export function isLengthNode(a) {
3
3
  return a.type === NodeType.mesure;
4
4
  }
5
+ export const length = (a) => {
6
+ return new LengthNode(a);
7
+ };
5
8
  export class LengthNode {
6
9
  opts;
7
10
  segmentName;
@@ -48,7 +51,10 @@ export class LengthNode {
48
51
  return value;
49
52
  }
50
53
  simplify() {
51
- return this;
54
+ const isAlphabeticallyOrdered = (str) => [...str].every((c, i, arr) => i === 0 || arr[i - 1] <= c);
55
+ return isAlphabeticallyOrdered(this.segmentName)
56
+ ? this
57
+ : new LengthNode(this.segmentName.split("").reverse().join(""));
52
58
  }
53
59
  equals(node) {
54
60
  return isLengthNode(node) && node.segmentName === this.segmentName;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-exercises",
3
3
  "type": "module",
4
- "version": "3.0.28",
4
+ "version": "3.0.30",
5
5
  "description": "Math exercises generator for middle school and high school",
6
6
  "main": "lib/index.js",
7
7
  "files": [