In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

coprime triangle

これじゃよくわからないな
Get Adobe Flash player
by uwi 01 Oct 2009
    Embed
/**
 * Copyright uwi ( http://wonderfl.net/user/uwi )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/bh5G
 */

package {
    import flash.display.*;
    
    // これじゃよくわからないな
    public class FlashTest extends Sprite {
        public function FlashTest() {
            var bmd : BitmapData = new BitmapData(465, 465, false, 0x000000);
            var bmp : Bitmap = new Bitmap(bmd);
            addChild(bmp);
            
            for(var i : int = 1;i <= 465;i++){
                for(var j: int = 1;j <= i;j++){
                    if(GCD(i, j) == 1)bmd.setPixel(i - 1, j - 1, 0xffffff);
                }
            }
        }
        
        public static function GCD(a : int, b : int) : int
        {
            return b == 0 ? a : GCD(b, a % b);
        }
    }
}