-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.py
More file actions
25 lines (23 loc) · 682 Bytes
/
test.py
File metadata and controls
25 lines (23 loc) · 682 Bytes
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
import sys
import math
# made a little test in python prior to writing the g code. i wish there was an open source app for plotting g code.
try:
num = 1
while num > 0:
s = len(str(num))
s597 = num
while s > 0:
s598 = s597 % 10
s597 = s597 / 10
calc = math.floor(s598)
answ = str(num)[s - 1]
s = s - 1
if int(calc) != int(answ):
raise Exception('we\'re porked.. {0} != {1}'.format(calc, answ))
num = num + 1
if (num > 10000000):
print('finished')
sys.exit(1)
except KeyboardInterrupt as i:
print(num)
sys.exit(1)