<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Unconditional Contest</title>
	<atom:link href="http://www.as3dp.com/2007/12/31/unconditional-contest/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.as3dp.com/2007/12/31/unconditional-contest/</link>
	<description>OOP for Flash, Flex and AIR</description>
	<pubDate>Mon, 08 Sep 2008 14:37:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: john page</title>
		<link>http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-465</link>
		<dc:creator>john page</dc:creator>
		<pubDate>Wed, 30 Jan 2008 16:49:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-465</guid>
		<description>AS3 example I edited from tutorial....

package{
	
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	//abstract class
	
	public class AnimatingProperties extends Sprite{
		
		private var _sprite:Sprite;
		private var _k:Number=0.1;
		private var _damp:Number=0.9;
		private var _scaleVel:Number=0;
		private var _targetScale:Number=1;
		private var _click:Number=0;
		
		
		public function AS3CB(){
			
			_sprite = new Sprite();
			_sprite.graphics.beginFill(0x0000,100);
			_sprite.graphics.drawRect(-50,-50,100,100);
			_sprite.graphics.endFill();
			_sprite.x=100;
			_sprite.y=100;
			addChild(_sprite);
			addEventListener(Event.ENTER_FRAME,onEnterFrame);
			_sprite.addEventListener(MouseEvent.CLICK,onClick);
		};
		
		public function onEnterFrame(event:Event):void{
			_scaleVel += (_targetScale - _sprite.scaleX) * _k;
			_sprite.scaleX += _scaleVel;
			_sprite.scaleY = _sprite.scaleX;
			_scaleVel *= _damp;
		};
		
		public function onClick(event:MouseEvent):void{
		
/**---------TRYING TO AVOID USING IF ELSE ETC------------**/	
			_click++;
			
			var b = _click &#62;= 2;
			
			_targetScale = _targetScale * 2 - .5
			
			while(b){
			_targetScale -= _targetScale -= .5 * 2;
			_click = 0;
			 break;
				}
			
		};
		
		
	}
}</description>
		<content:encoded><![CDATA[<p>AS3 example I edited from tutorial&#8230;.</p>
<p>package{</p>
<p>	import flash.display.Sprite;<br />
	import flash.events.Event;<br />
	import flash.events.MouseEvent;</p>
<p>	//abstract class</p>
<p>	public class AnimatingProperties extends Sprite{</p>
<p>		private var _sprite:Sprite;<br />
		private var _k:Number=0.1;<br />
		private var _damp:Number=0.9;<br />
		private var _scaleVel:Number=0;<br />
		private var _targetScale:Number=1;<br />
		private var _click:Number=0;</p>
<p>		public function AS3CB(){</p>
<p>			_sprite = new Sprite();<br />
			_sprite.graphics.beginFill(0&#215;0000,100);<br />
			_sprite.graphics.drawRect(-50,-50,100,100);<br />
			_sprite.graphics.endFill();<br />
			_sprite.x=100;<br />
			_sprite.y=100;<br />
			addChild(_sprite);<br />
			addEventListener(Event.ENTER_FRAME,onEnterFrame);<br />
			_sprite.addEventListener(MouseEvent.CLICK,onClick);<br />
		};</p>
<p>		public function onEnterFrame(event:Event):void{<br />
			_scaleVel += (_targetScale - _sprite.scaleX) * _k;<br />
			_sprite.scaleX += _scaleVel;<br />
			_sprite.scaleY = _sprite.scaleX;<br />
			_scaleVel *= _damp;<br />
		};</p>
<p>		public function onClick(event:MouseEvent):void{</p>
<p>/**&#8212;&#8212;&#8212;TRYING TO AVOID USING IF ELSE ETC&#8212;&#8212;&#8212;&#8212;**/<br />
			_click++;</p>
<p>			var b = _click &gt;= 2;</p>
<p>			_targetScale = _targetScale * 2 - .5</p>
<p>			while(b){<br />
			_targetScale -= _targetScale -= .5 * 2;<br />
			_click = 0;<br />
			 break;<br />
				}</p>
<p>		};</p>
<p>	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john</title>
		<link>http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-464</link>
		<dc:creator>john</dc:creator>
		<pubDate>Wed, 30 Jan 2008 14:32:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-464</guid>
		<description>Ok, sorry for so many posts.... yeah its the code of a maniac hehe... anyways I i tried &#38; fixed it .. realized I didnt need alot of things...Its a great exercise in that it makes you think...it really is not easy...
&lt;pre lang="actionscript"&gt;
//Thanks, John Page

var test:String = "test me"+1;

function BooleanFactory(arg):Number{
	
		var State=0;

		if(arg.substr(-1) == 1){
			State=1;
		}
		
		return State;
};


circumventConditional();

function circumventConditional(){
	
		var c:Number = BooleanFactory(test);
	
		var a = 1;

		while(a * c){
		trace('State == true, trace called, State value=  '+c)
		break;
		}
		
		while(a &#62; c){
		trace('State == false, call some other function instead, State value= '+c);
		break;
		}
		

};
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Ok, sorry for so many posts&#8230;. yeah its the code of a maniac hehe&#8230; anyways I i tried &amp; fixed it .. realized I didnt need alot of things&#8230;Its a great exercise in that it makes you think&#8230;it really is not easy&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">//Thanks, John Page</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> test:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;test me&quot;</span>+<span style="color: #cc66cc;">1</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> BooleanFactory<span style="color: #66cc66;">&#40;</span>arg<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">var</span> State=0;
&nbsp;
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>arg.<span style="color: #0066CC;">substr</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			State=<span style="color: #cc66cc;">1</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">return</span> State;
<span style="color: #66cc66;">&#125;</span>;
&nbsp;
&nbsp;
circumventConditional<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> circumventConditional<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">var</span> c:<span style="color: #0066CC;">Number</span> = BooleanFactory<span style="color: #66cc66;">&#40;</span>test<span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #000000; font-weight: bold;">var</span> a = <span style="color: #cc66cc;">1</span>;
&nbsp;
		<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>a <span style="color: #66cc66;">*</span> c<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'State == true, trace called, State value=  '</span>+c<span style="color: #66cc66;">&#41;</span>
		<span style="color: #b1b100;">break</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>a <span style="color: #66cc66;">&amp;</span>gt; c<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'State == false, call some other function instead, State value= '</span>+c<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #b1b100;">break</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #66cc66;">&#125;</span>;</pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: john page</title>
		<link>http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-463</link>
		<dc:creator>john page</dc:creator>
		<pubDate>Wed, 30 Jan 2008 14:10:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-463</guid>
		<description>&lt;pre lang="actionscript"&gt;
/* work around for else if conditional */

//Ok, so this only works if you append a zero or one
//to the end of your string. but it does get around the ‘if else’ dont it?
//yes its not very fancy…but Thanks for letting me participate.
//Best, John Page

//DUH!, just realized I dont need c * 1

var test:String = “test me”+1;

function BooleanFactory(arg):Number{

var State=0;

for(var i=0; i&#60;arg.length; i++){
if(arg.substr(-1) == 1){
State=1;
}
}
trace(’State ‘+State)
return State;
};

circumventConditional();

function circumventConditional(){

var c:Number = BooleanFactory(test);

var a = 1;

while(a == c){
trace(’State == true, trace called, State value= ‘+c)
break;
}

while(a != c){
trace(’State == false, call some other function instead, State value= ‘+c);
break;
}

};
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* work around for else if conditional */</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//Ok, so this only works if you append a zero or one</span>
<span style="color: #808080; font-style: italic;">//to the end of your string. but it does get around the ‘if else’ dont it?</span>
<span style="color: #808080; font-style: italic;">//yes its not very fancy…but Thanks for letting me participate.</span>
<span style="color: #808080; font-style: italic;">//Best, John Page</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//DUH!, just realized I dont need c * 1</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> test:<span style="color: #0066CC;">String</span> = “test me”+<span style="color: #cc66cc;">1</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> BooleanFactory<span style="color: #66cc66;">&#40;</span>arg<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> State=0;
&nbsp;
<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i=0; i<span style="color: #66cc66;">&amp;</span>lt;arg.<span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>arg.<span style="color: #0066CC;">substr</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
State=<span style="color: #cc66cc;">1</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>’State ‘+State<span style="color: #66cc66;">&#41;</span>
<span style="color: #b1b100;">return</span> State;
<span style="color: #66cc66;">&#125;</span>;
&nbsp;
circumventConditional<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> circumventConditional<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> c:<span style="color: #0066CC;">Number</span> = BooleanFactory<span style="color: #66cc66;">&#40;</span>test<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> a = <span style="color: #cc66cc;">1</span>;
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>a == c<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>’State == <span style="color: #000000; font-weight: bold;">true</span>, <span style="color: #0066CC;">trace</span> called, State value= ‘+c<span style="color: #66cc66;">&#41;</span>
<span style="color: #b1b100;">break</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>a <span style="color: #66cc66;">!</span>= c<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>’State == <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #0066CC;">call</span> some other <span style="color: #000000; font-weight: bold;">function</span> instead, State value= ‘+c<span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">break</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span>;</pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: john page</title>
		<link>http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-460</link>
		<dc:creator>john page</dc:creator>
		<pubDate>Tue, 29 Jan 2008 23:18:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-460</guid>
		<description>&lt;pre lang="actionscript"&gt;
/* work around for else if conditional */

//Ok, so this only works if you append a zero or one
//to the end of your string. but it does get around the 'if else' dont it?
//yes its not very fancy...but Thanks for letting me participate.
//Best, John Page

var test:String = "test me"+1;

function BooleanFactory(arg):Number{
	
	var State=0;
	
	for(var i=0; i&#60;arg.length; i++){
		if(arg.substr(-1) == 1){
			State=1;
			}
		}
		trace('State '+State)
		return State;
};


circumventConditional();

function circumventConditional(){
	
		var c:Number = BooleanFactory(test);
	
		c * 1
		var a = 1;

		while(a == c){
		trace('State == true, trace called, State value=  '+c)
		break;
		}
		
		while(a != c){
		trace('State == false, call some other function instead, State value= '+c);
		break;
		}
		

};
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* work around for else if conditional */</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//Ok, so this only works if you append a zero or one</span>
<span style="color: #808080; font-style: italic;">//to the end of your string. but it does get around the 'if else' dont it?</span>
<span style="color: #808080; font-style: italic;">//yes its not very fancy...but Thanks for letting me participate.</span>
<span style="color: #808080; font-style: italic;">//Best, John Page</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> test:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;test me&quot;</span>+<span style="color: #cc66cc;">1</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> BooleanFactory<span style="color: #66cc66;">&#40;</span>arg<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> State=0;
&nbsp;
	<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i=0; i<span style="color: #66cc66;">&amp;</span>lt;arg.<span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>arg.<span style="color: #0066CC;">substr</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			State=<span style="color: #cc66cc;">1</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'State '</span>+State<span style="color: #66cc66;">&#41;</span>
		<span style="color: #b1b100;">return</span> State;
<span style="color: #66cc66;">&#125;</span>;
&nbsp;
&nbsp;
circumventConditional<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> circumventConditional<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">var</span> c:<span style="color: #0066CC;">Number</span> = BooleanFactory<span style="color: #66cc66;">&#40;</span>test<span style="color: #66cc66;">&#41;</span>;
&nbsp;
		c <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">1</span>
		<span style="color: #000000; font-weight: bold;">var</span> a = <span style="color: #cc66cc;">1</span>;
&nbsp;
		<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>a == c<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'State == true, trace called, State value=  '</span>+c<span style="color: #66cc66;">&#41;</span>
		<span style="color: #b1b100;">break</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>a <span style="color: #66cc66;">!</span>= c<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'State == false, call some other function instead, State value= '</span>+c<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #b1b100;">break</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #66cc66;">&#125;</span>;</pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: roozbeh</title>
		<link>http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-429</link>
		<dc:creator>roozbeh</dc:creator>
		<pubDate>Thu, 17 Jan 2008 14:53:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-429</guid>
		<description>just tell me what part of the code you think somehow uses a condition and I will eliminate it :)

&lt;pre lang="actionscript"&gt;
var i:Number=0;
var down:Number=0;
var step:Number=1;
var max:Number=100;
var min:Number=0;

addEventListener(Event.ENTER_FRAME,onEnter);

function onEnter(event:Event):void
{

	//upbtn and downbtn are movieclips
	upbtn.addEventListener(MouseEvent.MOUSE_DOWN,_down);
	upbtn.addEventListener(MouseEvent.MOUSE_UP,_up);
	upbtn.addEventListener(MouseEvent.ROLL_OUT,_up);
	downbtn.addEventListener(MouseEvent.MOUSE_DOWN,_down);
	downbtn.addEventListener(MouseEvent.MOUSE_UP,_up);
	downbtn.addEventListener(MouseEvent.ROLL_OUT,_up);
	
	upbtn.buttonMode=true;
	downbtn.buttonMode=true;

	i+=(down)*int(i+down&lt;=max&#038;&#038;i+down&gt;=min);
	tf.text=String(i);

	upbtn["k"]=+1;
	downbtn["k"]=-1;

}

function _down(event:MouseEvent):void
{
	down=(event.target.k*step);
}
function _up(event:Event):void
{

	down=0;
}
&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>just tell me what part of the code you think somehow uses a condition and I will eliminate it <img src='http://www.as3dp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">Number</span>=0;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">down</span>:<span style="color: #0066CC;">Number</span>=0;
<span style="color: #000000; font-weight: bold;">var</span> step:<span style="color: #0066CC;">Number</span>=<span style="color: #cc66cc;">1</span>;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">max</span>:<span style="color: #0066CC;">Number</span>=<span style="color: #cc66cc;">100</span>;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">min</span>:<span style="color: #0066CC;">Number</span>=0;
&nbsp;
addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>,onEnter<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> onEnter<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">//upbtn and downbtn are movieclips</span>
	upbtn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>,_down<span style="color: #66cc66;">&#41;</span>;
	upbtn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>,_up<span style="color: #66cc66;">&#41;</span>;
	upbtn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">ROLL_OUT</span>,_up<span style="color: #66cc66;">&#41;</span>;
	downbtn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>,_down<span style="color: #66cc66;">&#41;</span>;
	downbtn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>,_up<span style="color: #66cc66;">&#41;</span>;
	downbtn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">ROLL_OUT</span>,_up<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	upbtn.<span style="color: #006600;">buttonMode</span>=<span style="color: #000000; font-weight: bold;">true</span>;
	downbtn.<span style="color: #006600;">buttonMode</span>=<span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
	i+=<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">down</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>i+down<span style="color: #66cc66;">&lt;</span>=max<span style="color: #66cc66;">&amp;&amp;</span>i+down<span style="color: #66cc66;">&gt;</span>=<span style="color: #0066CC;">min</span><span style="color: #66cc66;">&#41;</span>;
	tf.<span style="color: #0066CC;">text</span>=<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	upbtn<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;k&quot;</span><span style="color: #66cc66;">&#93;</span>=+<span style="color: #cc66cc;">1</span>;
	downbtn<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;k&quot;</span><span style="color: #66cc66;">&#93;</span>=-<span style="color: #cc66cc;">1</span>;
&nbsp;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> _down<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">down</span>=<span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">k</span><span style="color: #66cc66;">*</span>step<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> _up<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #0066CC;">down</span>=0;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Sanders</title>
		<link>http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-412</link>
		<dc:creator>Bill Sanders</dc:creator>
		<pubDate>Mon, 14 Jan 2008 22:12:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-412</guid>
		<description>Hi Harry,

Your visit is an honor, and I'm glad you could drop by.

I'm probably at fault for not clarifying better my attempt to look at problem solving without using conditionals. It certainly was not to save coding (or stuff less or more in a line.) One of the criticisms of the State DP is that it takes a lot of classes and coding in the absence of conditional statements. The whole exercise is a heuristic one to create better algorithms which I picked up in an OOPSLA conference.

More interesting is your comment about the equality operator being a conditional. I've always considered it a Boolean, but in an expression, I suppose it might be a conditional.

var x:uint = 5;
var w:uint = 7;
var z:uint = 5;

x==w evaluates to false
x==z evaluates to true

A conditional would be:
&lt;pre lang="actionscript"&gt;
if(x==w)
{
    someVar=ture;
}
else
{
   someVar=false;
}
&lt;/pre&gt;

However, you're saying that the equality operator performs a conditional, and it seems to. In effect the equality operator is saying:

"If a and b are equal, then send out true, else, they get a false"

This feature is masked because the equality operator is often part of the if/else statement.

Nice.

Bill</description>
		<content:encoded><![CDATA[<p>Hi Harry,</p>
<p>Your visit is an honor, and I&#8217;m glad you could drop by.</p>
<p>I&#8217;m probably at fault for not clarifying better my attempt to look at problem solving without using conditionals. It certainly was not to save coding (or stuff less or more in a line.) One of the criticisms of the State DP is that it takes a lot of classes and coding in the absence of conditional statements. The whole exercise is a heuristic one to create better algorithms which I picked up in an OOPSLA conference.</p>
<p>More interesting is your comment about the equality operator being a conditional. I&#8217;ve always considered it a Boolean, but in an expression, I suppose it might be a conditional.</p>
<p>var x:uint = 5;<br />
var w:uint = 7;<br />
var z:uint = 5;</p>
<p>x==w evaluates to false<br />
x==z evaluates to true</p>
<p>A conditional would be:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>x==w<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    someVar=ture;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #66cc66;">&#123;</span>
   someVar=<span style="color: #000000; font-weight: bold;">false</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>However, you&#8217;re saying that the equality operator performs a conditional, and it seems to. In effect the equality operator is saying:</p>
<p>&#8220;If a and b are equal, then send out true, else, they get a false&#8221;</p>
<p>This feature is masked because the equality operator is often part of the if/else statement.</p>
<p>Nice.</p>
<p>Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harry B. Garland</title>
		<link>http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-411</link>
		<dc:creator>Harry B. Garland</dc:creator>
		<pubDate>Mon, 14 Jan 2008 20:29:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-411</guid>
		<description>I was looking at this line of code that attempts to evade conditionals:
&lt;pre lang="actionscript"&gt;
down=((int(event.target.name=="upbtn")*step)
     +(int(event.target.name=="downbtn")*-step))
&lt;/pre&gt;
It does not evade conditionals, it just simply rephrases conditionals.  It still contains a "==" and that is a conditional.  The correct way to express that code is this:
&lt;pre lang="actionscript"&gt;
if(event.target.name=="upbtn")
   down=step
else if(event.target.name=="downbtn")
   down=-step
else
   down=0
&lt;/pre&gt;
You gain nothing by trying to stuff lots of functionality on a single line of code.  In fact, by putting on one line of code, the program will always execute 2 conditionals (checking for upbtn and downbtn), but by using the "if" statement, it will only check the downbtn if the upbtn conditional is false.  And it does not go through the extra step of typecasting a boolean into an integer.

A better way yet is to create a different listener function for up vs. down so that you really can eliminate the conditional.</description>
		<content:encoded><![CDATA[<p>I was looking at this line of code that attempts to evade conditionals:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #0066CC;">down</span>=<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span>==<span style="color: #ff0000;">&quot;upbtn&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>step<span style="color: #66cc66;">&#41;</span>
     +<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span>==<span style="color: #ff0000;">&quot;downbtn&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>-step<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>It does not evade conditionals, it just simply rephrases conditionals.  It still contains a &#8220;==&#8221; and that is a conditional.  The correct way to express that code is this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span>==<span style="color: #ff0000;">&quot;upbtn&quot;</span><span style="color: #66cc66;">&#41;</span>
   <span style="color: #0066CC;">down</span>=step
<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span>==<span style="color: #ff0000;">&quot;downbtn&quot;</span><span style="color: #66cc66;">&#41;</span>
   <span style="color: #0066CC;">down</span>=-step
<span style="color: #b1b100;">else</span>
   <span style="color: #0066CC;">down</span>=0</pre></div></div>

<p>You gain nothing by trying to stuff lots of functionality on a single line of code.  In fact, by putting on one line of code, the program will always execute 2 conditionals (checking for upbtn and downbtn), but by using the &#8220;if&#8221; statement, it will only check the downbtn if the upbtn conditional is false.  And it does not go through the extra step of typecasting a boolean into an integer.</p>
<p>A better way yet is to create a different listener function for up vs. down so that you really can eliminate the conditional.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: roozbeh</title>
		<link>http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-407</link>
		<dc:creator>roozbeh</dc:creator>
		<pubDate>Wed, 09 Jan 2008 23:49:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-407</guid>
		<description>I guess some characters (greater than, less than, and,..) are eliminated from my code which seems to be due to avoiding XSS. I have uploaded the .fla :

&lt;pre lang="actionscript"&gt;
var i:int=0;
var down:int=0;
var step:int=1;
var max:int=100;
var min:int=-100;

addEventListener (Event.ENTER_FRAME,onEnter);

function onEnter (event:Event):void
{
	upbtn.addEventListener (MouseEvent.MOUSE_DOWN,_down);
	upbtn.addEventListener (MouseEvent.MOUSE_UP,_up);
	downbtn.addEventListener (MouseEvent.MOUSE_DOWN,_down);
	downbtn.addEventListener (MouseEvent.MOUSE_UP,_up);

	i+=(down)*int(i+down&lt;=max&#038;&#038;i+down&gt;=min);
	tf.text=i.toString();
}

function _down (event:MouseEvent):void
{
	down=((int(event.target.name=="upbtn")*step)+(int(event.target.name=="downbtn")*-step));
}
function _up (event:Event):void
{

	down=0;
}


&lt;/pre&gt;

http://rapidshare.com/files/82584763/roozbeh.fla.html</description>
		<content:encoded><![CDATA[<p>I guess some characters (greater than, less than, and,..) are eliminated from my code which seems to be due to avoiding XSS. I have uploaded the .fla :</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span>=0;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">down</span>:<span style="color: #0066CC;">int</span>=0;
<span style="color: #000000; font-weight: bold;">var</span> step:<span style="color: #0066CC;">int</span>=<span style="color: #cc66cc;">1</span>;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">max</span>:<span style="color: #0066CC;">int</span>=<span style="color: #cc66cc;">100</span>;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">min</span>:<span style="color: #0066CC;">int</span>=-<span style="color: #cc66cc;">100</span>;
&nbsp;
addEventListener <span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>,onEnter<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> onEnter <span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	upbtn.<span style="color: #006600;">addEventListener</span> <span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>,_down<span style="color: #66cc66;">&#41;</span>;
	upbtn.<span style="color: #006600;">addEventListener</span> <span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>,_up<span style="color: #66cc66;">&#41;</span>;
	downbtn.<span style="color: #006600;">addEventListener</span> <span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>,_down<span style="color: #66cc66;">&#41;</span>;
	downbtn.<span style="color: #006600;">addEventListener</span> <span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>,_up<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	i+=<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">down</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>i+down<span style="color: #66cc66;">&lt;</span>=max<span style="color: #66cc66;">&amp;&amp;</span>i+down<span style="color: #66cc66;">&gt;</span>=<span style="color: #0066CC;">min</span><span style="color: #66cc66;">&#41;</span>;
	tf.<span style="color: #0066CC;">text</span>=i.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> _down <span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">down</span>=<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span>==<span style="color: #ff0000;">&quot;upbtn&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>step<span style="color: #66cc66;">&#41;</span>+<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span>==<span style="color: #ff0000;">&quot;downbtn&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>-step<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> _up <span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #0066CC;">down</span>=0;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><a href="http://rapidshare.com/files/82584763/roozbeh.fla.html" rel="nofollow">http://rapidshare.com/files/82584763/roozbeh.fla.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: roozbeh</title>
		<link>http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-405</link>
		<dc:creator>roozbeh</dc:creator>
		<pubDate>Wed, 09 Jan 2008 15:01:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-405</guid>
		<description>&lt;pre lang="actionscript"&gt;
var i:int=0;
var down:int=0;
var step:int=1;
var max:int=100;
var min:int=-100;

addEventListener(Event.ENTER_FRAME,onEnter);

function onEnter(event:Event):void
{
	upbtn.addEventListener(MouseEvent.MOUSE_DOWN,_down);
	upbtn.addEventListener(MouseEvent.MOUSE_UP,_up);
	downbtn.addEventListener(MouseEvent.MOUSE_DOWN,_down);
	downbtn.addEventListener(MouseEvent.MOUSE_UP,_up);
	
	i+=(down)*int(i+down=min);
	tf.text=i.toString();
}

function _down(event:MouseEvent):void
{
	down=((int(event.target.name=="upbtn")*step)+(int(event.target.name=="downbtn")*-step));
}
function _up(event:Event):void
{

	down=0;
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span>=0;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">down</span>:<span style="color: #0066CC;">int</span>=0;
<span style="color: #000000; font-weight: bold;">var</span> step:<span style="color: #0066CC;">int</span>=<span style="color: #cc66cc;">1</span>;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">max</span>:<span style="color: #0066CC;">int</span>=<span style="color: #cc66cc;">100</span>;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">min</span>:<span style="color: #0066CC;">int</span>=-<span style="color: #cc66cc;">100</span>;
&nbsp;
addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>,onEnter<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> onEnter<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	upbtn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>,_down<span style="color: #66cc66;">&#41;</span>;
	upbtn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>,_up<span style="color: #66cc66;">&#41;</span>;
	downbtn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>,_down<span style="color: #66cc66;">&#41;</span>;
	downbtn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>,_up<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	i+=<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">down</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>i+<span style="color: #0066CC;">down</span>=<span style="color: #0066CC;">min</span><span style="color: #66cc66;">&#41;</span>;
	tf.<span style="color: #0066CC;">text</span>=i.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> _down<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">down</span>=<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span>==<span style="color: #ff0000;">&quot;upbtn&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>step<span style="color: #66cc66;">&#41;</span>+<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span>==<span style="color: #ff0000;">&quot;downbtn&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>-step<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> _up<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #0066CC;">down</span>=0;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Sanders</title>
		<link>http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-403</link>
		<dc:creator>Bill Sanders</dc:creator>
		<pubDate>Mon, 07 Jan 2008 14:20:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/12/31/unconditional-contest/#comment-403</guid>
		<description>Hi Robs,

I may have skewed the whole idea of substituting alternatives to conventional conditional statements with some other kind of thinking. I do not believe I ever said that this was an intention of State Design Patterns. Rather, they stood as a common example where state classes with a full set of different states could be found without relying on conditional statements. Jonathan Kaye had a great comment on that.

For a second (or even longer) forget about State DPs. Rather, consider problem-solving without using conditional statements. What are some different ways you could do that? This is a heuristic exercise to come up with better solutions and algorithms.

As for the "worst code" you've ever seen--that's not the point. See if you can create any kind of statement that works to have the branching effect of a conditional without using a conditional statement. It's harder than you may think.

Thanks,
Bill</description>
		<content:encoded><![CDATA[<p>Hi Robs,</p>
<p>I may have skewed the whole idea of substituting alternatives to conventional conditional statements with some other kind of thinking. I do not believe I ever said that this was an intention of State Design Patterns. Rather, they stood as a common example where state classes with a full set of different states could be found without relying on conditional statements. Jonathan Kaye had a great comment on that.</p>
<p>For a second (or even longer) forget about State DPs. Rather, consider problem-solving without using conditional statements. What are some different ways you could do that? This is a heuristic exercise to come up with better solutions and algorithms.</p>
<p>As for the &#8220;worst code&#8221; you&#8217;ve ever seen&#8211;that&#8217;s not the point. See if you can create any kind of statement that works to have the branching effect of a conditional without using a conditional statement. It&#8217;s harder than you may think.</p>
<p>Thanks,<br />
Bill</p>
]]></content:encoded>
	</item>
</channel>
</rss>
