<?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>Emanuele Feronato &#187; PROgramming</title>
	<atom:link href="http://www.emanueleferonato.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.emanueleferonato.com</link>
	<description>italian geek and PROgrammer</description>
	<lastBuildDate>Thu, 02 Sep 2010 09:32:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>The fastest way to find the distance between two points</title>
		<link>http://www.emanueleferonato.com/2010/07/29/the-fastest-way-to-find-the-distance-between-two-points/</link>
		<comments>http://www.emanueleferonato.com/2010/07/29/the-fastest-way-to-find-the-distance-between-two-points/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 22:16:44 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[PROgramming]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=3187</guid>
		<description><![CDATA[While I was reading Claytus Hood Tower Defense case study I was impressed by this: To estimate the distances and so check the range, I use Manhattan distance formula, less accurate but faster than Euclidian distance Named after the grid layout of most Manhattan streets, it&#8217;s a form of geometry in which the usual metric [...]]]></description>
			<content:encoded><![CDATA[<p>While I was reading <a href="http://www.emanueleferonato.com/2010/07/26/claytus-hood-tower-defense-case-study/">Claytus Hood Tower Defense</a> case study I was impressed by this:</p>
<blockquote><p>
To estimate the distances and so check the range, I use Manhattan distance formula, less accurate but faster than Euclidian distance</p></blockquote>
<p>Named after the grid layout of most Manhattan streets, it&#8217;s a form of geometry in which the usual metric of Euclidean geometry is replaced by a new metric in which the distance between two points is<strong> the sum of the absolute differences of their coordinates</strong> (<a href="http://en.wikipedia.org/wiki/Taxicab_geometry" target = "_blank">for more information refer to Wikipedia&#8217;s Taxicab geometry page</a>).</p>
<p>Now the question is: is Manhattan distance really faster than Euclidian distance?</p>
<p>For the following test I used PHP, but feel free to make it in any other language and I&#8217;ll be glad to publish your results.<span id="more-3187"></span></p>
<p>First, I set two variables, named <code>$x_dist</code> and <code>$y_dist</code>, to <code>10</code> and <code>20</code> respectively, then to <code>-10</code> and <code>-20</code></p>
<p>These variables should represent the <code>x</code> and <code>y</code> distance between two points.</p>
<p>I generated a script to calculate <code>a million times</code> the distance with Euclidean geometry this way:</p>
<p><code>$distance = sqrt($x_dist*$x_dist+$y_dist*$y_dist);</code></p>
<p>The server took an average <strong>566.56 milliseconds</strong> to give me the response.</p>
<p>I thought most of the time is spent to calculate the square root, so a smart programmer could remove the square root and eventually compare the result with a given number multiplied by itself&#8230; so if the distance has to b less than 30, I will check if it&#8217;s less than 30*30=900.</p>
<p>This way to determine the distance:</p>
<p><code>$distance = $x_dist*$x_dist+$y_dist*$y_dist;</code></p>
<p>took an average time of <strong>204.43 milliseconds</strong> to generate a million results.</p>
<p>Then it&#8217;s time to use Manhattan distance:</p>
<p><code>$distance = abs($x_dist)+abs($y_dist);</code></p>
<p>This method took <strong>694.83 milliseconds</strong>&#8230; the slowest so far&#8230; so I tried to avoid using <code>abs</code> this way:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$x_dist</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$x_dist</span> <span style="color: #339933;">*=-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$y_dist</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$y_dist</span> <span style="color: #339933;">*=-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$distance</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$x_dist</span><span style="color: #339933;">+</span><span style="color: #000088;">$y_dist</span><span style="color: #339933;">;</span></pre></div></div>

<p>and I got <strong>243.11 milliseconds</strong>. Trying with positive or negative starting distance values did not change response times in a valuable manner.</p>
<p>So I would say: &#8220;<strong>Myth Busted</strong>&#8220;.</p>
<p>Do you agree?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2010/07/29/the-fastest-way-to-find-the-distance-between-two-points/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Complete Flash Sokoban game in less than 2KB</title>
		<link>http://www.emanueleferonato.com/2010/05/19/complete-flash-sokoban-game-in-less-than-2kb/</link>
		<comments>http://www.emanueleferonato.com/2010/05/19/complete-flash-sokoban-game-in-less-than-2kb/#comments</comments>
		<pubDate>Wed, 19 May 2010 13:51:27 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[PROgramming]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=2909</guid>
		<description><![CDATA[Some days ago I blogged about 6 games you must be able to make in less than a day. Among these games I included Sokoban, and since I don&#8217;t remember if I&#8217;ve ever tried to make a complete Sokoban game, I did it today. In less than a day and, above all, in less than [...]]]></description>
			<content:encoded><![CDATA[<p>Some days ago I blogged about <a href="http://www.emanueleferonato.com/2010/05/07/6-games-you-must-be-able-to-make-in-less-than-a-day/">6 games you must be able to make in less than a day</a>.</p>
<p>Among these games I included Sokoban, and since I don&#8217;t remember if I&#8217;ve ever tried to make a complete Sokoban game, I did it today.</p>
<p>In less than a day and, above all, in <strong>less than 2KB</strong>!!</p>
<p>And don&#8217;t expect an incomplete prototype&#8230; my Sokoban game features:</p>
<p>* 10 levels<br />
* Tiles of different color and shape<br />
* <a href="http://www.emanueleferonato.com/2008/12/28/understanding-as3-shared-objects/">Shared objects</a> to save the games<br />
* Eye-candy effects (being only 2KB!!) to show completed levels and current level<br />
* Copyable level moves to publish your own level solution<br />
* In game instructions<br />
* No external files or other tricks to reduce file size.</p>
<p>As said, in less than 2KB. My latest build is 2,002 bytes that&#8217;s less than 2,048.</p>
<p>This is the source code, that wasn&#8217;t written with readability or performance in mind, just aiming to stay under 2KB&#8230; just an exercise:<span id="more-2909"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">KeyboardEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">TextField</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #004993;">SharedObject</span>;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> s extends <span style="color: #004993;">Sprite</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #6699cc; font-weight: bold;">var</span> m<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>=<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">5</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">5</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">5</span>,<span style="color: #000000; font-weight:bold;">5</span>,<span style="color: #000000; font-weight:bold;">5</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">5</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">6</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">6</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">2</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> l,h<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #000000; font-weight:bold;">0</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> p,r<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> f<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>=<span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> g,o<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> u<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextField</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">c</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">SharedObject</span>=<span style="color: #004993;">SharedObject</span>.<span style="color: #004993;">getLocal</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;s&quot;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> s<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">c</span>.<span style="color: #004993;">data</span>.l==<span style="color: #0033ff; font-weight: bold;">undefined</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">c</span>.<span style="color: #004993;">data</span>.l=<span style="color: #990000;">&quot;0000000000&quot;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #000000; font-weight:bold;">0</span>; i<span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #000000; font-weight:bold;">10</span>; i<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				g=<span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
				g.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0x00ff00<span style="color: #000000;">&#41;</span>;
				g.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">0.2</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">0.8</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #004993;">c</span>.<span style="color: #004993;">data</span>.l.<span style="color: #004993;">charAt</span><span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span>;
				g.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">9</span>,<span style="color: #000000; font-weight:bold;">9</span><span style="color: #000000;">&#41;</span>;
				g.<span style="color: #004993;">x</span>=<span style="color: #000000; font-weight:bold;">130</span><span style="color: #000000; font-weight: bold;">+</span>i<span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">11</span>;
				g.<span style="color: #004993;">y</span>=<span style="color: #000000; font-weight:bold;">35</span>;
				g.<span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;g&quot;</span><span style="color: #000000; font-weight: bold;">+</span>i;
				<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>g<span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			o = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			o.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0xff0000<span style="color: #000000;">&#41;</span>;
			o.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">3</span>,<span style="color: #000000; font-weight:bold;">3</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>o<span style="color: #000000;">&#41;</span>;
			o.<span style="color: #004993;">y</span>=<span style="color: #000000; font-weight:bold;">38</span>;
			u.<span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;ARROWS KEYS: MOVE<span style="">\n</span>0-9: SELECT LEVEL<span style="">\n</span>COMPLETED LEVELS:<span style="">\n</span>LEVEL MOVES: &quot;</span>;
			u.<span style="color: #004993;">width</span>=<span style="color: #000000; font-weight:bold;">490</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>u<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>f<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">d</span><span style="color: #000000;">&#40;</span>l<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">KeyboardEvent</span>.<span style="color: #004993;">KEY_UP</span>, k<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">d</span><span style="color: #000000;">&#40;</span>l<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			o.<span style="color: #004993;">x</span>=<span style="color: #000000; font-weight:bold;">133</span><span style="color: #000000; font-weight: bold;">+</span>l<span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">11</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> n<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>;
			r=<span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #000000; font-weight:bold;">0</span>; i<span style="color: #000000; font-weight: bold;">&lt;</span>m<span style="color: #000000;">&#91;</span>l<span style="color: #000000;">&#93;</span>.<span style="color: #004993;">length</span>; i<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				r<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>=<span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> j<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #000000; font-weight:bold;">0</span>; j<span style="color: #000000; font-weight: bold;">&lt;</span>m<span style="color: #000000;">&#91;</span>l<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>.<span style="color: #004993;">length</span>; j<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
					n=m<span style="color: #000000;">&#91;</span>l<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span>;
					r<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span>=n;
					<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>n<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
						<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>n<span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #000000; font-weight:bold;">5</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
							q<span style="color: #000000;">&#40;</span>n,i,j<span style="color: #000000;">&#41;</span>;
						<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
							q<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">2</span>,i,j<span style="color: #000000;">&#41;</span>;
							q<span style="color: #000000;">&#40;</span>n<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">2</span>,i,j<span style="color: #000000;">&#41;</span>;
						<span style="color: #000000;">&#125;</span>
					<span style="color: #000000;">&#125;</span>
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> q<span style="color: #000000;">&#40;</span>n<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>,i<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>,j<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			u.<span style="color: #004993;">text</span>=u.<span style="color: #004993;">text</span>.<span style="color: #004993;">substr</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">67</span><span style="color: #000000;">&#41;</span>;
			f.<span style="color: #004993;">y</span>=<span style="color: #000000; font-weight:bold;">64</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> t<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">c</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>=<span style="color: #000000;">&#91;</span>0x000000,0xff0000,0x00ff00,0x0000ff<span style="color: #000000;">&#93;</span>;
			t = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			t.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>n<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>;
			t.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRoundRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">32</span>,<span style="color: #000000; font-weight:bold;">32</span>,<span style="color: #000000;">&#40;</span>n<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">20</span><span style="color: #000000;">&#41;</span>;
			t.<span style="color: #004993;">x</span>=j<span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">32</span>;
			t.<span style="color: #004993;">y</span>=i<span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">32</span>;
			f.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>t<span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>n==<span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				f.<span style="color: #004993;">setChildIndex</span><span style="color: #000000;">&#40;</span>t,<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>n==<span style="color: #000000; font-weight:bold;">3</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				t.<span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;d&quot;</span><span style="color: #000000; font-weight: bold;">+</span>i<span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot;_&quot;</span><span style="color: #000000; font-weight: bold;">+</span>j;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>n==<span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				p=<span style="color: #000000;">&#91;</span>i,j<span style="color: #000000;">&#93;</span>;
				r<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">-</span>=<span style="color: #000000; font-weight:bold;">4</span>;
				t.<span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;b&quot;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> k<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">KeyboardEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			h=e.<span style="color: #004993;">keyCode</span>;
			<span style="color: #0033ff; font-weight: bold;">switch</span> <span style="color: #000000;">&#40;</span>h<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #000000; font-weight:bold;">37</span> <span style="color: #000000; font-weight: bold;">:</span>
					w<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
				<span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #000000; font-weight:bold;">38</span> <span style="color: #000000; font-weight: bold;">:</span>
					w<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
				<span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #000000; font-weight:bold;">39</span> <span style="color: #000000; font-weight: bold;">:</span>
					w<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
				<span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #000000; font-weight:bold;">40</span> <span style="color: #000000; font-weight: bold;">:</span>
					w<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
				<span style="color: #0033ff; font-weight: bold;">default</span> <span style="color: #000000; font-weight: bold;">:</span>
					<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>h<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight:bold;">47</span><span style="color: #000000; font-weight: bold;">&amp;&amp;</span>h<span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #000000; font-weight:bold;">58</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
						l=h<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">48</span>;
						<span style="color: #004993;">removeChild</span><span style="color: #000000;">&#40;</span>f<span style="color: #000000;">&#41;</span>;
						f = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
						<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>f<span style="color: #000000;">&#41;</span>;
						<span style="color: #004993;">d</span><span style="color: #000000;">&#40;</span>l<span style="color: #000000;">&#41;</span>;
					<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> w<span style="color: #000000;">&#40;</span>a<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>,<span style="color: #004993;">b</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> v<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>=<span style="color: #0033ff; font-weight: bold;">false</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> _z<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>=<span style="color: #990000;">&quot;RULD&quot;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">d</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>=<span style="color: #990000;">&quot;&quot;</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>r<span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #004993;">b</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span>a<span style="color: #000000;">&#93;</span>==<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000; font-weight: bold;">||</span>r<span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #004993;">b</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span>a<span style="color: #000000;">&#93;</span>==<span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				v=<span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>r<span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #004993;">b</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span>a<span style="color: #000000;">&#93;</span>==<span style="color: #000000; font-weight:bold;">3</span><span style="color: #000000; font-weight: bold;">||</span>r<span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #004993;">b</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span>a<span style="color: #000000;">&#93;</span>==<span style="color: #000000; font-weight:bold;">5</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">&amp;&amp;</span><span style="color: #000000;">&#40;</span>r<span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #004993;">b</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000; font-weight: bold;">*</span>a<span style="color: #000000;">&#93;</span>==<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000; font-weight: bold;">||</span>r<span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #004993;">b</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000; font-weight: bold;">*</span>a<span style="color: #000000;">&#93;</span>==<span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
					<span style="color: #004993;">d</span>=f.<span style="color: #004993;">getChildByName</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;d&quot;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #004993;">b</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot;_&quot;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span>a<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">name</span>;
					v=<span style="color: #0033ff; font-weight: bold;">true</span>;
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>v<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				u.<span style="color: #004993;">appendText</span><span style="color: #000000;">&#40;</span>_z.<span style="color: #004993;">charAt</span><span style="color: #000000;">&#40;</span>h<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">37</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
				f.<span style="color: #004993;">getChildByName</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;b&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">x</span><span style="color: #000000; font-weight: bold;">+</span>=<span style="color: #000000; font-weight:bold;">32</span><span style="color: #000000; font-weight: bold;">*</span>a;
				f.<span style="color: #004993;">getChildByName</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;b&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">y</span><span style="color: #000000; font-weight: bold;">+</span>=<span style="color: #000000; font-weight:bold;">32</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #004993;">b</span>;
				p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span>=<span style="color: #004993;">b</span>;
				p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span>=a;
				<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">d</span><span style="color: #000000; font-weight: bold;">!</span>=<span style="color: #990000;">&quot;&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
					f.<span style="color: #004993;">getChildByName</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">d</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">x</span><span style="color: #000000; font-weight: bold;">+</span>=<span style="color: #000000; font-weight:bold;">32</span><span style="color: #000000; font-weight: bold;">*</span>a;
					f.<span style="color: #004993;">getChildByName</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">d</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">y</span><span style="color: #000000; font-weight: bold;">+</span>=<span style="color: #000000; font-weight:bold;">32</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #004993;">b</span>;
					f.<span style="color: #004993;">getChildByName</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">d</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;d&quot;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #004993;">b</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot;_&quot;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000; font-weight: bold;">*</span>a<span style="color: #000000;">&#41;</span>;
					r<span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">-</span>=<span style="color: #000000; font-weight:bold;">3</span>;
					r<span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #004993;">b</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span>a<span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span>=<span style="color: #000000; font-weight:bold;">3</span>;
					<span style="color: #004993;">d</span>=<span style="color: #990000;">&quot;&quot;</span>;
					<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>r.<span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span>==<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
						<span style="color: #004993;">c</span>.<span style="color: #004993;">data</span>.l=<span style="color: #004993;">c</span>.<span style="color: #004993;">data</span>.l.<span style="color: #004993;">substr</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,l<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #004993;">c</span>.<span style="color: #004993;">data</span>.l.<span style="color: #004993;">substr</span><span style="color: #000000;">&#40;</span>l<span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
						<span style="color: #004993;">getChildByName</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;g&quot;</span><span style="color: #000000; font-weight: bold;">+</span>l<span style="color: #000000;">&#41;</span>.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">1</span>;
					<span style="color: #000000;">&#125;</span>
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>This class was compiled with &#8220;Compress movie&#8221; checked and &#8220;Include XMP metadata&#8221; unchecked</p>
<p>And this is the result:</p>
<p><embed src="/wp-content/uploads/2010/05/s1.swf" allowscriptaccess="always" menu="false" quality="high" width="500" height="320" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></p>
<p>Move with arrow keys, select levels with 0-9, leave a comment with your solutions&#8230; and try to give me an idea about another game to make it fit under 2KB.</p>
<p>If you want to check file size, save <a href = "/wp-content/uploads/2010/05/s1.swf">this file</a> and see&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2010/05/19/complete-flash-sokoban-game-in-less-than-2kb/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>6 games you must be able to make in less than a day</title>
		<link>http://www.emanueleferonato.com/2010/05/07/6-games-you-must-be-able-to-make-in-less-than-a-day/</link>
		<comments>http://www.emanueleferonato.com/2010/05/07/6-games-you-must-be-able-to-make-in-less-than-a-day/#comments</comments>
		<pubDate>Fri, 07 May 2010 11:34:40 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Game design]]></category>
		<category><![CDATA[PROgramming]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=2847</guid>
		<description><![CDATA[Do you think you are a game developer? Do you want to start to make games in any language but you want to test yourself? This is a list of six games you must be able to make in any language in less than a day. Every game is a classic you can see on [...]]]></description>
			<content:encoded><![CDATA[<p>Do you think you are a game developer? Do you want to start to make games in any language but you want to test yourself?</p>
<p>This is a list of six games you must be able to make in <strong>any</strong> language in less than a day.</p>
<p>Every game is a classic you can see on any device, and each of them has a particular feature that will help you growing in game programming.</p>
<p>If you aren&#8217;t able to make them&#8230; well&#8230;</p>
<p><img src="/wp-content/uploads/2010/05/programmer.jpg" /></p>
<p>Let&#8217;s see them</p>
<p><strong>Concentration</strong> &#8211; <a href="http://en.wikipedia.org/wiki/Concentration_(game)" target = "_blank">http://en.wikipedia.org/wiki/Concentration_(game)</a></p>
<p>Concentration, also known as Memory, Pelmanism, Shinkei-suijaku, Pexeso or simply Pairs, is a card game in which all of the cards are laid face down on a surface and two cards are flipped face up over each turn. The object of the game is to turn over pairs of matching cards. </p>
<p><strong>Why you must be able to make it</strong>: It&#8217;s the simplest game ever&#8230; just an array. Come on.<span id="more-2847"></span></p>
<p><strong>Tic Tac Toe</strong> &#8211; <a target = "_blank" href="http://en.wikipedia.org/wiki/Tic-tac-toe">http://en.wikipedia.org/wiki/Tic-tac-toe</a></p>
<p>Tic-tac-toe, also spelled tick tack toe, and alternatively called noughts and crosses, Xs and Os, and many other names, is a pencil-and-paper game for two players, O and X, who take turns marking the spaces in a 3×3 grid, usually X going first.</p>
<p>The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game.</p>
<p><strong>Why you must be able to make it</strong>: This is the simplest example of artificial intelligence. The CPU player must never lose a game.</p>
<p><strong>Minesweeper</strong> &#8211; <a target = "_blank" href="http://en.wikipedia.org/wiki/Minesweeper_(computer_game)">http://en.wikipedia.org/wiki/Minesweeper_(computer_game)</a></p>
<p>When the game is started, the player is presented with a grid of gray squares. If the player clicks on a square without a mine, a digit is revealed in that square, the digit indicating the number of adjacent squares which contain mines.</p>
<p>By using logic, players must deduce that certain other squares are mine-free (or mine-filled), and proceed to click on additional squares to clear them or mark them with flag graphics to indicate the presence of a mine.</p>
<p><strong>Why you must be able to make it</strong>: You will get familiar with arrays with multiple values, and there is an interesting implementation of the <a href="http://www.emanueleferonato.com/2008/06/06/flash-flood-fill-implementation/">flood fill algorithm</a></p>
<p><strong>Sokoban</strong> &#8211; <a href="http://en.wikipedia.org/wiki/Sokoban" target = "_blank">http://en.wikipedia.org/wiki/Sokoban</a></p>
<p>Transport puzzle in which the player pushes boxes around a maze, viewed from above, and tries to put them in designated locations. Only one box may be pushed at a time, and boxes cannot be pulled.</p>
<p><strong>Why you must be able to make it</strong>: It&#8217;s another array game but this time you will handle keyboard interaction, and you have to be able to check for more complex rules to determine whether the player can push a box or not.</p>
<p><strong>Snake</strong> &#8211; <a href="http://en.wikipedia.org/wiki/Snake_(video_game)" target = "_blank">http://en.wikipedia.org/wiki/Snake_(video_game)</a></p>
<p>The player controls a long, thin creature, resembling a snake, which roams around on a bordered plane, picking up food (or some other item), trying to avoid hitting its own tail or the &#8220;walls&#8221; that surround the playing area.</p>
<p>Each time the snake eats a piece of food, its tail grows longer, making the game increasingly difficult.</p>
<p>The user controls the direction of the snake&#8217;s head (up, down, left, or right), and the snake&#8217;s body follows. </p>
<p>The player cannot stop the snake from moving while the game is in progress, and cannot make the snake go in reverse.</p>
<p><strong>Why you must be able to make it</strong>: Here it comes the timer&#8230; unlike previous games just waiting for the player to make a move, this game requires time handling.</p>
<p><strong>Tetris</strong> &#8211; <a href="http://en.wikipedia.org/wiki/Tetris" target = "_blank">http://en.wikipedia.org/wiki/Tetris</a></p>
<p>A random sequence of tetrominoes (sometimes called &#8220;tetrads&#8221; in older versions) &#8211; shapes composed of four square blocks each &#8211; fall down the playing field (a rectangular vertical shaft, called the &#8220;well&#8221; or &#8220;matrix&#8221;). </p>
<p>The object of the game is to manipulate these tetrominoes, by moving each one sideways and rotating it by 90 degree units, with the aim of creating a horizontal line of blocks without gaps. When such a line is created, it disappears, and any block above the deleted line will fall. With every ten lines that are cleared, the game enters a new level.</p>
<p>As the game progresses, each level causes the tetrominoes to fall faster, and the game ends when the stack of tetrominoes reaches the top of the playing field and no new tetrominoes are able to enter.</p>
<p><strong>Why you must be able to make it</strong>: Don&#8217;t understimate this game, this is quite complex&#8230; it features timers, events, &#8220;physics&#8221;, inputs&#8230; once you&#8217;ll manage to make a clean Tetris game, you&#8217;ll definitively be able to make complex games, it&#8217;s just a matter of time.</p>
<p>Do you have other games in your &#8220;must do&#8221; list?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2010/05/07/6-games-you-must-be-able-to-make-in-less-than-a-day/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Travelmates</title>
		<link>http://www.emanueleferonato.com/2010/04/19/travelmates/</link>
		<comments>http://www.emanueleferonato.com/2010/04/19/travelmates/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 09:28:33 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[PROgramming]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=2759</guid>
		<description><![CDATA[Every travel can be the best travel ever if you choose the right travelmates. In this photo, my travelmates Let&#8217;s see them: 1) An iPhone, with some interesting apps to kill some time during a 11 hours flight 2) Sony Bloggie camera. High definition MP4 video, 5-megapixel still photos, USB arm, 270-degree swivel lens. Apart [...]]]></description>
			<content:encoded><![CDATA[<p>Every travel can be the best travel ever if you choose the right travelmates.</p>
<p>In this photo, my travelmates</p>
<p><img src="http://www.emanueleferonato.com/wp-content/uploads/2010/04/travelmates.jpg" /></p>
<p>Let&#8217;s see them:</p>
<p>1) An iPhone, with some interesting apps to kill some time during a 11 hours flight</p>
<p>2) <a href="www.sonystyle.com/bloggie" target = "_blank">Sony Bloggie</a> camera. High definition MP4 video, 5-megapixel still photos, USB arm, 270-degree swivel lens. Apart from that, decent videos with a pocket camera</p>
<p>3) Electric plug adapters&#8230; because sometimes batteries need to be recharged</p>
<p>4) <a href="http://www.olympus.co.uk/consumer/29_22575.htm" target = "_blank">Olympus TOUGH-3000</a>&#8230; 12 Megapixels, waterproof to 3m, shockproof to 1.5m and freezeproof to -10°C (quite useless in Cuba anyway&#8230;)</p>
<p>5)  Sony Handycam full HD with 40Gb hard disk&#8230; bigger than the Bloggie but with a lot better video quality&#8230; for the &#8220;really interesting events&#8221;</p>
<p>6) Nintendo Dsi + <a href="http://www.zelda.com/spirittracks/" target = "_blank">Zelda Spirit Tracks</a>&#8230; you know&#8230; an 11 hours flight&#8230;. back and forth&#8230;</p>
<p>7) 16Gb USB Key&#8230; with all my stuff</p>
<p>8) Internet key&#8230; because I hate to wait at the airport (and no, no free WiFi in Italy)</p>
<p>9) Entry level MacBook Pro&#8230; I still don&#8217;t love Macs&#8230; but I don&#8217;t hate them anymore</p>
<p>10) The camera used to take this shot&#8230; a Sony Cybershot</p>
<p>11) A Lonsdale backpack to make all this stuff fit without problems</p>
<p>These are my travelmates. I would like to know yours</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2010/04/19/travelmates/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Saving and storing your work</title>
		<link>http://www.emanueleferonato.com/2010/02/18/saving-and-storing-your-work/</link>
		<comments>http://www.emanueleferonato.com/2010/02/18/saving-and-storing-your-work/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 22:45:52 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[PROgramming]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=2385</guid>
		<description><![CDATA[No matter if you are a Flash game developer, a web designer, a video editor, a programmer or whatever&#8230; the more your work on your computer, the more files you will generate. After a while, your hard disk will become a nasty place full of shattered project if you don&#8217;t follow some simple rules. That&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>No matter if you are a Flash game developer, a web designer, a video editor, a programmer or whatever&#8230; the more your work on your computer, the more files you will generate.</p>
<p>After a while, your hard disk will become a nasty place full of shattered project if you don&#8217;t follow some simple rules.</p>
<p>That&#8217;s how I organize, save and store my work.</p>
<p><strong>1) I keep on the computer&#8217;s hard disk only the projects I am currently working on</strong></p>
<p>With more than 10 years of work, keeping all projects, images, video and every other kind of file on the computer I am currently using would be really a nonsense. First, there is no reason to keep old projects on your hard disk, second I don&#8217;t want someone to rob my notebook and have access to an entire life of work. So I use to keep on my computer only the projects I am currently working on. When a project is finished, I move it on another hard disk. Should I work again on an old project, I copy it on my computer and start working on it, until it&#8217;s finished, then I move it on another hard disk.</p>
<p>Since you will access this hard disk once in a while (sometimes once a week, sometimes once a month), there isn&#8217;t any particular recommendation about the hard disk. I am using two USB 1TB iomega where I store almost all my work.</p>
<p>Why &#8220;almost&#8221;? Because I have some other USB 500GB hard disks with video projects. Videos can consume a lot of hard disk space, so it&#8217;s better to dedicate an entire hard disk to each project</p>
<p><strong>2) I create a folder for each branch of my projects</strong></p>
<p><img src="/wp-content/uploads/2010/02/store01.jpg" /></p>
<p>In the picture you can see four directories. Two are obvious, while &#8220;Beta&#8221; contains all the abandoned projects and &#8220;No internet&#8221; contains all the projects I did not develop for the web, such as executable software, brochures, business cards, and so on. As said, videos are on other hard disks.</p>
<p>Obviously, the folders you will have may vary according to the type of projects you are working on&#8230; so you couldn&#8217;t have &#8220;Flash games&#8221; but you could have &#8220;Magazines&#8221;&#8230; this depends on your work.</p>
<p>Just remember: don&#8217;t delete anything. Never. That&#8217;s why I have a directory for abandoned projects. Hard disk are so inexpensive you can afford a lot of them<span id="more-2385"></span></p>
<p><strong>3) Inside each branch folder, I create folders with single projects</strong></p>
<p><img src="/wp-content/uploads/2010/02/store02.jpg" /></p>
<p>This is a screenshot of the &#8220;Websites&#8221; folder. As you can see, there are a lot of them! And they&#8217;re about four times the ones I was able to show you in the picture. Each folder is named with the site domain name, so I don&#8217;t have to remember if &#8220;Yeah inc.&#8221;&#8216;s website is located at &#8220;yeahinc.com&#8221;, &#8220;yeah-inc.org&#8221; or &#8220;yeah-company.net&#8221;</p>
<p>Also, I don&#8217;t start folder names with &#8220;www.&#8221; because almost every website starts with &#8220;www.&#8221;&#8230; I won&#8217;t be able to find the right site in a couple of seconds.</p>
<p>Last but not least, when I redesign a site I made &#8211; let&#8217;s say &#8211; in 2007, create another folder with the same name, followed by the year, such as &#8220;yeahinc.com (2010)&#8221; so I can quickly get my hands on the right content</p>
<p><strong>4) Inside each project folder, I create a folder for every topic</strong></p>
<p><img src="/wp-content/uploads/2010/02/store03.jpg" /></p>
<p>In the picture you can see all folders related to the websites divided by category. Sorry for some italian names, but as said this is my real way to store my work. As you can see, there is a folder for Photoshop files, one for Autocad ones, and so on.</p>
<p>Also notice the backups. Always keep both old versions of your projects and the last one. Using unix dates will make your life easier when you&#8217;re about to look for the right content.</p>
<p>If your site has a dynamic database, like a blog, an e-commerce site and so on, remember to backup your databases at least once a week</p>
<p><strong>5) Inside a topic folder I store all files with the right names</strong></p>
<p><img src="/wp-content/uploads/2010/02/store04.jpg" /></p>
<p>Don&#8217;t call files &#8220;Untitled.psd&#8221; or &#8220;File01.fla&#8221;, but use the unix data followed by a name that will help you to remember what&#8217;s inside that file. This way, when you&#8217;re looking for the last header you&#8217;ll just have to look for the file with &#8220;header&#8221; in its name with the highest date.</p>
<p><strong>6) Everything I showed you in this post is actually stored in TWO hard disks</strong></p>
<p>I don&#8217;t want to see all your work destroyed because my daughter made the hard disk fall on the ground&#8230; so every month I spent a couple of hours to syncronize two hard disks. This will grant me a longer life because I won&#8217;t suicide in case one hard disk will cease to live.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2010/02/18/saving-and-storing-your-work/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Being a geek in Venezuela</title>
		<link>http://www.emanueleferonato.com/2010/02/03/being-a-geek-in-venezuela/</link>
		<comments>http://www.emanueleferonato.com/2010/02/03/being-a-geek-in-venezuela/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 09:47:47 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Monetize]]></category>
		<category><![CDATA[PROgramming]]></category>
		<category><![CDATA[Users contributions]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=2317</guid>
		<description><![CDATA[Yesterday I bought a MacBook on the Apple Store using some of the income generated by this blog. Do you know why I could do this? Because I am a geek, and because I live in Italy. If I lived in Venezuela, things could have been quite different. This is the story of John Freddy [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I bought a MacBook on the Apple Store using some of the income generated by this blog. Do you know why I could do this? Because I am a geek, and because I live in Italy.</p>
<p>If I lived in Venezuela, things could have been quite different. This is the story of <strong>John Freddy Vega</strong>, a blogger and geek from Venezuela.</p>
<p>He runs <a href="http://www.cristalab.com/" target = "_blank"><strong>Cristalab</strong></a>, a blog full of AS3 and PHP tips, just like mine. But it&#8217;s not as easy as it seems.</p>
<p>&laquo; Any self-respecting geek has certain <strong>basic needs</strong>, and Venezuelans are no exception: smartphones, laptops, permanent internet connection, access to information and, above all, the <strong>ability to purchase</strong> a lot of stuff we love although we don&#8217;t need it at all.</p>
<p><img src="/wp-content/uploads/2010/02/flag-venezuela.gif" /></p>
<p>That&#8217;s why Venezuela&#8217;s technology case is so curious. We are one of the Countries with <strong>highest Blackberry penetration</strong>, so much so that <strong>RIM</strong> (Research In Motion: the Canadian company that developes the BlackBerry smartphone) people were forced to know we&#8217;re not an African country, we have crappy but still profitable Internet connections and we can even (in many cases) afford a cable TV. <span id="more-2317"></span></p>
<p>On the other side, we are a Country under <strong>heavy control</strong> by the Government about the purchase of dollars, either to travel (in which case the Government itself tells you how many dollars you can purchase, at a given fee) and for internet shopping (which limit &#8211; the so called &#8220;quota limit&#8221; &#8211; is <strong>$400</strong>). </p>
<p><strong>The control over dollars makes it impossible to buy on the Internet </strong></p>
<p>Do you charge in dollars? Then you must sell them to the Government, that pays you in the official currency, with a currency exchange set by the Government itself (at the time of writing this article, 4.30 Bolivars for every dollar) and you can&#8217;t have dollar deposits in Venezuelan banks unless you have so much money that they&#8217;ll open for you a deposit abroad and let you manage it from your bank. </p>
<p>These restrictions are particularly annoying to the geek, when he wants to do things than almost any other Latin American geek can do, like buying a new Tablet on eBay or on Amazon, or buying a Geek Pillow. Needless to say we can&#8217;t buy things like the iPad or &#8211; much more to my taste &#8211; the Nexus One from Apple or Google pages.</p>
<p><strong>Venezuela used to be a technological Country </strong></p>
<p>In the rest of Latin America, Venezuela is seen (or has been seen for many years) as a rich country, thanks to large amounts of money due to oil incomes. The unseen truth unveils high poverty levels, which increase as we get devaluations (recently we had the last one, 100%) and that our ability to acquire foreign currency and/or items brought from abroad is becoming more and more complicated. Consumption limits and exchange controls are now part of our biggest problems (not to mention other problems like the energy crisis or the bad water service we are suffering in this moment). </p>
<p>Just to say one example, not so long ago the technology gap between U.S. and Venezuela was about <strong>a week</strong>, and this made Venezuela an highly technological Country. Now the gap can be of <strong>months</strong>. </p>
<p><strong>You can leave the Country only if approved by the Government</strong> </p>
<p>I still bitterly recall that because of these limitations I couldn&#8217;t go to <strong>Adobe Live 2009</strong> in Lima, and before that I couldn&#8217;t go to Bogota to an Aikido seminar with two of the most important masters of the continent in this Martial Art. Things that for other people are just a matter of having or not having enough money to afford them, for us it&#8217;s a matter of having the luck our currency is authorized and not exceeding the limit imposed. </p>
<p>We must clarify something: currency regulation is nothing new, and it&#8217;s a valid idea under certain circumstances, moreover it&#8217;s not the first time we have it. What&#8217;s illegal is: 1. It is not common to have limited access to foreign exchange 2. A control on the price of the dollar should be a temporary measure, usually a couple of months at most. We&#8217;re having it for about 3 years. </p>
<p><strong>How to deal with these restrictions</strong> </p>
<p>If you need the new MacBook, or the Nexus One or whatever, your solution is getting the money through Paypal (which has no agreements with any bank in the Venezuela), having someone bringing them from abroad and pay them in Bolivars, then buy it on the local market with <strong>prices that can even be three times the original price in foreign markets</strong> or get dollars in the parallel market (black market). </p>
<p>I do not want to enter the political issue, which is always tricky, but make it clear that being geek in my Country, Venezuela is becoming a more and more complicated issue, usually with more disappointments than successes. </p>
<p>I am sure we will seek ways to keep up on what we love and &#8211; in many cases &#8211; what feeds us. </p>
<p>Be careful when you are choosing who you want to be at the Government. &raquo;</p>
<p>Do you live in a Country with restrictions? Share with us your experience, contact me to have it published.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2010/02/03/being-a-geek-in-venezuela/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>11 questions to ask to yourself once you complete a project</title>
		<link>http://www.emanueleferonato.com/2009/12/15/11-questions-to-ask-to-yourself-once-you-complete-a-project/</link>
		<comments>http://www.emanueleferonato.com/2009/12/15/11-questions-to-ask-to-yourself-once-you-complete-a-project/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 22:39:00 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[PROgramming]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=2070</guid>
		<description><![CDATA[Let&#8217;s say you just finished a project&#8230; no matter whether a website or a Flash game&#8230; but you finished it right now. Let&#8217;s suppose your client gave you a deadline, or you just wanted to finish it today because tomorrow you&#8217;ll be busy on another project, or you&#8217;ll have some holidays. In most cases, you [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you just finished a project&#8230; no matter whether a website or a Flash game&#8230; but you finished it right now.</p>
<p>Let&#8217;s suppose your client gave you a deadline, or you just wanted to finish it today because tomorrow you&#8217;ll be busy on another project, or you&#8217;ll have some holidays.</p>
<p>In most cases, you know the whole project can be optimized. Depending on the project complexity, you will see a lot of things you could improve to make the project run faster, look better, being more understandable and  &#8211; above all &#8211; reusable.</p>
<p>Unfortunately, in most cases we prefer to leave it &#8220;as is&#8221; since &#8220;it works&#8221; and &#8220;that&#8217;s enough&#8221;, because we think the customer is already satisfied</p>
<p>I have to say, once I finish a project, I promise myself to keep it as clean as I can, even if I know I won&#8217;t be able to reuse anything&#8230; like, as example, a website. But as I have a lot of work, almost all the times I end leaving the project &#8220;as is&#8221;.</p>
<p>While you can&#8217;t work for the rest of your life to the same project, there are 11 questions you should ask yourself before you can consider a project as &#8220;completed&#8221;</p>
<p>Let&#8217;s see them:<span id="more-2070"></span></p>
<p><strong>1) Are all loaded libraries necessary?</strong> Or did you start your website with Prototype just to find jQuery was better? In this case did you remove Prototype scripts? Why are you still using mouse listeners if you decided to steer your car with arrow keys? Remove all unused libraries to speed up the project.</p>
<p><strong>2) Did you use some &#8220;quick&#8221; variables such as <code>$temp</code> or <code>$a</code></strong>? Try to imagine yourself changing something in your project after six months your customer is using it. Can you remember that <code>$temp</code> holds the temporary array of salaries? Why didn&#8217;t you call it <code>$temp_salary_array</code>?</p>
<p><strong>3) If you are using OOP, do you have classes that could (or maybe should) be split in subclasses?</strong> Remember that 10 small classes are way more reusable than a big one.</p>
<p><strong>4) Did you comment the core of the code?</strong> Again, try to imagine yourself changing something after six months. You can&#8217;t remeber the meaning of every <code>while</code> loop, unless you comment at least the most important ones</p>
<p><strong>5) Are there unused files in your directory?</strong> This may happen when the customer wants to remove some content, such as a picture, from a web page. In most cases you modify the HTML without physically deleting the unused files. And if this unused file is an indexed web page, the problem remains as search engines will still drive traffic to the page. </p>
<p><strong>6) Is your project ready for next-generation resolution?</strong> Remember screen resolution changes&#8230; are your background seamless to face a higher resolution? Do they fade? Does your page have some appeal on a tiny netbook?</p>
<p><strong>7) What if you are going to sell/give the source code?</strong> Is the code ready to be sold? Or is it just a bunch of patches to make something work in some way? </p>
<p><strong>8) Did you keep all necessary files to make occasional changes?</strong> Imagine the customer wants to change the color of the header of the website you created, and you don&#8217;t have anymore the Photoshop/Illustrator file&#8230;</p>
<p><strong>9) Did your put your name or your company name somewhere?</strong> Always try to put your name and your link somewhere. It&#8217;s called marketing. And&#8230; no, your name shouldn&#8217;t blink and shouldn&#8217;t be bigger than the customer name</p>
<p><strong>10) Did you sanitize user input?</strong> Or are you ready to handle the customer calling you every day to complain about spam forms trying to sell viagra? From his drills online shop?</p>
<p><strong>11) What if a competitor tries to find weak points of your project?</strong> Some designers do not have any ethic and won&#8217;t hesitate to show the customer the weak points and bugs of your work to aquire your customer. Try not to leave anything someone else can use to steal your client.</p>
<p>Do you follow there principles? Do you follow some more? Let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/12/15/11-questions-to-ask-to-yourself-once-you-complete-a-project/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Keep your WordPress Blog (or any site) clean with new Google Webmaster Tools</title>
		<link>http://www.emanueleferonato.com/2009/10/14/keep-your-wordpress-blog-or-any-site-clean-with-new-google-webmaster-tools/</link>
		<comments>http://www.emanueleferonato.com/2009/10/14/keep-your-wordpress-blog-or-any-site-clean-with-new-google-webmaster-tools/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 20:27:34 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[PROgramming]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=1743</guid>
		<description><![CDATA[Yesterday I blogged about 10 ways to secure your WordPress blog Today I found a new, important tool to keep your blog (or site) clean: Google Webmaster Tools and its new services &#8220;Fetch as Googlebot&#8221; and &#8220;Malware details&#8221;. Once you enter into Webmaster Tools you will find on the left Dashboard sidebar a Labs item [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I blogged about <a href="http://www.emanueleferonato.com/2009/10/14/10-ways-to-secure-your-wordpress-blog/">10 ways to secure your WordPress blog</a></p>
<p>Today I found a new, important tool to keep your blog (or site) clean: <a href="https://www.google.com/webmasters/tools/home?hl=en">Google Webmaster Tools</a> and its new services &#8220;Fetch as Googlebot&#8221; and &#8220;Malware details&#8221;.</p>
<p><img src="/wp-content/uploads/2009/10/wtools01.png" /></p>
<p>Once you enter into Webmaster Tools you will find on the left Dashboard sidebar a Labs item with two sub-items: &#8220;Fetch as Googlebot&#8221; and &#8220;Malware details&#8221;.</p>
<p><img src="/wp-content/uploads/2009/10/wtools02.png" /></p>
<p>&#8220;Fetch as Googlebot&#8221; answer the common question &#8220;What does Googlebot see when it accesses my page?&#8221;<span id="more-1743"></span></p>
<p>Now you can submit pages of your site and get (almost) real-time feedback on what Googlebot sees.</p>
<p><img src="/wp-content/uploads/2009/10/wtools03.png" /></p>
<p>This feature will help users a great deal when they re-implement their site with a new technology stack, find out that some of their pages have been hacked, or want to understand why they&#8217;re not ranking for specific keywords. </p>
<p><img src="/wp-content/uploads/2009/10/wtools04.png" /></p>
<p>&#8220;Malware details&#8221; provides webmasters with samples of the malicious code that Google&#8217;s automated scanners detected on their sites.</p>
<p>If some pages of your site distribute malware, you will find a list of such pages and in some cases &#8220;Malware details&#8221; can identify the underlying cause of the malicious code, and provide these details if possible.</p>
<p><img src="/wp-content/uploads/2009/10/wtools05.png" /></p>
<p>Fortunately, I have no malware threats at the moment&#8230; these services are still in beta (called &#8220;Labs&#8221; from Google guys) so may change, break or disappear at any time.</p>
<p>I strongly suggest you to try them and read the <a href="http://googlewebmastercentral.blogspot.com/2009/10/fetch-as-googlebot-and-malware-details.html">official blog entry</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/10/14/keep-your-wordpress-blog-or-any-site-clean-with-new-google-webmaster-tools/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The return of &#8220;Under Construction&#8221; &#8211; evolution of a malpractice</title>
		<link>http://www.emanueleferonato.com/2009/09/16/the-return-of-under-construction-evolution-of-a-malpractice/</link>
		<comments>http://www.emanueleferonato.com/2009/09/16/the-return-of-under-construction-evolution-of-a-malpractice/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 16:17:17 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[PROgramming]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=1655</guid>
		<description><![CDATA[In the late 90&#8242;s most personal and some commercial websites used to place a big, animated, irritating image like this one: This picture, placed in a webpage browsed at a 800&#215;600 resolution (the most popular one during those years), fills half of the visible area. This means the page was shouting &#8220;hey, I am incomplete, [...]]]></description>
			<content:encoded><![CDATA[<p>In the late 90&#8242;s most personal and some commercial websites used to place a big, animated, irritating image like this one:</p>
<p><img src="/images/uc.gif" alt="" /></p>
<p>This picture, placed in a webpage browsed at a 800&#215;600 resolution (the most popular one during those years), fills half of the visible area.</p>
<p>This means the page was shouting &#8220;hey, I am incomplete, probably I will never be completed so what are you doing here?&#8221;</p>
<p>We know a good site is always under construction. This blog is always under construction. I add new content almost every day.</p>
<p>As co-owner of a web agency, I notice almost all customers ask some minor changes to their sites about every six months&#8230; no matter if it&#8217;s a new set of photos or an update to the &#8220;about&#8221; page&#8230; they are changing.<span id="more-1655"></span></p>
<p>So we can say all good sites are always under construction&#8230; the only &#8220;fully constructed&#8221; ones are the ones showing &#8220;under construction&#8221;&#8230; most of these sites are updated less than once in a year.</p>
<p>Not to say someone is even able to make typo&#8230;</p>
<p><img src="/images/costruction.jpg" alt="" /></p>
<p>Will you ever come back to that site?</p>
<p>But I have good news: nowadays &#8220;under construction&#8221; is disappearing&#8230; but another menace is approaching our monitors&#8230; directly from the Greek alphabet&#8230;</p>
<p><img src="/images/beta.png" alt="" /></p>
<p>From <a href="http://en.wikipedia.org/wiki/Beta_version#Beta" target = "_blank">Wikipedia</a>: A &#8220;beta version&#8221; is the first version released outside the organization or community that develops the software, for the purpose of evaluation or real-world black/grey-box testing. The process of delivering a beta version to the users is called beta release. Beta level software generally includes all features, but may also include known issues and bugs of a less serious variety.</p>
<p>Unlike &#8220;under construction&#8221;, &#8220;beta&#8221; has a meaning&#8230; the problem is this term is abused.</p>
<p>A good Web 2.0 site is always in beta because new features are added constantly and you may experience strange bugs like the <a href="http://www.emanueleferonato.com/2009/08/20/facebook-bug-none-of-my-friends-can-view-my-profile-wall-photos/">Facebook one</a>&#8230; but Facebook does not show &#8220;beta&#8221;&#8230;</p>
<p>And the interesting thing is most &#8220;beta&#8221; sites show the &#8220;beta&#8221; status in a creative way&#8230; this is a small list of sites in &#8220;beta&#8221; for ages&#8230;</p>
<p><img src="/images/betas.jpg" alt="" /></p>
<p>So, if &#8220;under construction&#8221; means &#8220;I&#8217;ll never finish this page&#8221;, &#8220;beta&#8221; now means &#8220;I don&#8217;t know if it will work&#8221;&#8230; not that interesting.</p>
<p>Do you have sites in beta/under construction?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/09/16/the-return-of-under-construction-evolution-of-a-malpractice/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Understanding (AS3) access modifiers (Public, Internal, Protected, Private)</title>
		<link>http://www.emanueleferonato.com/2009/08/26/undserstanding-as3-access-modifiers-public-internal-protected-private/</link>
		<comments>http://www.emanueleferonato.com/2009/08/26/undserstanding-as3-access-modifiers-public-internal-protected-private/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 13:36:11 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[PROgramming]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=1576</guid>
		<description><![CDATA[I see a lot of confusion around the web about access modifiers, so I am going to give a brief explication about them. First, if you noticed the post title, you&#8217;ll see I wrote AS3 in brackets because access modifiers have not been introduced with AS3, but AS3 finally featured access modifiers. As far as [...]]]></description>
			<content:encoded><![CDATA[<p>I see a lot of confusion around the web about access modifiers, so I am going to give a brief explication about them.</p>
<p>First, if you noticed the post title, you&#8217;ll see I wrote AS3 in brackets because access modifiers have not been introduced with AS3, but AS3 finally featured access modifiers.</p>
<p>As far as I can remember, access modifiers came from C, or at least I started studying them when I was programming with C.</p>
<p>Acess modifiers are anguage keywords for specifying the visibility of classes and members, that means they determine which code may access classes and class members.</p>
<p>Just think about a bartender in a exclusive pub that may require membership, and everything will be easier.</p>
<p><strong>public</strong> (available to all code): allows access from every class&#8230; the bartender will attend everyone, no matter where he&#8217;s coming from</p>
<p><strong>internal</strong> (available within the same package): allows Classes sharing this package access&#8230; the bartender will attend only people somehow related with the pub (workers that built it, people involved in furnishing, and so on)&#8230; this definition may lead to misunderstandings, so let&#8217;s say access is limited exclusively to classes defined within the current project.</p>
<p><strong>protected</strong> (availabile within the same class and subclasses): allows subclasses access&#8230; the bartender will only attend customers with membership and their sons</p>
<p><strong>private</strong> (available only within the same class): allows access only by the same class&#8230; the bartender will only attend customers with membership</p>
<p>Now the big question: is it so important to use the right access modifier?&#8230; I have to say in most small projects that you&#8217;re sure you&#8217;ll be the only one using them, you can define everything as public and forget about the rest, but obviously if you are looking for reusability and portability, you should pay attention to access modifiers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/08/26/undserstanding-as3-access-modifiers-public-internal-protected-private/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
