Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/adityasharat/math-problem-generator-js

Generate simple math problems and test their results
https://github.com/adityasharat/math-problem-generator-js

education javascript-library learn library math

Last synced: 3 months ago
JSON representation

Generate simple math problems and test their results

Awesome Lists containing this project

README

        

# Math Problem Generator

> Generate random math problems and test their results

[![NPM](https://img.shields.io/npm/v/math-problem-generator.svg)](https://www.npmjs.com/package/math-problem-generator) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save math-problem-generator
```

## Usage

```JavaScript
import MathProblems from 'math-problem-generator'

const evaluator = MathProblems.getEvaluator();
evaluator.evaluate('2+2'); // 4

const generator = MathProblems.getGenerator(1);
let problem = generator.next(); // {x: , y: , op: ''}
problem.evaluate(); // returns the result
```

## License

Apache v2.0 © [adityasharat](https://github.com/adityasharat) 2018