Skip to content

Commit 7487c3e

Browse files
authored
Create sarats_decoder.py
1 parent 96069b8 commit 7487c3e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

python/piInt/decoder.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/python
2+
3+
"""
4+
Original idea: Sarats on Discord
5+
"I came up with the worst number format in coding. You store two
6+
numbers - a stard and end index.
7+
And the value of the number is the digits of pi between those indexes
8+
3 = (0, 1)
9+
14 = (1, 3)
10+
69 = (41, 43)
11+
420 = (701, 704)
12+
"""
13+
14+
from mpmath import mp
15+
import sys
16+
17+
start = int(sys.argv[1])
18+
end = int(sys.argv[2])
19+
20+
mp.dps = 10000
21+
22+
pistr = mp.nstr(mp.pi, n = 10000).replace(".", "")
23+
print(pistr[start:end])

0 commit comments

Comments
 (0)