Euler JavaScript Implementation
All problems are solved in ES6+ Javascript
Organization
All javascript files share a common prefix with their problem number. Though it is currently not the case, some of these files may export utilities for other problems to use.
Makefile
There are eight recipes in this Makefile
dependencies
This recipe installs all the required and test dependencies. See the Dependencies section for more info
test
This recipe runs tests in a single thread and performs benchmarks on each. This test infrastructure is based on mocha and benchmark.js, though it currently does not export benchmark info except to fail tests for time limit reasons.
test_*
This recipe runs tests in the specified number of threads and performs benchmarks on each. This test infrastructure is based on mocha and benchmark.js, though it currently does not export benchmark info except to fail tests for time limit reasons. If you specify the number of threads as auto, it will default to using 1 fewer threads than you have CPUs.
dependencies
Install all dependencies for the NodeJS platform.
lint
This recipe runs es-lint on the JavaScript files.
bun_test
Run through all tests in sequence. Utilizes the bun runtime and test runner.
bun_dependencies
Installs bun and runs bun install.
webpack
Packages these tests for use in browsers.
clean
Remove any installed modules or webpack files.
Tests
Generic Problems
For each problem it will check the answer against a known dictionary. If the problem is not in the "known slow" category (meaning that I generate the correct answer with a poor solution), it will run it as many times as the benchmark plugin wants. Otherwise it is run exactly once*.
* This is a TODO for the Javascript section
A test fails if it gets the wrong answer or if it takes more than 1 minute.
Dependencies
I try to keep the dependencies of this project as small as possible, except for test plugins. At the moment there are no non-test dependencies for this section.
Live Tests
To run these problems in your browser, click here!
Library Code
Problems Solved
- JavaScript Implementation of Problem 1
- JavaScript Implementation of Problem 2
- JavaScript Implementation of Problem 3
- JavaScript Implementation of Problem 4
- JavaScript Implementation of Problem 5
- JavaScript Implementation of Problem 6
- JavaScript Implementation of Problem 7
- JavaScript Implementation of Problem 8
- JavaScript Implementation of Problem 9
- JavaScript Implementation of Problem 10
- JavaScript Implementation of Problem 11
- JavaScript Implementation of Problem 12
- JavaScript Implementation of Problem 13
- JavaScript Implementation of Problem 14
- JavaScript Implementation of Problem 15
- JavaScript Implementation of Problem 16
- JavaScript Implementation of Problem 17
- JavaScript Implementation of Problem 18
- JavaScript Implementation of Problem 19
- JavaScript Implementation of Problem 20
- JavaScript Implementation of Problem 21
- JavaScript Implementation of Problem 22
- JavaScript Implementation of Problem 23
- JavaScript Implementation of Problem 27
- JavaScript Implementation of Problem 28
- JavaScript Implementation of Problem 34
- JavaScript Implementation of Problem 35
- JavaScript Implementation of Problem 37
- JavaScript Implementation of Problem 41
- JavaScript Implementation of Problem 46
- JavaScript Implementation of Problem 60
- JavaScript Implementation of Problem 67
- JavaScript Implementation of Problem 76
- JavaScript Implementation of Problem 836