-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
186 lines (150 loc) · 8.63 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<html>
<head>
<title>
DKAllen78's Project Euler Solutions
</title>
<link rel="stylesheet" type="text/css" href="eulerStyle.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body onload="initializePage()">
<header>
<svg height="5rem" width="90vw">
<a href="https://dkallen78.github.io/Project-Euler-Files/projectEulerIndex.html">
<text id="euler" x="50%" y="50%" text-anchor="middle" dominant-baseline="middle">
Project Euler Repository
</text>
</a>
</svg>
<img src="https://projecteuler.net/profile/dkallen78.png" />
</header>
<div id="problems">
</div>
</body>
<script>
function initializePage() {
let problemIndex = 0;
let set1 = [
["https://dkallen78.github.io/Project-Euler-Files/Problem1.html", "Problem 1: Multiples of 3 and 5"],
["https://dkallen78.github.io/Project-Euler-Files/Problem2.html", "Problem 2: Even Fibonacci Numbers"],
["https://dkallen78.github.io/Project-Euler-Files/Problem3.html", "Problem 3: Largest Prime Factor (Prime List)"],
["https://dkallen78.github.io/Project-Euler-Files/Problem3.1.html", "Problem 3: Largest Prime Factor (Prime Seive)"],
["https://dkallen78.github.io/Project-Euler-Files/Problem4.html", "Problem 4: Largest Palindrome Product"],
["https://dkallen78.github.io/Project-Euler-Files/Problem5.1.html", "Problem 5: Smallest Multiple"]
];
let set2 = [
["https://dkallen78.github.io/Project-Euler-Files/Problem6.html","Problem 6: Sum Square Difference"],
["https://dkallen78.github.io/Project-Euler-Files/Problem7.html","Problem 7: 10,001st Prime"],
["https://dkallen78.github.io/Project-Euler-Files/Problem8.html","Problem 8: Largest Product in a Series"],
["https://dkallen78.github.io/Project-Euler-Files/Problem9.html","Problem 9: Special Pythagorean Triplet"],
["https://dkallen78.github.io/Project-Euler-Files/Problem10.html","Problem 10: Summation of Primes (Primality Test)"],
["https://dkallen78.github.io/Project-Euler-Files/Problem10.1.html","Problem 10: Summation of Primes (Prime Seive)"]
];
let set3 = [
["https://dkallen78.github.io/Project-Euler-Files/Problem11.html","Problem 11: Largest Product in a Grid"],
["https://dkallen78.github.io/Project-Euler-Files/Problem12.html","Problem 12: Highly Divisible Triangle Number"],
["https://dkallen78.github.io/Project-Euler-Files/Problem13.html","Problem 13: Large Sum"],
["https://dkallen78.github.io/Project-Euler-Files/Problem14.html","Problem 14: Longest Collatz Sequence (Brute Force)"],
["https://dkallen78.github.io/Project-Euler-Files/Problem14.1.html","Problem 14: Longest Collatz Sequence (Stored Values)"],
["https://dkallen78.github.io/Project-Euler-Files/Problem15.html","Problem 15: Lattice Paths"]
];
let set4 = [
["https://dkallen78.github.io/Project-Euler-Files/Problem16.html","Problem 16: Power Digit Sum"],
["https://dkallen78.github.io/Project-Euler-Files/Problem17.html","Problem 17: Number Letter Counts"],
["https://dkallen78.github.io/Project-Euler-Files/Problem18.html","Problem 18: Maximum Path Sum I"],
["https://dkallen78.github.io/Project-Euler-Files/Problem19.html","Problem 19: Counting Sundays"],
["https://dkallen78.github.io/Project-Euler-Files/Problem20.html","Problem 20: Factorial Digit Sum"],
];
let set5 = [
["https://dkallen78.github.io/Project-Euler-Files/Problem21.html","Problem 21: Amicable Numbers"],
["https://dkallen78.github.io/Project-Euler-Files/Problem22.html","Problem 22: Names Scores"],
["https://dkallen78.github.io/Project-Euler-Files/Problem23.1.html","Problem 23: Non-abundant Sums"],
["https://dkallen78.github.io/Project-Euler-Files/Problem24.html","Problem 24: Lexicographic Permutations"],
["https://dkallen78.github.io/Project-Euler-Files/Problem25.html","Problem 25: 1,000-Digit Fibonacci Number"],
];
let set6 = [
["https://dkallen78.github.io/Project-Euler-Files/Problem26.html","Problem 26: Reciprocal Cycles"],
["https://dkallen78.github.io/Project-Euler-Files/Problem27.html","Problem 27: Quadratic Primes"],
["https://dkallen78.github.io/Project-Euler-Files/Problem28.html","Problem 28: Number Spiral Diagonals"],
["https://dkallen78.github.io/Project-Euler-Files/Problem29.html","Problem 29: Distinct Powers (Linear Search/Insert)"],
["https://dkallen78.github.io/Project-Euler-Files/Problem29.1.html","Problem 29: Distinct Powers (Binary Insert)"],
["https://dkallen78.github.io/Project-Euler-Files/Problem30.html","Problem 30: Digit Fifth Powers"],
];
let set7 = [
["https://dkallen78.github.io/Project-Euler-Files/Problem31.html","Problem 31: Coin Sums"],
["https://dkallen78.github.io/Project-Euler-Files/Problem32.html","Problem 32: Pandigital Products"],
["https://dkallen78.github.io/Project-Euler-Files/Problem33.html","Problem 33: Digit Cancelling Fractions"],
["https://dkallen78.github.io/Project-Euler-Files/Problem34.html","Problem 34: Digit Factorials"],
["https://dkallen78.github.io/Project-Euler-Files/Problem35.html","Problem 35: Circular Primes"],
];
let set8 = [
["https://dkallen78.github.io/Project-Euler-Files/Problem36.html","Problem 36: Double-base Palindromes"],
]
let links = [set1, set2, set3, set4, set5, set6, set7, set8];
let problems = document.getElementById("problems");
let divNext = document.createElement("div");
divNext.id = "divNext";
divNext.innerHTML = "Next";
divNext.onclick = function() {
problemIndex++;
nextPage(problemIndex, links, -180);
}
problems.appendChild(divNext);
let br = document.createElement("br");
problems.appendChild(br);
for (let i = 0; i < links[problemIndex].length; i++) {
let a = document.createElement("a");
let br = document.createElement("br");
problems.appendChild(br);
a.href = links[problemIndex][i][0];
a.text = links[problemIndex][i][1];
problems.appendChild(a);
br = document.createElement("br");
problems.appendChild(br);
}
}
function nextPage(problemIndex, links, flipDirection) {
let problems = document.getElementById("problems");
requestAnimationFrame(function() {
problems.style.transform = "rotateY(" + flipDirection + "deg)";
});
setTimeout(function() {
problems.innerHTML = "";
if (problemIndex > 0) {
let divPrev = document.createElement("div");
divPrev.id = "divPrev";
divPrev.innerHTML = "Previous";
divPrev.onclick = function() {
problemIndex--;
nextPage(problemIndex, links, 180);
}
problems.appendChild(divPrev);
}
if (problemIndex < links.length - 1) {
let divNext = document.createElement("div");
divNext.id = "divNext";
divNext.innerHTML = "Next";
divNext.onclick = function() {
problemIndex++;
nextPage(problemIndex, links, -180);
}
problems.appendChild(divNext);
}
let br = document.createElement("br");
br = document.createElement("br");
problems.appendChild(br);
for (let i = 0; i < links[problemIndex].length; i++) {
let a = document.createElement("a");
let br = document.createElement("br");
problems.appendChild(br);
a.href = links[problemIndex][i][0];
a.text = links[problemIndex][i][1];
problems.appendChild(a);
br = document.createElement("br");
problems.appendChild(br);
}
}, 250);
setTimeout(function() {problems.style.transform = "";}, 500);
}
</script>
</html>