flash on 2009-10-13

by RobotCaleb
♥0 | Line 24 | Modified 2009-10-13 02:50:02 | MIT License
play

ActionScript3 source code

/**
 * Copyright RobotCaleb ( http://wonderfl.net/user/RobotCaleb )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/oxh8
 */

package {
    import flash.display.Sprite;
    import flash.text.*;
    public class FlashTest extends Sprite {
        
        public var t:TextField;
        public function FlashTest()
        {
            t  = new TextField();
            t.text = "Hello";
            t.width = 300;
            addChild(t);
           var n:Number = 600851475143;
           factors(n);
        }
        
        public function factors(n:Number, f:Number = 1):void
        {
             if(n%f==0)
                t.text += "\n" + n.toString() + " : " + f.toString();
            
             if(f==n)
                   return;
            
             factors(n, f+1);
        }
    }
}