Addition/subtraction worksheet generator
What do you get when an unemployed software engineer needs to practice math with his kids? A worksheet generator, of course! Could I have just found some free worksheets online? Probably. But I was in the mood to write some code and an opportunity presented itself, so here we are.
The generator is pretty straightforward. You tell it what operation you want, the number of digits in each of the numbers, and whether carrying/borrowing is allowed. Then it creates a worksheet of random practice problems. (No negative numbers.)
The whole thing is implemented in a single HTML file. The trickiest part was ensuring that the random number generation didn’t produce a problem that required carrying/borrowing if it wasn’t allowed.
There are some unit tests built in to double check my code. Go to the page, open the developer console, and run test()
to see them at work.
You can access the generator right here on my site. As always, the source code is available in this site’s Git repository, and you can email me if you find bugs or have questions.