pygame is
pygame.org is
|
Tiny Fractals
Tiny Fractals - 145 bytesVitor Bosshard (algorias)Tags:DescriptionA tiny iterated function system, generates a Sierpinski Gasket and other fractals. from pygame import* w=256 z=w,w l=[z] d=display s=d.set_mode(z) for e in l: x,y=e s.set_at(e,e+e) x/=2;y/=2 l+=(x,y),(x,y+w),(x+w,y+w) d.flip()And here's the code in compact form: from pygame import*;w=256;z=w,w;l=[z];d=display;s=d.set_mode(z) for e in l:x,y=e;s.set_at(e,e+e);x/=2;y/=2;l+=(x,y),(x,y+w),(x+w,y+w);d.flip() Changesremoved init(), as seen in NanoSnake! Links
ScreenshotReleases
Pygame.org account CommentsIf you wish to leave a comment with your pygame.org account, please sign in first.
|
|