import icons

def fractangle(x, y, w, n, s):
    k=w/2+w/4
    r=w/2
    
    if n%2==1:
        col=['red', 'blue']
        rot=50
    else:
        col=['yellow', 'cyan']
        rot=330
    if n>0:
        if s in set('udla'):

            fractangle (x-k, y, r, n-1, s='l')
        if s in set('udra'):
            fractangle (x+k, y, r, n-1, s='r')
        if s in set('rdla'):
            fractangle (x, y-k, r, n-1, s='d')
        if s in set('urla'):
            fractangle (x, y+k, r, n-1, s='u')

    icons.Wrench(x=x,
              y=y,
              width=w,
              height=w,
              color=col, 
              rotation=rot)
background = Rectangle(color=['', 'blue'])
fractangle(x=50, y=50, w=30, n=4, s='a')

kovyor

by Nkta

Created 1 year, 8 months ago.