forked from: Binary Squares
Binary Squares
@see "Alt.Fractals: A Visual Guide to Fractal Geometry and Design" P.186
http://amzn.to/nb2zaC
@see http://www.alt-fractals.com/
faster version :)
/**
* Copyright makc3d ( http://wonderfl.net/user/makc3d )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/pU9M
*/
// forked from Aquioux's Binary Squares
package {
import flash.display.Sprite;
[SWF(width = "512", height = "512", frameRate = "30", backgroundColor = "#FFFFFF")]
/**
* Binary Squares
* @see "Alt.Fractals: A Visual Guide to Fractal Geometry and Design" P.186
* http://amzn.to/nb2zaC
* @see http://www.alt-fractals.com/
* faster version :)
*/
public class Main extends Sprite {
public function Main():void {
var sw:int = stage.stageWidth;
var sh:int = stage.stageHeight;
var w2:Number = sw / 2;
graphics.beginFill (0);
graphics.drawRect (0, 0, w2, sh); rec (w2, w2);
}
public function rec (at:Number, w:Number):void {
if (w > 1) {
var w2:Number = w / 2
graphics.drawRect (at - w2, 0, w, w);
rec (at - w2, w2); rec (at + w2, w2);
}
}
}
}