pygame is
Simple DirectMedia Layer is
Site Swing
Chaos Game Fractal Generator

Chaos Game Fractal Generator - 1.0

Charlie Harrison (theratking)



From Wikipedia: In mathematics, the term chaos game, as coined by Michael Barnsley, originally referred to a method of creating a fractal, using a polygon and an initial point selected at random inside it. The fractal is created by iteratively creating a sequence of points, starting with the initial random point, in which each point in the sequence is a given fraction of the distance between the previous point and one of the vertices of the polygon; the vertex is chosen at random in each iteration. Repeating this iterative process a large number of times, selecting the vertex at random on each iteration, and throwing out the first few points in the sequence, will often (but not always) produce a fractal shape. Using a regular triangle and the factor 1/2 will result in the Sierpinski triangle.


Q and A control the x-component factor for all vertices

W and S control the y-component factor for all vertices

R and F control the x factor for a highlighted vertex

T and G control the y factor for a highlighted vertex


(EDIT: sorry I totally forgot these essential controls!)

SPACE adds a vertex

D removes a vertex

If you're looking for inspiration, try making a square with 3 boxes per side and an x and y factor of .7 for Sierpinski's Gasket.


Home Page:


click to view original size


Chaos Game Fractal Generator - 1.0 - Jan 21, 2011 account Comments

If you wish to leave a comment with your account, please sign in first.

January 22, 2011 6:45pm - Jeremy - nickname: (jh4) - 5/5
this is f***ing awesome. Try making a snowflake with 5-8 sides.

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Feb 12, 2016

Feb 7, 2016

Feb 4, 2016

Jan 30, 2016

Jan 24, 2016

Jan 23, 2016

Jan 18, 2016

Jan 5, 2016

Dec 27, 2015

Dec 12, 2015

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)