Project Euler's solutions and boilerplate.
GPL-2.0 License
This platform has got everything you need to start solving Project Euler's challenges right away.
You can use this to compare your solutions to mine's and you can also use this project as a boilerplate.
If you want to read problems offline you can take a look at problems.txt, which is a courtesy of another awesome project called EulerPy.
Please read the instructions below so you can get to know how everything works.
Clone this repository
$ git clone https://github.com/lucasfcosta/project-euler-javascript
Run npm install
to install project's dependencies
If you want to use this as a boilerplate or a test platform you can delete every single file inside the solutions
folder
To run gulp tasks you will also need to install Gulp globally using npm install -g gulp
To write a solution for a problem you will need to:
module.exports
I think it's very simple but if you still need an example please take a look at the 001.js file, which is inside the solutions folder.
If you don't want to lint your code and check for code-style related issues you can run gulp mocha
, otherwise just run gulp test
.
To check the last solution only you should run gulp testLast
.
You can also configure the linting rules using the files .jsrsc
and .eslintrc
.
Currently I'm also using a timeout of 60000ms for tests (because that's what Euler Project recommends) but you can change that on the gulpfile.js
file. Just change 60000 to whatever you want.
Clone this, install gulp globally (npm install -g gulp
) and run gulp mocha
to check the solutions (name them with them problem's number) inside the solutions folder.