Quine in ActionScript 3
In computing, a quine is a computer program which produces a copy of its own source code as its only output. For amusement, programmers sometimes attempt to develop the shortest possible quine in any given programming language.
While playing with wonderfl I have found a nice ActionScript quine solution from yonatan, which I decided to shorten. It would be shorter code using trace() but than you won’t be able to log/see output on wonderfl, thats why TextField is used.
… and here is the result:
The source code is the same as output:
package{ import flash.display.*; import flash.text.*; public class Quine extends Sprite{ public function Quine(){ var t:*=addChild(new TextField),q:*=<![CDATA[package{ import flash.display.*; import flash.text.*; public class Quine extends Sprite{ public function Quine(){ var t:*=addChild(new TextField),q:*=<![CDATA[2]>+''; t.text=q.replace(1+1,q+']'),t.width=t.height=465}}}]]>+''; t.text=q.replace(1+1,q+']'),t.width=t.height=465}}}
Feel free to try to fork it to even shorten source.
Another ActionScript quine attempts: