Fibonacci Freeze

by andrewexex886
♥0 | Line 19 | Modified 2011-11-09 23:50:00 | MIT License
play

ActionScript3 source code

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

package {
    import flash.text.TextField;
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        private var N:int=7;
        private var Arr:Array=[0,1];
        public function FlashTest() {
            var tf:TextField=new TextField();
            tf.text="";
            tf.width=tf.height=450;
            addChild(tf);
            
            var step:int;
            for(step=2;step<=N;step++){
                Arr[step]=Arr[step-1]+Arr[step-2];
            }
            tf.text=String(Arr)+"\nYour Order: "+String(Arr[N]);

            
        }
    }
}