-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable js docs, disable failing c docs
- Loading branch information
1 parent
86422c9
commit f30c888
Showing
9 changed files
with
63 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ Problems Solved | |
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
.. javascript/p0001.rst | ||
javascript/p0001.rst | ||
javascript/p0002.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
JavaScript Implementation of Problem 2 | ||
====================================== | ||
|
||
View source code `here on GitHub! <https://github.com/LivInTheLookingGlass/Euler/blob/master/javascript/p0002.js>`_ | ||
|
||
.. js:autofunction:: p0002 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
/* | ||
Project Euler Template | ||
This template is used to format Project Euler solution scripts. This paragraph | ||
should be replaced by a description of how I approached the problem, as well as | ||
critque. | ||
This paragraph should be replaced by the problem description, excluding images. | ||
*/ | ||
|
||
exports.main = function() { | ||
/** | ||
* Project Euler Template | ||
* | ||
* This template is used to format Project Euler solution scripts. This paragraph | ||
* should be replaced by a description of how I approached the problem, as well as | ||
* critque. | ||
* | ||
* This paragraph should be replaced by the problem description, excluding images. | ||
**/ | ||
|
||
exports.p0000 = function() { | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
/* | ||
Project Euler Problem 1 | ||
Did this the old fashioned way, because this was before I figured out the closed form solution | ||
Problem: | ||
If we list all the natural numbers below 10 that are multiples of 3 or 5, we | ||
get 3, 5, 6 and 9. The sum of these multiples is 23. | ||
Find the sum of all the multiples of 3 or 5 below 1000. | ||
/** | ||
Check failure on line 1 in javascript/p0001.js GitHub Actions / javascript-lint
|
||
* Project Euler Problem 1 | ||
* | ||
* Did this the old fashioned way, because this was before I figured out the closed form solution | ||
* | ||
* Problem: | ||
* | ||
* If we list all the natural numbers below 10 that are multiples of 3 or 5, we | ||
* get 3, 5, 6 and 9. The sum of these multiples is 23. | ||
* | ||
* Find the sum of all the multiples of 3 or 5 below 1000. | ||
*/ | ||
|
||
exports.main = function() { | ||
exports.p0001 = function() { | ||
let answer = 0; | ||
for (let i = 3; i < 1000; i += 3) { | ||
answer += i; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
/* | ||
Project Euler Problem 2 | ||
Moved the fibonacci optimization to javascript | ||
Problem: | ||
Each new term in the Fibonacci sequence is generated by adding the previous two | ||
terms. By starting with 1 and 2, the first 10 terms will be: | ||
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... | ||
By considering the terms in the Fibonacci sequence whose values do not exceed | ||
four million, find the sum of the even-valued terms. | ||
*/ | ||
|
||
exports.main = function() { | ||
/** | ||
Check failure on line 1 in javascript/p0002.js GitHub Actions / javascript-lint
|
||
* Project Euler Problem 2 | ||
* | ||
* Moved the fibonacci optimization to javascript | ||
* | ||
* Problem: | ||
* | ||
* Each new term in the Fibonacci sequence is generated by adding the previous two | ||
* terms. By starting with 1 and 2, the first 10 terms will be: | ||
* | ||
* 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... | ||
* | ||
* By considering the terms in the Fibonacci sequence whose values do not exceed | ||
* four million, find the sum of the even-valued terms. | ||
**/ | ||
exports.p0002 = function() { | ||
// for a proof on why this formulation works, see python/p0002.py | ||
let answer = 0; | ||
let i = 2; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters