<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Raven Effects &#187; logic</title>
	<atom:link href="http://www.raveneffects.com/wordpress/?feed=rss2&#038;tag=logic" rel="self" type="application/rss+xml" />
	<link>http://www.raveneffects.com/wordpress</link>
	<description>multimedia at a snail&#039;s pace</description>
	<lastBuildDate>Thu, 27 Feb 2014 06:20:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.38</generator>
	<item>
		<title>Using if/else in actual code</title>
		<link>http://www.raveneffects.com/wordpress/?p=79</link>
		<comments>http://www.raveneffects.com/wordpress/?p=79#comments</comments>
		<pubDate>Fri, 22 Feb 2013 20:17:00 +0000</pubDate>
		<dc:creator><![CDATA[snazzyFez]]></dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[logic]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.raveneffects.com/wordpress/?p=79</guid>
		<description><![CDATA[If (winter storm warning) {    let students go an hour early } Stupid weather.  Barely 3 inches of snow, and none happened till much later!  Still, when you&#8217;re teaching at night and you see a giant blue blob of snow on the radar map, well, you cut everyone out early. Still, I battled on [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>If (winter storm warning)</strong><br />
<strong>{</strong><br />
<strong>   let students go an hour early</strong><br />
<strong>}</strong></p>
<p>Stupid weather.  Barely 3 inches of snow, and none happened till much later!  Still, when you&#8217;re teaching at night and you see a giant blue blob of snow on the radar map, well, you cut everyone out early. Still, I battled on for over 2 hours, so they could try their hand at some simple comparisons complete with score keeping!</p>
<p><a href="../../bobTheJerk.html">Check it out here</a></p>
<p>It&#8217;s fairly simple, and runs on 57 lines of code (49 if you don&#8217;t count empty lines)!  And some of those lines weren&#8217;t actually used (set-up for some extra stuff we never got to). In this, I tried to show how variables interact and change based on conditions set.  The values of money above each character&#8217;s head changes based on variables set based on which face gets clicked on.</p>
<p>Then the faces change based on a comparison of the money amounts.  So every time a face gets clicked, the money amounts change and are checked.  If Bob&#8217;s got more money, he gets all smug.  When Bob has less, he gets mad.</p>
<p>It&#8217;s all taken care of in a bitty function called <strong>checkForJerk</strong>.</p>
<p style="padding-left: 30px;">function checkForJerk():void<br />
{<br />
if (bobsMoney &gt; myMoney)<br />
{<br />
me.gotoAndStop(2);<br />
bob.gotoAndStop(2);<br />
}<br />
else if (myMoney &gt; bobsMoney)<br />
{<br />
me.gotoAndStop(1);<br />
bob.gotoAndStop(3);<br />
}<br />
else<br />
{<br />
me.gotoAndStop(1);<br />
bob.gotoAndStop(1);<br />
}<br />
}</p>
<p>I&#8217;m sure this could have been done easier with a <strong>switch/case</strong> format, but let&#8217;s get through the basics first, shall we?</p>
<p>Oh, and in case you didn&#8217;t notice, yes, I appropriated little troll faces for fun &#8211; no idea who made them, but if I knew, I&#8217;d give credit where it&#8217;s due.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raveneffects.com/wordpress/?feed=rss2&#038;p=79</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Choose your own adventure, or if it&#8217;s sunny outside&#8230;</title>
		<link>http://www.raveneffects.com/wordpress/?p=69</link>
		<comments>http://www.raveneffects.com/wordpress/?p=69#comments</comments>
		<pubDate>Wed, 20 Feb 2013 16:46:51 +0000</pubDate>
		<dc:creator><![CDATA[snazzyFez]]></dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[logic]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.raveneffects.com/wordpress/?p=69</guid>
		<description><![CDATA[Go to the beach. This is how class started (more or less) last night. More or less. First, the stragglers from the class before slowly packed up their things, said bye to their friends in my class, and shambled off to wherever art/marketing/design/film students meander off to. Seriously, the concept of politeness is dead. I [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Go to the beach. This is how class started (more or less) last night. More or less. First, the stragglers from the class before slowly packed up their things, said bye to their friends in my class, and shambled off to wherever art/marketing/design/film students meander off to. Seriously, the concept of politeness is dead. I just talk over them and let those students who want to be distracted miss out on the opening remarks.</p>
<p>So the dreaded if/else statement was the topic du jour. I spent the entire evening writing on the whiteboard. No computer, no &#8220;start-up Flash and do what I say.&#8221; Well, I told them, &#8220;open up NotePad and type this in.&#8221; Some felt I meant a literal notepad and wrote only in the notebooks, even after I said, &#8220;you&#8217;re turning this in.&#8221; I have a few cellphone snapshots of people&#8217;s work, and I have to say, my eyes hurt, just a little, from fighting the urge to roll them up through all this.</p>
<p>So, sunshine and if/else. How else can you start explaining the concept, really? Most folks (I&#8217;m not part of &#8220;most folks&#8221; in this case) don&#8217;t think in terms of programming logic much. At least they don&#8217;t recognize it as such. I don&#8217;t usually either, but I have wondered, as I wait at a frozen bus stop in February, &#8220;if I hadn&#8217;t ducked into a Tower Records during a rainstorm in Santa Barbara back in 1994, would have ended up in Chicago in 2013?&#8221; The answer to that is probably &#8220;no.&#8221; That&#8217;s another story and I digress.</p>
<p>Simply put, choices we make based on variables in our lives are just like programming. Each leads to new choices and new paths to go down. Which makes &lt;<strong>insert deity here</strong>&gt; a snarky coder with chip stains on &lt;<strong>his/her&#8217;s/its</strong>&gt; D&amp;D t-shirt. Or at best, we&#8217;re all living out the longest and oddest <em>Choose Your Own Adventures</em> books ever written:</p>
<p style="padding-left: 30px;"><em>If you want more coffee before your 11am meeting, turn to page 1173, if you think you can keep the yawning to a minimum, turn to page 1554.</em></p>
<p>Where was I? Oh yeah &#8211; if it&#8217;s sunny out, go to the beach, but if your boss sees you, don&#8217;t go to the beach:</p>
<p style="padding-left: 30px;"><span style="color: #0000ff;">var sunny:Boolean = true;</span><br />
<span style="color: #0000ff;"> var boss:Boolean = false;</span><br />
<span style="color: #0000ff;">var beach:Boolean = false;</span></p>
<p style="padding-left: 30px;"><span style="color: #0000ff;">if ((sunny) &amp;&amp; (!boss))</span><br />
<span style="color: #0000ff;"> {</span><br />
<span style="color: #0000ff;">     beach = true;</span><br />
<span style="color: #0000ff;">}</span><br />
<span style="color: #0000ff;">else</span><br />
<span style="color: #0000ff;">{</span><br />
<span style="color: #0000ff;">     beach = false;</span><br />
<span style="color: #0000ff;">}</span></p>
<p>This took the better part of an hour to go through. I think by the end most were getting it &#8211; in the broadest terms. Next class, we&#8217;ll try and apply it to something more tangible than weather.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raveneffects.com/wordpress/?feed=rss2&#038;p=69</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
