-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblackAndWhite.html
84 lines (81 loc) · 1.85 KB
/
blackAndWhite.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<link
href="https://fonts.googleapis.com/css2?family=Poppins&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./style.css"
/>
<title>Mersenne Visualizer</title>
</head>
<body>
<header>
<h1>Mersenne Twister Visualizer</h1>
</header>
<nav>
<ul class="nav-list">
<li>
<a
class="nav-links"
href="./index.html"
>Home</a
>
</li>
<li>
<a
class="nav-links"
href="./Random Colors.html"
>Random Colors</a
>
</li>
<li>
<a
class="nav-links"
href="./blackAndWhite.html"
><u>Heat Map</u></a
>
</li>
<li>
<a
class="nav-links"
href="./javascript.html"
>JavaScript Code</a
>
</li>
</ul>
</nav>
<div class="center">
<p>
Please wait a couple seconds for the algorithm to do its stuff:)
</p>
</div>
<canvas id="canvas2"></canvas>
<div class="tooltip">
<u class="more-info">More info</u>
<span class="tooltiptext">
Rather than looping through every single pixel, this algorithm
counts the number of pixels in the canvas, and then generates
'random' x and y values to select 'random' pixels. Instead of
each pixel getting selected once, some will be selected multiple
times while others aren't selected at all. Every time a pixel is
randomly selected it increases the redness of that pixel. This
in essence will give us a 'heat map' to show us how spread out
the Mersenne Twister numbers are. A bad PRNG will have clumps or
areas that are 'hotter' than others and a good one will be quite
uniform.
</span>
</div>
<script
type="module"
src="canvas2.js"
></script>
</body>
</html>