Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ardalis/eulernodestarter
A starting point for solving Project Euler problems using node.js
https://github.com/ardalis/eulernodestarter
Last synced: 3 days ago
JSON representation
A starting point for solving Project Euler problems using node.js
- Host: GitHub
- URL: https://github.com/ardalis/eulernodestarter
- Owner: ardalis
- License: mit
- Created: 2019-01-27T16:49:38.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-06-12T18:57:59.000Z (over 1 year ago)
- Last Synced: 2024-05-01T22:58:17.395Z (6 months ago)
- Language: JavaScript
- Size: 28.3 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EulerNodeStarter
A starting point for solving Project Euler problems using node.js.
## Give a Star! :star:
If you like this project, please give it a star. Thanks!
My progress:
![ardalis Euler Progress](https://projecteuler.net/profile/ardalis.png)
### Other Project Euler Starters
- [C# / .NET Core](https://github.com/ardalis/EulerCSharpStarter)
# Getting Started
You can either download/clone this repo, or probably better is to fork it to your own account. Then follow the instructions below.
[Install node / npm](https://nodejs.org/en/download/). If you don't already have it...
From the root of this repo's folder run the following commands. You only need the install step the first time you run it:
```
npm install
npm test
node index.js -p 1
```This should run the first solution in the solutions folder which is provided. You will need to calculate the correct answer. You'll find the description of the first problem [here](https://projecteuler.net/problem=1). After registering, you can submit your answer to see if it's correct:
![image](https://user-images.githubusercontent.com/782127/51804316-4780b200-222d-11e9-97df-6dcba080128d.png)
## npm test
You don't have to write tests but if you do they should go in the `spec/solutions` folder. An example is provided for the first problem. Currently it is failing because it's expecting -1 and the unimplemented Problem1 is returning 0, so you should see "Expected 0 to equal -1." You need to change the -1 to be the actual correct answer, and your code should return that answer at which point the test will pass.
To find the problems and verify your solutions go to ProjectEuler.net:
- [Problem List](https://projecteuler.net/archives)
- [Register](https://projecteuler.net/register) so you can track your progress## Video / YouTube
I set this up on a live stream from [twitch.tv/ardalis](https://www.twitch.tv/ardalis) and the [recording is on YouTube](https://www.youtube.com/watch?v=KELs9ksg6_s).
## Solutions (WARNING: SPOILERS)
My own implementation of these problems is in my [EulerNode](https://github.com/ardalis/EulerNode) repository. You should only look there if you get totally stuck on something yourself, though.