main.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
29
30
31
32
33
34
35
36
import turtle
t = turtle.Turtle()
t.speed(0)
def randomAdjust(m, a):
  t.forward(m)
  t.right(a)
def colorClamp(c):
    c %= 512
    return (c, 255-(c-256))[c >= 256]
import random
while True:
  count = random.randint(1,8)
  rad = []
  ang = []
  for i in range(0,count):
    rad.append(random.random())
    ang.append(random.random()*360)
    print(str(i)+" "+str(rad[i])+","+str(ang[i]))
  t.penup()
  t.goto(0,0)
  t.pendown()
  cr = (random.random() - random.random())*10
  cg = (random.random() - random.random())*10
  cb = (random.random() - random.random())*10
  for counter in range(0, 1000):
    t.width(counter/100)
    c = counter+1000
    r = colorClamp(c*cr)
    g = colorClamp(c*cg)
    b = colorClamp(c*cb)
    t.color(r,g,b)
    for i in range(0,count):
      randomAdjust(counter*rad[i], ang[i])
    p = t.pos()
    if p[0] < -300 or p[0] > 300 or p[1] < -300 or p[1] > 300:
      break
result
console