Euler6
forked from Euler2 (diff: 18)
ActionScript3 source code
/**
* Copyright enecre ( http://wonderfl.net/user/enecre )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/7kPt
*/
// forked from enecre's Euler2
package {
import flash.text.TextField;
import flash.display.Sprite;
public class Euler extends Sprite {
private var tf:TextField = new TextField();
public function Euler() {
// write as3 code here..
tf.height = 465
addChild(tf);
var a:int;
var b:int;
var l:int = 100;
while(l){
a += l * l;
b += l
l--;
}
b = b * b;
tr(a)
tr(b);
tr(b - a);
}
private function tr(o):void{
tf.appendText(o + "\n");
}
}
}
