PY
py
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
import math
def digit_circle(r):
n = 0
r = int(r)
side = r * 2 + 1
c = side/2
out = [ [' ' for col in range(side*2-1)] for row in range(side) ]
for row in range(r+1):
angle = math.asin(-row/r)
col = 2*r*math.cos(angle)
out[round(r+row)][round(side+col-1)] = str(n)
n = (n + 1) % 10
for row in range(r-1,0,-1):
angle = math.asin(-row/r)
col = 2*r*math.cos(angle)
out[round(r+row)][round(side-col-1)] = str(n)
n = (n + 1) % 10
for row in range(0,-r,-1):
angle = math.asin(-row/r)
col = 2*r*math.cos(angle)
out[round(r+row)][round(side-col-1)] = str(n)
n = (n + 1) % 10
for row in range(-r,0):
angle = math.asin(-row/r)
col = 2*r*math.cos(angle)
out[round(r+row)][round(side+col-1)] = str(n)
n = (n + 1) % 10
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run