forked from: ---- -- ----

by mash forked from ---- -- ---- (diff: 3)
♥0 | Line 54 | Modified 2010-02-23 03:15:41 | MIT License
play

ActionScript3 source code

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

// forked from psyark's ---- -- ----
package {
	import flash.text.TextFormat;
	import flash.display.Sprite;
	import flash.text.TextField;

	public class Decoder extends Sprite {
		private var index:int = 0;
		private var array:Array = [];
		private var stack:Array = [];
		private var tf:TextField;
		
		public function Decoder() {
			tf = new TextField();
			tf.autoSize = "left";
			tf.defaultTextFormat = new TextFormat(null, 60);
			addChild(tf);
// ↓↓↓↓↓

//mmm, I didnt know how to write brainf*ck

// ↑↑↑↑↑
		}
		private function get ():int {
			for each (var s:Array in stack) s.push(arguments.callee);
			return ++index;
		}
		private function get ():int {
			for each (var s:Array in stack) s.push(arguments.callee);
			return --index;
		}
		private function get ():int {
			for each (var s:Array in stack) s.push(arguments.callee);
			array[index] ||= 0;
			return ++array[index];
		}
		private function get ():int {
			for each (var s:Array in stack) s.push(arguments.callee);
			array[index] ||= 0;
			return --array[index];
		}
		private function get ():int {
			for each (var s:Array in stack) s.push(arguments.callee);
			stack.push([]);
			return 0;
		}
		private function get ᐨᐨ():int {
			var loop:Array = stack.pop();
			var t:Array = stack;
			stack = [];
			while (array[index]) for each (var f:Function in loop) f();
			stack = t;
			for each (var s:Array in stack) s.push(arguments.callee);
			return 0;
		}
		private function get ():int {
			for each (var s:Array in stack) s.push(arguments.callee);
			tf.appendText(String.fromCharCode(array[index]));
			return 0;
		}
	}
}