-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprimes.html
More file actions
78 lines (68 loc) · 2.52 KB
/
Copy pathprimes.html
File metadata and controls
78 lines (68 loc) · 2.52 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Watch the Sieve of Eratosthenes find primes interactively." />
<title>Prime Number Sieve – Fun With Math</title>
<link rel="stylesheet" href="../../css/style.css" />
<link rel="stylesheet" href="../../css/experiments-basic-primes.css" />
</head>
<body>
<nav>
<a class="brand" href="../../index.html">∑ Fun With Math</a>
<a href="../../index.html">← All Experiments</a>
</nav>
<div class="page-header">
<h1>Prime Number Sieve</h1>
<p>Watch the Sieve of Eratosthenes eliminate composites in real time.</p>
</div>
<div class="experiment-layout">
<div>
<div id="statsBar">
<span>Primes found: <strong id="primeCount">—</strong></span>
<span>Current factor: <strong id="currentFactor">—</strong></span>
<span>Step: <strong id="stepDisplay">—</strong></span>
</div>
<div id="grid"></div>
</div>
<aside class="controls">
<h3>Controls</h3>
<label>
Limit (n): <span id="limitLabel">200</span>
<input type="range" id="limitRange" min="20" max="400" step="10" value="200" />
</label>
<label>
Animation Speed
<select id="speed">
<option value="600">Slow</option>
<option value="250" selected>Medium</option>
<option value="80">Fast</option>
<option value="20">Very Fast</option>
</select>
</label>
<div style="display: flex; gap: 0.5rem; flex-wrap: wrap">
<button class="btn btn-primary" id="startBtn">▶ Start</button>
<button class="btn btn-secondary" id="resetBtn">↺ Reset</button>
</div>
<div class="info-box">
<h4>Primes</h4>
<div id="primeList">—</div>
</div>
<div class="info-box">
<h4>Algorithm</h4>
<ol style="padding-left: 1.2rem; line-height: 2">
<li>List integers 2 … n</li>
<li>Mark 2 as prime; cross out multiples</li>
<li>Find next unmarked number; repeat</li>
<li>All remaining numbers are prime</li>
</ol>
</div>
</aside>
</div>
<footer>
<p><a href="../../index.html">← Back to all experiments</a></p>
</footer>
<script src="../../js/experiments-basic-primes.js"></script>
</body>
</html>