| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Mathsteps aims to provide step-by-step instructions like a tutor would give them to a student.
Mathsteps requires Node version > 6.0.0
To install mathsteps using npm:
(Coming)
npm install @taskbase/mathsteps
const mathsteps = require('mathsteps');
const steps = mathsteps.simplifyExpression('2x + 2x + x + x');
steps.forEach(step => {
console.log("before change: " + step.oldNode.toString()); // before change: 2 x + 2 x + x + x
console.log("change: " + step.changeType); // change: ADD_POLYNOMIAL_TERMS
console.log("after change: " + step.newNode.toString()); // after change: 6 x
console.log("# of substeps: " + step.substeps.length); // # of substeps: 3
});To solve an equation:
const steps = mathsteps.solveEquation('2x + 3x = 35');
steps.forEach(step => {
console.log("before change: " + step.oldEquation.ascii()); // e.g. before change: 2x + 3x = 35
console.log("change: " + step.changeType); // e.g. change: SIMPLIFY_LEFT_SIDE
console.log("after change: " + step.newEquation.ascii()); // e.g. after change: 5x = 35
console.log("# of substeps: " + step.substeps.length); // e.g. # of substeps: 2
});To see all the change types:
const changes = mathsteps.ChangeTypes;Simplifying Expressions
unsure:
Solving equations.
First clone the project from github:
git clone https://github.com/taskbase/mathsteps.git cd mathsteps
Install the project dependencies:
npm ci cd lib && npm ci && cd .. cd example-consumer && npm ci && cd ..
See scripts in package.json.
To execute tests for the library, install the project dependencies:
npm ci
Then, the tests can be executed:
npm test
Based on google/mathsteps
| Back | FazBrowse Home | New Git URL |