()
| 24 | running = False |
| 25 | |
| 26 | def main(): |
| 27 | global running |
| 28 | clearscreen() |
| 29 | bgcolor("gray10") |
| 30 | tracer(False) |
| 31 | shape("triangle") |
| 32 | f = 0.793402 |
| 33 | phi = 9.064678 |
| 34 | s = 5 |
| 35 | c = 1 |
| 36 | # create compound shape |
| 37 | sh = Shape("compound") |
| 38 | for i in range(10): |
| 39 | shapesize(s) |
| 40 | p =get_shapepoly() |
| 41 | s *= f |
| 42 | c *= f |
| 43 | tilt(-phi) |
| 44 | sh.addcomponent(p, (c, 0.25, 1-c), "black") |
| 45 | register_shape("multitri", sh) |
| 46 | # create dancers |
| 47 | shapesize(1) |
| 48 | shape("multitri") |
| 49 | pu() |
| 50 | setpos(0, -200) |
| 51 | dancers = [] |
| 52 | for i in range(180): |
| 53 | fd(7) |
| 54 | tilt(-4) |
| 55 | lt(2) |
| 56 | update() |
| 57 | if i % 12 == 0: |
| 58 | dancers.append(clone()) |
| 59 | home() |
| 60 | # dance |
| 61 | running = True |
| 62 | onkeypress(stop) |
| 63 | listen() |
| 64 | cs = 1 |
| 65 | while running: |
| 66 | ta = -4 |
| 67 | for dancer in dancers: |
| 68 | dancer.fd(7) |
| 69 | dancer.lt(2) |
| 70 | dancer.tilt(ta) |
| 71 | ta = -4 if ta > 0 else 2 |
| 72 | if cs < 180: |
| 73 | right(4) |
| 74 | shapesize(cs) |
| 75 | cs *= 1.005 |
| 76 | update() |
| 77 | return "DONE!" |
| 78 | |
| 79 | if __name__=='__main__': |
| 80 | print(main()) |
no test coverage detected
searching dependent graphs…