Ergo Fractal Program In Python
This is a Python 3 program that draws Ergo Symbol Fractal.
###
import turtle
t = turtle.Turtle()
wn = turtle.Screen()
wn.bgcolor("black")
t.color("white")
def DrawErgo(start, distance):
t.penup()
t.setposition(start[0], start[1])
t.pendown()
t.left(135)
t.forward(distance)
t.right(135)
t.forward(distance)
t.penup()
top = (t.xcor(), t.ycor())
t.setposition(start[0], start[1])
t.pendown()
t.goto(start[0], start[1])
t.right(135)
t.forward(distance)
t.left(135)
t.forward(distance)
bottom = (t.xcor(), t.ycor())
return (top, bottom)
def DrawErgoFractal():
start = (t.xcor(), t.ycor())
ErgoSize = 300
tSize = 6
t.turtlesize(tSize)
width = 15
t.width(width)
TopAndBottoms = [DrawErgo(start, ErgoSize)]
for i in TopAndBottoms:
n = len(TopAndBottoms) + 1
if (n & (n - 1) == 0) and n != 0:
tSize = tSize / 2
t.turtlesize(tSize)
ErgoSize = ErgoSize / 2
width = width / 2
t.width(width)
TopAndBottoms.append(DrawErgo(i[0], ErgoSize))
TopAndBottoms.append(DrawErgo(i[1], ErgoSize))
DrawErgoFractal()
turtle.done()
###
There are 1 token holders
Rich List