Loading design...

A beautiful hexagonal fractal pattern created with Python Turtle. Read the code below, copy it, and try it in your own Python environment.
from turtle import *
import colorsys
tracer(10)
bgcolor('black')
pensize(1)
speed(0)
def star_fractal(len, depth):
if depth == 0:
return
h = 0.1 + depth * 0.08
color(colorsys.hsv_to_rgb(h % 1, 1, 1))
for _ in range(6):
forward(len)
star_fractal(len * 0.4, depth - 1)
backward(len)
right(60)
up()
goto(0, 100)
down()
star_fractal(100, 5)
done()