-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path100K.html
More file actions
81 lines (81 loc) · 2.07 KB
/
100K.html
File metadata and controls
81 lines (81 loc) · 2.07 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
79
80
81
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Pi Visual Display (100K digits)</title>
<link rel="icon" href="pi.ico" type="image/x-icon"/>
<style>
body {
font-family: "Courier New", monospace;
background-color: #121212;
color: #00ffcc;
margin: 20px;
}
h1 {
text-align: center;
color: #ffffff;
}
.pi-box {
background-color: #1e1e1e;
border: 2px solid #00ffcc;
padding: 20px;
height: 500px;
overflow-y: scroll;
white-space: pre-wrap;
word-wrap: break-word;
font-size: 14px;
line-height: 1.6;
}
button {
width: 400px;
height: 70px;
font-size: 30px;
border-radius: 25px;
background-color: black;
color: #00ffcc;
border-color: #00ffcc;
box-shadow: 10px 10px 5px rgb(10, 10, 10);
self-align: center;
}
button:hover {
color: #3BC4A9;
border-color: #3BC4A9;
box-shadow: 10px 10px 5px rgb(20, 20, 20);
background-color: rgb(20, 20, 20);
cursor: pointer;
}
</style>
</head>
<body>
<h1>π (Pi) Digits - First 100,000</h1>
<div class="pi-box" id="piBox">
Loading digits of π...
</div>
<a href="https://antboi123.github.io/Pi-1.2/">
<button>Return</button>
</a>
<script>
fetch("pi_100000_digits.txt")
.then(response => response.text())
.then(data => {
// Format with spaces every 10 digits, newline every 100 digits
let output = '';
let count = 0;
for (let i = 0; i < data.length; i++) {
let char = data[i];
if (char === '.' || (char >= '0' && char <= '9')) {
output += char;
count++;
if (count % 10 === 0) output += ' ';
if (count % 100 === 0) output += '\n';
}
}
document.getElementById("piBox").textContent = "3." + output.substring(1);
})
.catch(err => {
document.getElementById("piBox").textContent = "Failed to load pi digits.";
console.error(err);
});
</script>
</body>
</html>