Forked from: yonatan's Quine diff:53 Quine作成中(まだ未完成) 作成中です。 under construction hirose_golf forked:2favorite:5lines:66license : MIT License modified : 2011-03-27 23:00:28 Embed Tweet // under construction // forked from yonatan's Quine package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFormat; import com.bit101.components.VScrollBar; public class Quine extends Sprite { public function Aaa(item:String, index:int, array:Array):String { var pre:String=String(index); while(pre.length<2){ pre=" "+pre; } return pre+" "+item; } public function Quine() { var tf:TextField = new TextField(); addChild(tf); tf.width = tf.height = 430; tf.background = true; tf.backgroundColor = 0x000000; tf.textColor = 0xffffff; tf.type = "input"; var format:TextFormat = new TextFormat(); format.size = 12; format.color = 0xffffff; format.font = "Courier New" format.leading = 4; tf.defaultTextFormat = format; var vs:VScrollBar; vs = new VScrollBar(this, tf.x + tf.width, tf.y); VScrollBar() var quine:String = <![CDATA[// forked from yonatan's Quine package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFormat; public class Quine extends Sprite { public function Quine() { var tf:TextField = new TextField(); addChild(tf); tf.width = tf.height = 465; tf.background = true; tf.backgroundColor = 0x000000; tf.textColor = 0xffffff; tf.type = "input"; var format:TextFormat = new TextFormat(); format.size = 12; format.color = 0xffffff; format.font = "Courier New" format.leading = 4; tf.defaultTextFormat = format; var quine:String = <![CDATA[@]>.toString(); tf.text = quine.replace(String.fromCharCode(64), quine + "]"); } } } ]]>.toString(); var pat:RegExp = /package|class|function|var/g; quine = quine.replace(pat, "<font color=\"#ff9f80\">$&</font>"); var pat2:RegExp = /import|public|extends|new|true/g; quine = quine.replace(pat2, "<font color=\"#ff5020\">$&</font>"); var qs: Array= quine.split("\n"); quine = qs.map(Aaa).join("\r"); tf.htmlText = quine.replace(String.fromCharCode(64), quine + "]"); } } } Code Fullscreen Preview Fullscreen Albert 9re novita001 andrewexex88.. xor : box2d box2d replace leading RegExp String.fromCharCode width TextFormat toString font height size join color split map String addChild text length Array Sprite sort new page view favorite forked pv236 forked from: Quine作成中(まだ未完成) kt3k forked:0 favorite:1lines:66 (diff:3) tag: pv3d pv0 forked from: Quine作成中(まだ未完成) stibium121 forked:0 favorite:0lines:66 (diff:1)