from math import * from turtle import * def ucg(x,y,s,angle): pu() setheading(angle) goto(x,y) fd(s/3**0.5) rt(150) pd() fd(s) rt(120) fd(s) def tucg(x,y,s,angle,n): if n==0: return goto(x,y) ucg(x,y,s,angle) a=angle+60 for i in range(3): pu() goto(x,y) setheading(angle) fd(1.3*s) x1=xcor() y1=ycor() tucg(x1,y1,s/2.1,a,n-1) a+=120 tucg(0,50,200,90,7) update()