tag:blogger.com,1999:blog-80541851496313936312024-02-07T12:00:02.368+08:00Scratching the ArduinoAnonymoushttp://www.blogger.com/profile/05605261175282274646noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-8054185149631393631.post-27987084314674712422014-11-27T01:51:00.001+08:002014-11-27T01:51:15.384+08:00Mapping two range of numbers<div class="MsoNormal">
<br />
<div class="MsoNormal">
<span lang="EN-MY" style="background: white; font-family: Arial, sans-serif;">Math has never been my favourite subject during my
school days and I’ve always asked why do we need to learn Math. It would have
changed my mind and become more interesting if students have been taught how
Math can be applied in the real world. <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-MY" style="background: white; font-family: Arial, sans-serif;">Take for example a simple linear equation y = mx
+ C, given two points and we can find an equation of the line. <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-MY" style="background: white; font-family: Arial, sans-serif;">So what’s the big deal with finding an equation
of a line and what can it practically do in the real world ??<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-MY" style="background: white; font-family: Arial, sans-serif;">Here’s the answer.<o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<span lang="EN-MY" style="background: white; font-family: Arial, sans-serif;">Suppose you would like to </span><span lang="EN-MY" style="background: white; color: #2c3e50; font-family: "Arial","sans-serif";">plot a trigonometric function of “sine”, with an amplitude of 10, over a horizontal range of 0 to 360 degrees,
we would find the graph as tabled below</span><span style="background: white; font-family: Arial, sans-serif;"><o:p></o:p></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwoFf41eMXx1OUAaCzaDtWBKdnsnJbPpf1ZobHZiK1R83XJJ7jQegN2Jl4GmlqpThFv5rgmkivBa5xnfqDTutYYmuG8TxAeJMy_mN-Oi7qNUmFfQYQi9v0RwYRSHAjxa0UkZIRwohwetY/s1600/sine_plot.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwoFf41eMXx1OUAaCzaDtWBKdnsnJbPpf1ZobHZiK1R83XJJ7jQegN2Jl4GmlqpThFv5rgmkivBa5xnfqDTutYYmuG8TxAeJMy_mN-Oi7qNUmFfQYQi9v0RwYRSHAjxa0UkZIRwohwetY/s1600/sine_plot.PNG" height="300" width="640" /></a></div>
<br /></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<span style="background: white; font-family: Arial, sans-serif;">FIG 1<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="background: white; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<div class="MsoNormal">
<span lang="EN-MY" style="background: white; font-family: Arial, sans-serif;">Note that the value on the X-axis is given the
same value as the angle θ since we can assign the positive range of the X-Axis
from 0 to 360. The Y-Axis represents the amplitude of the waveform.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-MY" style="background: white; font-family: Arial, sans-serif;">However, plotting similar graph with Scratch is a
different game altogether. </span><span style="background-color: white; font-family: Arial, sans-serif;">In Scratch, the screen has a resolution of
480x360 pixels (FIG.2), such that the X-Axis range from -240 to 240 instead of
0 to 360 as seen from FIG.1 </span></div>
<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPdwRzEY5tq1CrOU-2y3bWKxLNiiAf2_DQn_FMwpQghCszjkoXnctGzwZEQNQ5NjOxvQSAji3RW_SMd0i_fGto9PONg0GhP2eJnBNcq_RHNC_as-BdbpJ0fq_AaCuaBT1CdyyFHGfuLW8/s1600/XY+coordinates.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPdwRzEY5tq1CrOU-2y3bWKxLNiiAf2_DQn_FMwpQghCszjkoXnctGzwZEQNQ5NjOxvQSAji3RW_SMd0i_fGto9PONg0GhP2eJnBNcq_RHNC_as-BdbpJ0fq_AaCuaBT1CdyyFHGfuLW8/s1600/XY+coordinates.PNG" /></a></div>
<div class="MsoNormal" style="text-align: center;">
<span style="background: white; font-family: Arial, sans-serif;"><span style="font-size: 11pt;">FIG. 2 Scratch screen</span></span></div>
<div class="MsoNormal">
<span style="background: white; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="background: white; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="background: white; font-family: Arial, sans-serif;"></span></div>
<div class="MsoNormal">
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif";">How
do you plot the points on the graph across the screen where the X-Axis range
from -240 to 240 with a complete cycle of 0 to 360 deg ??? In other words, we
need to translate the whole range of 0-360 degrees proportionately to a range
of -240 to 240 on the X-Axis as shown below,<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif";"><br /></span></div>
</div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMhTb6q6FaWqi2s5K3yoi3WAShifjTw0_g8t75fPFK3X3Gkx6e2rzYPooZlGBhFoX5Up9pFDE5-aNs_7pTor5IXUJUfG2nNLJPYd3SJQATnAMmApkRuXTRqzwbQNoYVZ0WkF6l-fsfu98/s1600/scale.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMhTb6q6FaWqi2s5K3yoi3WAShifjTw0_g8t75fPFK3X3Gkx6e2rzYPooZlGBhFoX5Up9pFDE5-aNs_7pTor5IXUJUfG2nNLJPYd3SJQATnAMmApkRuXTRqzwbQNoYVZ0WkF6l-fsfu98/s1600/scale.png" height="123" width="400" /></a></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<span style="font-family: "Arial",sans-serif;">FIG.3<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif";">FIG.3
denotes that if the value of the angle is 0, it is translated to -240 on the
X-Axis, 90 deg to -120, 180 deg to 0 etc.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif";">The
translation of one range of numbers to another is often called “mapping” or
“scalling”.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<br />
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif";">Let’s
revisit the linear equation,<o:p></o:p></span></div>
</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWcLusC4FK9MXzDz1vEzsmR5LqA0R50tZOyl0fa-HnwvsqKgRi1c9Dy695wsaduASkC1TVc3jq11oVwqP5Jf4BRdpX02VEWoQKTwIlVOngBapsT7Bjko5dkIVF6Q75npcgXuzUTI7GBRo/s1600/eqn1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWcLusC4FK9MXzDz1vEzsmR5LqA0R50tZOyl0fa-HnwvsqKgRi1c9Dy695wsaduASkC1TVc3jq11oVwqP5Jf4BRdpX02VEWoQKTwIlVOngBapsT7Bjko5dkIVF6Q75npcgXuzUTI7GBRo/s1600/eqn1.PNG" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">Note that
the x and y in eqn(1) are not the points on the X-Y coordinates of the screen.
It’s just an expression of two range of numbers where y represents a set of
number and x represents another set. <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<br />
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">In our
case, we would like to map the angle (0-360 deg) to the full range on the
X-Axis (-240 to 240). Hence y, being the desired output, represents the values
that lies on the X-Axis and x represents the value of the angles (0 to 360 deg)
to be mapped.<o:p></o:p></span></div>
</div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">Re-writing eqn(1) with its min and max value, we have,</span></div>
<div class="MsoNormal">
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYRq4Sya54TEHtZxg43_0thozC04uM_kIn83kQENldqL6K-auvjnmLtaWQ2NdGMuMqNmZThCknT7ycWVGIVi7VWv72TSw5CjHZUAH51cgTJJyZzpjDry6aFX05p2_CiMfjrJLE0qUcpsc/s1600/eqn2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYRq4Sya54TEHtZxg43_0thozC04uM_kIn83kQENldqL6K-auvjnmLtaWQ2NdGMuMqNmZThCknT7ycWVGIVi7VWv72TSw5CjHZUAH51cgTJJyZzpjDry6aFX05p2_CiMfjrJLE0qUcpsc/s1600/eqn2.PNG" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">The min
and max values of the two sets of numbers are :<o:p></o:p></span></div>
</div>
<div class="MsoNormal">
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_Qzi_b0ZRjGAXDCQn_Mg43pCvmB5IJWQdyPoHiqtyancH3pMYA2T3DVqj_pYMkxnvX7_7cB3OryHJxbIG1rMaMXR1sx4HBGxFVZvlSa7mtsaJKAz_TJZ1PF8f1pBgabPa7XemFgaMnEk/s1600/range.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_Qzi_b0ZRjGAXDCQn_Mg43pCvmB5IJWQdyPoHiqtyancH3pMYA2T3DVqj_pYMkxnvX7_7cB3OryHJxbIG1rMaMXR1sx4HBGxFVZvlSa7mtsaJKAz_TJZ1PF8f1pBgabPa7XemFgaMnEk/s1600/range.PNG" height="117" width="320" /></a></div>
<br />
<br /></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span>
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span>
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span>
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span>
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span>
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span>
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><span style="font-family: Arial, Helvetica, sans-serif;">Let’s solve for m and C.</span><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<div class="MsoNormal">
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">Subtracting
eqn(2) from 3, we have<o:p></o:p></span></div>
</div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Wds4QAFNE4IZcx8zTS5a9XlIX1pmMnR31I0SlveaC-UmfPil2CIF9sIbxnzrIARqWaX1wJHBlBBx9jtMCoLRP0XIWSpvqXfPbIOaH_BXbkBIlVId-5xiAFhm5w_AFVuR6kpcQoAPgrE/s1600/eqn4.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Wds4QAFNE4IZcx8zTS5a9XlIX1pmMnR31I0SlveaC-UmfPil2CIF9sIbxnzrIARqWaX1wJHBlBBx9jtMCoLRP0XIWSpvqXfPbIOaH_BXbkBIlVId-5xiAFhm5w_AFVuR6kpcQoAPgrE/s1600/eqn4.PNG" height="25" width="400" /></a></div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<div class="MsoNormal">
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">Re-arranging
eqn(4) yields<o:p></o:p></span></div>
</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnPvBpkelq1eTTpm-9AbWONmH1w44ueNqZP9l5pSuR2Q85ljyQjUuUU5f5OFBGe-Tk2Z0x0qLyNZiiWkgOYTOMZeguMPF7BOE9Usl9ZMIqwLXit_IAgxGkAdG6dsk6q4Ezy9ekeYzVXyo/s1600/eqn5.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnPvBpkelq1eTTpm-9AbWONmH1w44ueNqZP9l5pSuR2Q85ljyQjUuUU5f5OFBGe-Tk2Z0x0qLyNZiiWkgOYTOMZeguMPF7BOE9Usl9ZMIqwLXit_IAgxGkAdG6dsk6q4Ezy9ekeYzVXyo/s1600/eqn5.PNG" /></a></div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqqPsM9IW1Tpii2xmF6-ioWbUFgCBGeRziAAfGalUGtfzRj4ZuhFZBdLKemv33JkEp6dx_lsT_66OVQGPauxKkUpBQGva9dshQT-R-cznZXY0mG07k0F8vst_oxIglrhP8MaO8DMtV-9o/s1600/eqn5-1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqqPsM9IW1Tpii2xmF6-ioWbUFgCBGeRziAAfGalUGtfzRj4ZuhFZBdLKemv33JkEp6dx_lsT_66OVQGPauxKkUpBQGva9dshQT-R-cznZXY0mG07k0F8vst_oxIglrhP8MaO8DMtV-9o/s1600/eqn5-1.PNG" /></a></div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<div class="MsoNormal">
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: Arial, sans-serif;">Replacing m from eqn(5) in eqn(3), we can now solve the constant C.</span><span lang="EN-MY" style="font-family: 'Times New Roman', serif;"><o:p></o:p></span></div>
</div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEC6Fx-zXRELp_aZz9mESamZ0BFiBGMrh3JLjSisQOFy-DSa_5g2zGX-1Ez4FU2fhl0tiqi641vIsuXxlfBulPaCcBBzKHN6sc_F_wX-inFx2VlM0sR9Jrvt-V4c3Z6xmHvicGU7O-MbU/s1600/eqn6.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEC6Fx-zXRELp_aZz9mESamZ0BFiBGMrh3JLjSisQOFy-DSa_5g2zGX-1Ez4FU2fhl0tiqi641vIsuXxlfBulPaCcBBzKHN6sc_F_wX-inFx2VlM0sR9Jrvt-V4c3Z6xmHvicGU7O-MbU/s1600/eqn6.PNG" height="96" width="400" /></a></div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="MsoNormal">
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">Replacing
m and C in eqn(1) :<o:p></o:p></span></div>
</div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLIBsHcp5WH2JRC1qSsefevbdBtyNyMa8luRA3JlejQ-u1wP1IWjpqkiS9fOKHK8N-ZrAk3lOVEF91VMtjmGX5qlXcQHbeLuINLaxYXItEIhhwoAynJq-wHqTnuXG1hAF8fqLXb52priE/s1600/eqn7-1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLIBsHcp5WH2JRC1qSsefevbdBtyNyMa8luRA3JlejQ-u1wP1IWjpqkiS9fOKHK8N-ZrAk3lOVEF91VMtjmGX5qlXcQHbeLuINLaxYXItEIhhwoAynJq-wHqTnuXG1hAF8fqLXb52priE/s1600/eqn7-1.PNG" height="47" width="400" /></a></div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<div class="MsoNormal">
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">Re-arranging
the above equation,<o:p></o:p></span></div>
</div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzDViEJphye1gCYL9ZuwbTIn15FdANADTsQcHHe_h_htBTStNl_THdQMHYEWZ9P2VyGiCSpkJIqmymWDxDlxObtVZYRpsrxo2gdmZKB6MZboH2pykipKJfm_EPrcr5vtvRzwZdp9WNdZg/s1600/eqn7.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzDViEJphye1gCYL9ZuwbTIn15FdANADTsQcHHe_h_htBTStNl_THdQMHYEWZ9P2VyGiCSpkJIqmymWDxDlxObtVZYRpsrxo2gdmZKB6MZboH2pykipKJfm_EPrcr5vtvRzwZdp9WNdZg/s1600/eqn7.PNG" height="47" width="400" /></a></div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<div class="MsoNormal">
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">We had
earlier defined that <o:p></o:p></span></div>
</div>
<div class="MsoNormal">
<span style="font-family: "Arial",sans-serif; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRPUjF_mzS3mu2WPGmbEh-A-Wqc0XIGLoarRm3QF9cxz1IOg1tgXZQVQ1VQ8rOt52gawR7FHC2teeYIvbumq4dxUi_rfoIguinOQMyvxXrWfxbufF9F1-g8WXzTf3zdAzh_jf19xhfYAE/s1600/Capture.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRPUjF_mzS3mu2WPGmbEh-A-Wqc0XIGLoarRm3QF9cxz1IOg1tgXZQVQ1VQ8rOt52gawR7FHC2teeYIvbumq4dxUi_rfoIguinOQMyvxXrWfxbufF9F1-g8WXzTf3zdAzh_jf19xhfYAE/s1600/Capture.PNG" height="84" width="640" /></a></div>
<br /></div>
<div class="MsoNormal">
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">Let’s
rename the above symbols to make our life easier, i.e,<o:p></o:p></span></div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_p9IAO5ssK_cyVAaer-ogZprw3IIEfe4gO8G9wSa_W41OyVB_n9f0C3xQfnp_bo0r9qJIAjbciF5la6fZjyjBRj3OYqA1rIVYarvcHCgQ5UcSmYBkuu9pCYDw2kcfJ-cBfAweDTSLJIA/s1600/Capture1.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_p9IAO5ssK_cyVAaer-ogZprw3IIEfe4gO8G9wSa_W41OyVB_n9f0C3xQfnp_bo0r9qJIAjbciF5la6fZjyjBRj3OYqA1rIVYarvcHCgQ5UcSmYBkuu9pCYDw2kcfJ-cBfAweDTSLJIA/s1600/Capture1.PNG" /></a></div>
<br />
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, sans-serif;">Renaming y
in eqn(7) to x (the desired points on the X-Axis) and replace with the new
symbols, we have</span></div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6QDBYGYZ4nooASx9N7sDjPkHkEcYYvcb-qRf-I0GK6I2AgF5BKwTHDjO4oMEIbIWAeqnUVhvOOFuO5ABD1jE17JgO6pnKaKy2rqi08f-KF4vjtmwkMtVgraUDOT4YOmowA8R5X727nCs/s1600/eqn8.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6QDBYGYZ4nooASx9N7sDjPkHkEcYYvcb-qRf-I0GK6I2AgF5BKwTHDjO4oMEIbIWAeqnUVhvOOFuO5ABD1jE17JgO6pnKaKy2rqi08f-KF4vjtmwkMtVgraUDOT4YOmowA8R5X727nCs/s1600/eqn8.PNG" height="48" width="400" /></a></div>
<br />
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">We can now
plot the graph as shown below.<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKMOTVt9p5iIgMEiHnuXrH_RvqlQWMbln8UY4MIooLQQrgYsId4yBZc4KMqfTv7-BL8kjT3xgDmwtnPcW7Kc2HoPhcSXn_XtX5VGwoYNpErV9t8cIANRDwm7U0toEOU3VW4hyphenhyphenBDbscrNs/s1600/sine_plot1.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKMOTVt9p5iIgMEiHnuXrH_RvqlQWMbln8UY4MIooLQQrgYsId4yBZc4KMqfTv7-BL8kjT3xgDmwtnPcW7Kc2HoPhcSXn_XtX5VGwoYNpErV9t8cIANRDwm7U0toEOU3VW4hyphenhyphenBDbscrNs/s1600/sine_plot1.PNG" height="312" width="640" /></a></div>
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;"><br /></span></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">Below is
the Scratch script to plot a “sine” function with and amplitude of 150.<o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">A block is
also created to map the above discussed two range of numbers.<o:p></o:p></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJZMHkkYQtqbudtucSoIYHpM9PqvzHT0i2kUcMU7rmFO8tJDMCC3fXBiEaRY1xFpH18hljXBDJNe2je6kqPUqNsxstoXKNUwRh1PJSPz207sYjaCRF6aV5uhgo-PNq0H26WgQtHIjOCsE/s1600/script.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJZMHkkYQtqbudtucSoIYHpM9PqvzHT0i2kUcMU7rmFO8tJDMCC3fXBiEaRY1xFpH18hljXBDJNe2je6kqPUqNsxstoXKNUwRh1PJSPz207sYjaCRF6aV5uhgo-PNq0H26WgQtHIjOCsE/s1600/script.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
And the graph on the Stage Area is show below<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0x7WyL-tVq6sU3-AciUbv-Gh6RRSOZt_EG0dPmBESwQCYda-bgfUYrJ4teTjHkQaOuiF6k802xj_qMjACUnO-7qSeMPrTr1DCmFr8dlcxqHTZKqT7sXZCEJRvtpdWAD0bobUaavTKYxs/s1600/Scratch_Plot.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0x7WyL-tVq6sU3-AciUbv-Gh6RRSOZt_EG0dPmBESwQCYda-bgfUYrJ4teTjHkQaOuiF6k802xj_qMjACUnO-7qSeMPrTr1DCmFr8dlcxqHTZKqT7sXZCEJRvtpdWAD0bobUaavTKYxs/s1600/Scratch_Plot.PNG" /></a></div>
<br />
<div class="MsoNormal">
<span lang="EN-MY" style="font-family: "Arial","sans-serif"; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast;">I’ll cover
more on the “mapping” subject in my next post, that will involve Arduino and
external sensors. Happy Scratching………<o:p></o:p></span></div>
<br /></div>
</div>
<div class="MsoNormal">
<span style="background: white; font-family: Arial, sans-serif;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/05605261175282274646noreply@blogger.com0tag:blogger.com,1999:blog-8054185149631393631.post-37971831819836347472014-03-27T16:54:00.001+08:002014-03-27T16:54:57.984+08:00Getting physical with Scratch<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">Don’t you
find it entertaining if an animated Scratch that you had created comes alive
when the night falls, and stops when the sun rises ?? Or turns on the alarm when there is an intruder around the perimeter fence ??</span></div>
<br />
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">A typical example is show below<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyZ0DSeI_FZdyztRTxiGL_8787nyUinaSfGYFAIwfTqch-cHvaCuQZZL0pfIB0zm8ZdfVpUxNBfY69mjSTohK36mJiZi7JsoklRS-U9qjS28vRtW5Msl2KBBUosSALmxEZsjdBfz9Lfl4/s1600/instrusion.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyZ0DSeI_FZdyztRTxiGL_8787nyUinaSfGYFAIwfTqch-cHvaCuQZZL0pfIB0zm8ZdfVpUxNBfY69mjSTohK36mJiZi7JsoklRS-U9qjS28vRtW5Msl2KBBUosSALmxEZsjdBfz9Lfl4/s1600/instrusion.png" height="185" width="400" /></a></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">In the above
set up, Scratch constantly polls information from the micro controller and check if the
motion sensor is triggered. If true, it turns on the siren (alarm). The siren
continues to switch on to a logical “True” state until the spacebar of your
keyboard is pressed. <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">It’s not as difficult
as you thought, all you need is to snap a few Scratch blocks as follows</span></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVF54UK40M34UmPxlPV14nddQzVoZUppmDLpWHO-52E-gEsBlu13lm7dzvo-IMuqAT1ULqZg78TiaVxuV1QiPtSusm76qHZcmQX1aSBoJPNPjllvkFNu-rv3eSSzef7kIyc5g20w_8yJo/s1600/blocks.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVF54UK40M34UmPxlPV14nddQzVoZUppmDLpWHO-52E-gEsBlu13lm7dzvo-IMuqAT1ULqZg78TiaVxuV1QiPtSusm76qHZcmQX1aSBoJPNPjllvkFNu-rv3eSSzef7kIyc5g20w_8yJo/s1600/blocks.png" height="291" width="320" /></a></div>
<div class="MsoNormal">
<span style="font-family: Arial, sans-serif;">The combination
of Arduino and Scratch Extension makes physical computing possible, that allows
Scratch program to react and response to events happening outside of the computer.
</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">It is an engaging and practical topic that adds
interactivity where children (even adults) enjoy learning about.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="background: white; font-family: "Arial","sans-serif";">A<span class="apple-converted-space"> </span><b>Scratch Extension</b><span class="apple-converted-space"> </span>is an object that can be used with<span class="apple-converted-space"> </span></span><a href="http://wiki.scratch.mit.edu/wiki/Scratch" title="Scratch"><span style="background: white; color: windowtext; font-family: "Arial","sans-serif"; text-decoration: none; text-underline: none;">Scratch</span></a><span style="background: white; font-family: "Arial","sans-serif";">, in some cases as an
add-on to interface with the outside world. There are many variants (or Scratch-like),
specifically developed to teach children the concept of physical computing, each
has its shortcomings and appropriateness for specific applications. Of the
variants, </span><span style="font-family: "Arial","sans-serif";">Scratch for
Arduino (<b>S4A</b>), developed by <b>Citilab</b> is
a direct modification of <b>Scratch 1.4</b>
and is explicitly designed to work with Arduino UNO. However, the pre-assigned I/O pins in <b>S4A</b> hinders the flexibility of
I/O configuration as you would in a micro controller. That doesn’t imply it is not
up to snuff but relevance of its application.<span style="background: white;"><o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">The 18 I/Os
are assigned as followss</span></div>
<div class="MsoNormal">
</div>
<ul>
<li><span style="font-family: Arial, sans-serif; text-indent: -18pt;">6
analog inputs (pins A0, A1, A2, A3, A4 and A5)</span></li>
<li><span style="font-family: Arial, sans-serif; text-indent: -18pt;"><span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: Arial, sans-serif; text-indent: -18pt;">2
digital inputs (pins 2 and 3)</span></li>
<li><span style="font-family: Arial, sans-serif; text-indent: -18pt;"><span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: Arial, sans-serif; text-indent: -18pt;">3
analog outputs (pins 5, 6 and 9)</span></li>
<li><span style="font-family: Arial, sans-serif; text-indent: -18pt;"><span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: Arial, sans-serif; text-indent: -18pt;">4
digital outputs (pins 10, 11, 12 and 13)</span></li>
<li><span style="font-family: Arial, sans-serif; text-indent: -18pt;"><span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: Arial, sans-serif; text-indent: -18pt;">2
digital outputs for continuous-rotation servo motor (pins 4 and 7)</span></li>
<li><span style="font-family: Arial, sans-serif; text-indent: -18pt;">1
digital outputs for 0-180 rotation servo motor (pins 8)</span></li>
</ul>
<div class="MsoNormal">
<b><span style="font-family: "Arial","sans-serif";">S4A</span></b><span style="font-family: "Arial","sans-serif";"> is an ideal program for beginners (at least in my
context) but as you progressed, it might not be adequate for your applications
where more I/Os are needed. <o:p></o:p></span><br />
<span style="font-family: "Arial","sans-serif";"><br /></span>
<br />
<div class="MsoNormal">
<b><span style="font-family: "Arial","sans-serif";">Citilab </span></b><span style="font-family: "Arial","sans-serif";">has also developed an extension for <b>SNAP!</b> called <b>Snap4Arduino</b>, a derivative of <b>Scratch</b>
by Jens Mönig at MioSoft Corporation, with
contributions by some folks at Berkeley</span>.<br />
<div class="MsoNormal">
<span style="font-family: Arial, sans-serif;"><b>SNAP!</b>
allows you to build your own blocks, and with the added features of first
class list, procedures, etc, it renders a serious introduction to computer
science to high school or college students. <o:p></o:p></span></div>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b>Snap4Arduino</b> is purportedly tailored for the Arduino variants such
as the UNO, Mini, Mega2560, Pro, Lilypad, etc. Although it’s still in its alpha
phase, it works flawlessly with the atmega328 and atmega168 processors, namely
the UNO, Pro Mini, to name a few. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">For the
Mega2560, all 54 IO pins are accessible, except there are some bugs with PWM,
digital input and Servo functionality for higher pins (pin14 onwards). <o:p></o:p></span></div>
<span style="font-family: "Arial","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-MY; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;"> </span></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">Unlike S4A,
all the digital I/O pins are configurable, extending its flexibility. <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">As of this
date, the bugs has not been fixed but the folks at <b>Citilab</b> has committed to
sort it out prior to the upcoming Scratch@MIT conference, somewhere in August
this year. <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";"><br /></span>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">You can
download both <b>S4A</b> or <b>Snap4Arduino</b> at </span><a href="http://s4a.cat/"><span style="font-family: "Arial","sans-serif";">http://s4a.cat/</span></a><span style="font-family: "Arial","sans-serif";"> and </span><a href="http://s4a.cat/snap/"><span style="font-family: "Arial","sans-serif";">http://s4a.cat/snap/</span></a><span style="font-family: "Arial","sans-serif";"> respectively. </span><span style="font-family: Arial, sans-serif;">Instruction
to install the program is available at their site.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">Throughout
this blog, we’ll start with <b>S4A</b> for
the very beginners and switch to <b>Snap4Arduino</b>
for projects where more IOs are needed.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">To be
continued……….<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<br />
<div class="MsoNormal">
<br /></div>
</div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";"><br /></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/05605261175282274646noreply@blogger.com0tag:blogger.com,1999:blog-8054185149631393631.post-14407229724708997992014-03-11T17:05:00.000+08:002014-03-11T17:05:33.863+08:00More Variables<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">In my previous post, a simple program was shown how variables were
applied to a moving Sprite using the “Up Arrow” and “Down Arrow” of the
keyboard. In short, the value of a variable can generally be accessed or
changed at any time by the programmer. However, such variable can only store
one value at a time. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">There are times when you need a variable to store multiple data in your
script, Scratch’s “List” block provides that concept of arrays to help you with
these circumstances. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";">The “List” block stores a series of values in a single variable.
Each of these values is an 'element' of the “List” and each element has an
index value to mark its position within the list. Suppose you would like to
keep an inventory of the following grocery at home, <o:p></o:p></span></div>
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; text-indent: -18pt;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<ol>
<li><span style="background-color: white; font-family: Arial, sans-serif; text-indent: -18pt;">Mushroom</span></li>
<li><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; text-indent: -18pt;">Onion</span></li>
<li><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; text-indent: -18pt;">Carrot</span></li>
<li><span style="font-family: Arial, sans-serif; text-indent: -18pt;"><span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; text-indent: -18pt;">Apple</span></li>
<li><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; text-indent: -18pt;">Orange</span></li>
<li><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; text-indent: -18pt;">Milk</span><span style="background-color: white; font-family: Arial, sans-serif;"> </span></li>
</ol>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";">The “List”
block will keep a record of the above elements, and is displayed by the "List Watcher" at the Stage Area :</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcqLljdQ7Y9eMYeLDnNGX66lT_btWRikmaWMjf0sI6XAU64tiGjcUqDbSZMpXX9F1XQXYywux5QSZ79Z-nMwUROtZwiZfi4CGyXNpbJxJ1wT1ZQvdzP5IESh674OEv2mmIN85ddAxWieY/s1600/contents.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcqLljdQ7Y9eMYeLDnNGX66lT_btWRikmaWMjf0sI6XAU64tiGjcUqDbSZMpXX9F1XQXYywux5QSZ79Z-nMwUROtZwiZfi4CGyXNpbJxJ1wT1ZQvdzP5IESh674OEv2mmIN85ddAxWieY/s1600/contents.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";">Here, the
order arrangement in the list corresponds to the sequence the data is entered
and each of the data is indexed with a number accordingly. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";">For
example, Mushroom is marked by an index value of “1”, Onion with an index value of
“2” and so on. The index is referred to as “Item” in Scratch.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";">Note :
I should have included the quantity for each element, but since the “List” block
is a one dimensional array, I’ll leave it out for now until the next post where
we will discuss about two dimensional arrays.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="separator" style="clear: both;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";">Start your Scratch programme now and click on the “Make a
List” button (under “<b><span style="color: #ed7d31; mso-themecolor: accent2;">Variables</span></b>” control block). A dialog box will appear as follows :<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhenhglSSLqbjDVbJP7SGSyA4tYLGiSHmeumaI0XYPrRA3WLR0sMfiWJq5RJncpU3OPMwKCokfDj9ny-xl44d4o2NRiDLkWSbXPncmb3eXr5ovyJ1QAP5_-7qOvh3zqdYrSPJYoXyF6A0s/s1600/List.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhenhglSSLqbjDVbJP7SGSyA4tYLGiSHmeumaI0XYPrRA3WLR0sMfiWJq5RJncpU3OPMwKCokfDj9ny-xl44d4o2NRiDLkWSbXPncmb3eXr5ovyJ1QAP5_-7qOvh3zqdYrSPJYoXyF6A0s/s1600/List.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">You are asked to give a name to the “List” you want to create, let’s
name it “Grocery” and click the “”ok” button.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";">
</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Once a list is created, an empty List Watcher will appear on the Stage Area, the control palette would look like below, <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIFL2ebYzlFann0i89BDSGKlJki0HjGFd0DW9KHgiKiBv-_pgThQBx6TLnS9Ux-Useq7bx1uAHrNrZAtIewNU7YnheFrwMTcyi05dj9ksrqQuX7c27McGWm6ByuzXvhqaccRbBIqIOv9k/s1600/Pallete.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIFL2ebYzlFann0i89BDSGKlJki0HjGFd0DW9KHgiKiBv-_pgThQBx6TLnS9Ux-Useq7bx1uAHrNrZAtIewNU7YnheFrwMTcyi05dj9ksrqQuX7c27McGWm6ByuzXvhqaccRbBIqIOv9k/s1600/Pallete.png" height="400" width="168" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";"></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">There are 7 blocks available in the “List”, and each has its own
function. Let’s explore each block before we create a simple script for the
Grocery.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif;">1) “</span><b><span style="background: white; color: red; font-family: "Arial","sans-serif";">add ()
to ()</span></b><span style="background-color: white; font-family: Arial, sans-serif;">” block</span></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeGIHJdnvBFQftBw0gE9wDkOA1d3Zmgp3mNYDa7RR0vQfp2aSCyI7Cv5JKzRS-03fxqe5vD0WpXUjoKyn9Vd2BGiAyAV-hhbn2q7OjyFvh_yf7fZ1-iwvqKlsfQcURat0JELyRtq6oy24/s1600/add.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeGIHJdnvBFQftBw0gE9wDkOA1d3Zmgp3mNYDa7RR0vQfp2aSCyI7Cv5JKzRS-03fxqe5vD0WpXUjoKyn9Vd2BGiAyAV-hhbn2q7OjyFvh_yf7fZ1-iwvqKlsfQcURat0JELyRtq6oy24/s1600/add.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Drag the block to the Script Area and click twice on the block. You have
just entered two identical elements (called “thing”) in the “Grocery” list and the
contents are shown in the "List Watcher" below.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjapyGYafwbCEXqfQxcKoRCfj4c-bZogJIOofIu6rXRuGv89JIIwftznQMCEFQmaK7n_wCb7j0O06Utc2ObfCiGcphK08EL4cUpy9AgRB4IBJIHRT_ox3N3RXlrNNKQzcfaHp6_F0MoqMA/s1600/thing.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjapyGYafwbCEXqfQxcKoRCfj4c-bZogJIOofIu6rXRuGv89JIIwftznQMCEFQmaK7n_wCb7j0O06Utc2ObfCiGcphK08EL4cUpy9AgRB4IBJIHRT_ox3N3RXlrNNKQzcfaHp6_F0MoqMA/s1600/thing.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";"></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Replace the text with “Carrot” in the “</span><b><span style="background: white; color: red; font-family: "Arial","sans-serif";">add () to Grocery</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block, click on it once and the list will be
updated as shown below:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0mHrUBWHLjznhzGYrp-e9SJ1KSe53xq_eu5RfEiArlNXMdqqZ8BhRHE0LLUl2-5pNcO-H2wVOVFbm_5dGvpUpBHEEFa0Q2NcBb2HnWNmZoPiaIqPCk7ydsb4sG_cmlWnenH-_6RD4tCw/s1600/thing_carrot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0mHrUBWHLjznhzGYrp-e9SJ1KSe53xq_eu5RfEiArlNXMdqqZ8BhRHE0LLUl2-5pNcO-H2wVOVFbm_5dGvpUpBHEEFa0Q2NcBb2HnWNmZoPiaIqPCk7ydsb4sG_cmlWnenH-_6RD4tCw/s1600/thing_carrot.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, sans-serif;">New entries always succeed the last item of the list.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">2) “</span><b><span style="background: white; color: red; font-family: "Arial","sans-serif";">delete ()
of ()</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLHekKw0CZOM-pfSopeEYdBLaG11G4ixlFapU4RPEoCppCWQGU5AXdpYaGJF_8EY-ZuE9JFpPRbqXTpxiE6-UERexHFKREUugTcAiao5rlW2rhC1vqh6D2xwkUknQuPhFDNJrHsN7AfaQ/s1600/delete.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLHekKw0CZOM-pfSopeEYdBLaG11G4ixlFapU4RPEoCppCWQGU5AXdpYaGJF_8EY-ZuE9JFpPRbqXTpxiE6-UERexHFKREUugTcAiao5rlW2rhC1vqh6D2xwkUknQuPhFDNJrHsN7AfaQ/s1600/delete.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">I guess I don’t have to describe more, as your intuition should be able
to tell you what the block does by its name. One thing you should know, the
drop down menu displays only 3 items by default, regardless of its contents</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEityf2mujvAvVC9vFXNG3U5nqRVz4kudh4eUltsCIiNVSfsjQhhIFIb-z5eBxegrRnDSsTK7KQFMKEtSFTc50xQ0FxemFB7eDWsjm5KIqNgI3e2KUTstKeUd8p4ihrBAKuQ-kjdM5OKIwg/s1600/menu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEityf2mujvAvVC9vFXNG3U5nqRVz4kudh4eUltsCIiNVSfsjQhhIFIb-z5eBxegrRnDSsTK7KQFMKEtSFTc50xQ0FxemFB7eDWsjm5KIqNgI3e2KUTstKeUd8p4ihrBAKuQ-kjdM5OKIwg/s1600/menu.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">There’s nothing to concern about, just key in the item number
corresponding to the data you wish to delete.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";">
</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The option “all” will remove all of the contents in the list.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">3) “</span><b><span style="background: white; color: red; font-family: "Arial","sans-serif";">insert
() at () of ()</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdXhf7Bq_waQ-gvE70QPMyI-UeEs6a03U-zDj2l9ufi0zwTwSxHq-ugyGjS66GDOr4ngPeP7sFi1hs6S8G-sEVc0g74-EyfEYkbTz7n0Pa8queOnwgFrmu047gj6t7jGDbBzOPJEplGY4/s1600/insert.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdXhf7Bq_waQ-gvE70QPMyI-UeEs6a03U-zDj2l9ufi0zwTwSxHq-ugyGjS66GDOr4ngPeP7sFi1hs6S8G-sEVc0g74-EyfEYkbTz7n0Pa8queOnwgFrmu047gj6t7jGDbBzOPJEplGY4/s1600/insert.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Arial","sans-serif"; mso-fareast-language: EN-MY; mso-no-proof: yes;">This block is similar to the </span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">“</span><b><span style="background: white; color: red; font-family: "Arial","sans-serif";">add (thing) to Grocery</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block,
except that the new element “inserted” to the list precedes the item you had choosen.
Referring to the list we had created earlier, <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxPabQfNDr-YmIEzHthWM226mSM0Fqk6VCWc5Ob3a3MNHftkJvK983oEGJ7ytJ8YDfs9wuA2tKj_knfOI4qYPNXEiCBNAqVlhd3KOCwVglPydkL84aqfhR3qbLKMUtDkT8L418rvbCl4o/s1600/thing_carrot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxPabQfNDr-YmIEzHthWM226mSM0Fqk6VCWc5Ob3a3MNHftkJvK983oEGJ7ytJ8YDfs9wuA2tKj_knfOI4qYPNXEiCBNAqVlhd3KOCwVglPydkL84aqfhR3qbLKMUtDkT8L418rvbCl4o/s1600/thing_carrot.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Let’s insert a new item “Onion” at item 2, and you will have a new list
as below.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4whsV1gh8tPsxAxYyMohHYTfNp-rTstt7YyhXE4YJLD94QvHiBTHnbdiMsCPw_AO85LVjf-K2AXr1HNqJ55irRXt03ltI_-uix-G4I31zJUuN6w3NI4dmhNJBnVGsHfQ-rahcEn638Jk/s1600/newlist.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4whsV1gh8tPsxAxYyMohHYTfNp-rTstt7YyhXE4YJLD94QvHiBTHnbdiMsCPw_AO85LVjf-K2AXr1HNqJ55irRXt03ltI_-uix-G4I31zJUuN6w3NI4dmhNJBnVGsHfQ-rahcEn638Jk/s1600/newlist.png" height="176" width="320" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div>
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";"></span><br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">4) “</span><b><span style="background: white; color: red; font-family: "Arial","sans-serif";">replace item () of () with ()</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzE8a1UsWcEsNBqX0hCjzg7mx8MNjUC-fAQva4LU7If_A6VA5LlWWD93yFoiiFdwR1oWI1s9UqQS9AaASNYbBxeh69ABY9bKNggpyHrJi9vBQkBULehkoSEnPNmpPSbVTZdEqdBIPaftY/s1600/replace.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzE8a1UsWcEsNBqX0hCjzg7mx8MNjUC-fAQva4LU7If_A6VA5LlWWD93yFoiiFdwR1oWI1s9UqQS9AaASNYbBxeh69ABY9bKNggpyHrJi9vBQkBULehkoSEnPNmpPSbVTZdEqdBIPaftY/s1600/replace.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">This block changes (or replace) the specified item's content to a given entry.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">Replacing
Item 1 (currently "thing") with "Mushroom" yields the following</span><o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja1ZceRQvor7CApLOzmNnLihi1tbP5Go2mQOQstw1SRS8JaH_XkDXPOnmIG5lqzPdAs_8BwVHHaqaQBjvFjheYovWPCMIKL_NQ0jAJ1dVaLxjLoa2s_OB6gllSmtoE6Y3KMVEjuYXITC4/s1600/mushroom.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja1ZceRQvor7CApLOzmNnLihi1tbP5Go2mQOQstw1SRS8JaH_XkDXPOnmIG5lqzPdAs_8BwVHHaqaQBjvFjheYovWPCMIKL_NQ0jAJ1dVaLxjLoa2s_OB6gllSmtoE6Y3KMVEjuYXITC4/s1600/mushroom.png" height="167" width="320" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">5) “</span><b><span style="background: white; color: red; font-family: "Arial","sans-serif";">item () of ()</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0qbChf3L0xVC_lQ1AEVYMlkjNyFh5Lv3XaaJcCzdtRuCVxzVT1nb6nFSmU4ZzurQ6YCyV1Dx1RRppfM6WH-9AoWvg9qyEmSfG9jFP1Ujsi0ce3r984CfeYWjQcNgZsJf0ztRB5A3Z5tg/s1600/item.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0qbChf3L0xVC_lQ1AEVYMlkjNyFh5Lv3XaaJcCzdtRuCVxzVT1nb6nFSmU4ZzurQ6YCyV1Dx1RRppfM6WH-9AoWvg9qyEmSfG9jFP1Ujsi0ce3r984CfeYWjQcNgZsJf0ztRB5A3Z5tg/s1600/item.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">This is a reporter block, reporting the content of its corresponding item in the
list. </span><span style="background-color: white; font-family: Arial, sans-serif;">It is commonly used in “</span><b><span style="background: white; color: #6600ff; font-family: "Arial","sans-serif";">Say</span></b><span style="background-color: white; font-family: Arial, sans-serif;">” block
or used for logical operation. </span><span style="background-color: white; font-family: Arial, sans-serif;">Below is an example used in “</span><b><span style="background: white; color: #6600ff; font-family: "Arial","sans-serif";">Say</span></b><span style="background-color: white; font-family: Arial, sans-serif;">” block</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvCurlRZUN1hqVjhQZrAYD1c_TvZD8yPa2C1ht5twswI6OZ6yCKdObhjPvTsyXo-RPNg274vM-J3pj3wuteHApwO64OdY45md9L9ccRMWT08uVzN7v4QW1DxWF08pG4ta1w9LuXh0XL28/s1600/say.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvCurlRZUN1hqVjhQZrAYD1c_TvZD8yPa2C1ht5twswI6OZ6yCKdObhjPvTsyXo-RPNg274vM-J3pj3wuteHApwO64OdY45md9L9ccRMWT08uVzN7v4QW1DxWF08pG4ta1w9LuXh0XL28/s1600/say.png" height="185" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">6) “</span><b><span style="background: white; color: red; font-family: "Arial","sans-serif";">length of
()</span></b><span style="background: white; font-family: "Arial","sans-serif";">“ block<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSNiEMYbKW429GotOKC9EChIbheXW6vBVhxt8csG4vED2eKXTakynYCGk0791JHsqqRnCOOMfgceM8s3FDaMj7zJMzQ0ljiRJIBikLJQZAJjK5V_Q23kwOIm6YLUNReowGztX3ohm2J0I/s1600/length.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSNiEMYbKW429GotOKC9EChIbheXW6vBVhxt8csG4vED2eKXTakynYCGk0791JHsqqRnCOOMfgceM8s3FDaMj7zJMzQ0ljiRJIBikLJQZAJjK5V_Q23kwOIm6YLUNReowGztX3ohm2J0I/s1600/length.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">This is a reporter block, which reports the total item a list contains.
The total item is also displayed at the bottom of the List Watcher</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjieIp5y7aP0-L4U0dk8c56XbG02ZtRJK_Oep0hCoCT8l1LAjQgRb_usN9FXFMJdtaslMmyJFjelFQA6uvlrpUYRvDRqywRAMvVK7tuE905lOOFlwtOKfGIAJk78KXHIurkUjx6dbYbXN4/s1600/total.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjieIp5y7aP0-L4U0dk8c56XbG02ZtRJK_Oep0hCoCT8l1LAjQgRb_usN9FXFMJdtaslMmyJFjelFQA6uvlrpUYRvDRqywRAMvVK7tuE905lOOFlwtOKfGIAJk78KXHIurkUjx6dbYbXN4/s1600/total.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"> <o:p></o:p></span><span style="background-color: white; font-family: Arial, sans-serif;">7) “</span><b><span style="background: white; color: red; font-family: "Arial","sans-serif";">() contains
()</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">“ block</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";"><o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRxsN58xjDCUSRE4s3ZHjZhyOP3YojxtI0pR6HkrZj7cosU-j8cl2W4xK-WuJsgLgG61GCtBL578pvKg7cdkPEQMeIn2aGEgDiQwBitlHd_7AvwWoZS5jUB9aVCqmM5deRgEMDog0BNwE/s1600/contains.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRxsN58xjDCUSRE4s3ZHjZhyOP3YojxtI0pR6HkrZj7cosU-j8cl2W4xK-WuJsgLgG61GCtBL578pvKg7cdkPEQMeIn2aGEgDiQwBitlHd_7AvwWoZS5jUB9aVCqmM5deRgEMDog0BNwE/s1600/contains.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">This is a “Boolean” block, which returns “True” if the text entered is
equal to any of the elements in the list, otherwise it returns “False”. For
example, if you need to check whether “Apple” is in your Grocery List, it will
return “False” as the current list contains only Mushroom, Onion, thing and
Carrot.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";">
</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Example script is shown below :<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr7gIGsWxqxHb17ZkbFjP0jwhR8L0GKVuaU5tf9X4YrIX3q2UK4yGqo6VdUDn_JlDqWshg-kaB6sCQmNldskEPcZJcl2lAr3i2LNu7hSFuUw6xVUpKSXA3qc5Td23lrPRwLbSoi1btKXY/s1600/ask.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr7gIGsWxqxHb17ZkbFjP0jwhR8L0GKVuaU5tf9X4YrIX3q2UK4yGqo6VdUDn_JlDqWshg-kaB6sCQmNldskEPcZJcl2lAr3i2LNu7hSFuUw6xVUpKSXA3qc5Td23lrPRwLbSoi1btKXY/s1600/ask.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Note that the text is case-sensitive. <span style="color: red;"><b>M</b></span>ushroom is not equal to<span style="color: red;"><b> m</b></span>ushroom,
as far as the block is concerned.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";"><br /></span></div>
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Let’s start with an example how the “List” block is applied. We will use
the same inventory, and is shown below for convenience.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="margin: 0cm 0cm 0.0001pt 54pt; text-indent: -18pt;">
<!--[if !supportLists]--><span style="font-family: Arial, sans-serif;">1)<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><span style="background: white; font-family: "Arial","sans-serif";">Mushroom<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0.0001pt 54pt; text-indent: -18pt;">
<!--[if !supportLists]--><span style="font-family: Arial, sans-serif;">2)<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="background: white; font-family: "Arial","sans-serif";">Onion<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0.0001pt 54pt; text-indent: -18pt;">
<!--[if !supportLists]--><span style="font-family: Arial, sans-serif;">3)<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="background: white; font-family: "Arial","sans-serif";">Carrot<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0.0001pt 54pt; text-indent: -18pt;">
<!--[if !supportLists]--><span style="font-family: Arial, sans-serif;">4)<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="background: white; font-family: "Arial","sans-serif";">Apple<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0.0001pt 54pt; text-indent: -18pt;">
<!--[if !supportLists]--><span style="font-family: Arial, sans-serif;">5)<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="background: white; font-family: "Arial","sans-serif";">Orange<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast" style="margin: 0cm 0cm 0.0001pt 54pt; text-indent: -18pt;">
<!--[if !supportLists]--><span style="font-family: Arial, sans-serif;">6)<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="background: white; font-family: "Arial","sans-serif";">Milk<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">We'll create a pre-defined inventory as follows :<o:p></o:p></span></div>
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_WnPIyos0C_jRUC0QjbwUHIlJzqYf3qwTm1kNAbSq4GxXPu7FGjX_VW-hIXgltcbGdfOFBSmh3iPvMONnfdZ42B-7sVZaXc4JHqnTfq62BWBycnzpzO1rvH4u_p0KxP5ei5zOFY9aDLM/s1600/pre-define.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_WnPIyos0C_jRUC0QjbwUHIlJzqYf3qwTm1kNAbSq4GxXPu7FGjX_VW-hIXgltcbGdfOFBSmh3iPvMONnfdZ42B-7sVZaXc4JHqnTfq62BWBycnzpzO1rvH4u_p0KxP5ei5zOFY9aDLM/s1600/pre-define.png" height="282" width="320" /></a></div>
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Note 1 : Delete previous entries to avoid duplicates. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Note 2: Elements are written to the “List” block in sequence.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif;">Note 3 : Used for linking to its corresponding elements.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Next, we’ll create a script to make the Sprite summarize (or "Say" out) your inventory
:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaLw8w-1u4_Gyz_SNqOwld-OfQixyVGa8-t7tRq1ltFlxcZosqKnUPOUXr4zSFIECMh6ljLMciv10kHANHvbxCFvM8MCQiz2mYJ69iCQdaiFdLqZwWGyObMqJ7HHjQWGPi6DQwD_Uk5W0/s1600/summarize.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaLw8w-1u4_Gyz_SNqOwld-OfQixyVGa8-t7tRq1ltFlxcZosqKnUPOUXr4zSFIECMh6ljLMciv10kHANHvbxCFvM8MCQiz2mYJ69iCQdaiFdLqZwWGyObMqJ7HHjQWGPi6DQwD_Uk5W0/s1600/summarize.png" height="185" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Note 1 : <o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The Sprite does not know what’s in the grocery list. The “</span><b><span style="background: white; color: #c55a11; font-family: "Arial","sans-serif"; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-color: #C55A11; mso-style-textfill-fill-colortransforms: lumm=75000; mso-style-textfill-fill-themecolor: accent2; mso-themecolor: accent2; mso-themeshade: 191;">repeat
until ()</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block is needed to run through the whole list sequentially from
the beginning to the last item. The variable “item” increments by 1 for every “</span><b><span style="background: white; color: #c55a11; font-family: "Arial","sans-serif"; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-color: #C55A11; mso-style-textfill-fill-colortransforms: lumm=75000; mso-style-textfill-fill-themecolor: accent2; mso-themecolor: accent2; mso-themeshade: 191;">repeat
until ()</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” loop until it is greater than the “length of the grocery”,
whereby the “</span><b><span style="background: white; color: #c55a11; font-family: "Arial","sans-serif"; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-color: #C55A11; mso-style-textfill-fill-colortransforms: lumm=75000; mso-style-textfill-fill-themecolor: accent2; mso-themecolor: accent2; mso-themeshade: 191;">repeat until ()</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block exits its loop. Its
process flow is shown below<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6xgBoKlP30hpPWu28mXsY60XnAV2AOsa8XyH7UQZphxkCIBwB1oMAxFv5G33HIWnSXIus98bhDxxTMvDBAfJpEoLTCjotZLlLquu8BI-r_7NsjV-EtnXRfYmr52d4eZehDOocOvalW2g/s1600/loop.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6xgBoKlP30hpPWu28mXsY60XnAV2AOsa8XyH7UQZphxkCIBwB1oMAxFv5G33HIWnSXIus98bhDxxTMvDBAfJpEoLTCjotZLlLquu8BI-r_7NsjV-EtnXRfYmr52d4eZehDOocOvalW2g/s1600/loop.png" height="320" width="291" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
</div>
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Note 2 :<o:p></o:p></span></div>
<span style="background: white; font-family: "Arial","sans-serif";">
</span><br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">In the “</span><b><span style="background: white; color: #ed7d31; font-family: "Arial","sans-serif"; mso-themecolor: accent2;">if () else</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block, it checks if “item” is greater than “length
of Grocery”. If true, it does nothing and exits the block, else it “says” out
the grocery name. The next event is taken over by the “</span><b><span style="background: white; color: #ed7d31; font-family: "Arial","sans-serif"; mso-themecolor: accent2;">repeat until ()</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block,
which repeats its process as explained in Note 1.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Note 3 :</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The “</span><b><span style="background: white; color: #7030a0; font-family: "Arial","sans-serif";">say ()
for () secs</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block allows only one specified text, and we need the
Sprite to say out 4 different text, ie :</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0px;">
<span style="text-indent: -18pt;"><span style="font-family: Arial, sans-serif;"> 1) </span><span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="background-color: white; font-family: Arial, sans-serif; text-indent: -18pt;">Name of the Grocery</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0px;">
<span style="font-family: Arial, sans-serif; text-indent: -18pt;"> 2)<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="background-color: white; font-family: Arial, sans-serif; text-indent: -18pt;">“ located
at “ text</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0px;">
<span style="font-family: Arial, sans-serif; text-indent: -18pt;"> 3)<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="background-color: white; font-family: Arial, sans-serif; text-indent: -18pt;">“Item”
text</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0px;">
<span style="font-family: Arial, sans-serif; text-indent: -18pt;"> 4)<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><span style="background-color: white; font-family: Arial, sans-serif; text-indent: -18pt;">Item number corresponding to the grocery</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The “</span><b><span style="background: white; color: #92d050; font-family: "Arial","sans-serif";">join () ()</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block comes to the rescue, where it
concatenates as many text as you wish.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Following steps show how “</span><b><span style="background: white; color: #92d050; font-family: "Arial","sans-serif";">join ()
()</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block links the text together<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Step 1:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrQM3-f2ZHB5WHQrM54ZiSzYVaR0Li45R_BFUglNIY45t8_YF59vz9TjFUt11zz2MqlyCz9vclCxrJDbRrnrAIo4A7yyz27TDJ9RCIsqWKVdmOQ0ft7UuIY3q2qpHn0RyjWMjjct6sY6s/s1600/step1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrQM3-f2ZHB5WHQrM54ZiSzYVaR0Li45R_BFUglNIY45t8_YF59vz9TjFUt11zz2MqlyCz9vclCxrJDbRrnrAIo4A7yyz27TDJ9RCIsqWKVdmOQ0ft7UuIY3q2qpHn0RyjWMjjct6sY6s/s1600/step1.png" height="121" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Step 2 :</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyQ_uo0QfiRtiwuZ1Tvs6KacYzf362Itz4_25aRK9R9EMd9COoWOX0C1c6_S_195jvM7JVOK8W_Ik-TSq7G7P4Xyq1mpPO_mERQA1Jzx3XjS-eT1txvlhlo5JitdIW2DR63-I1q4xh78Q/s1600/step2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyQ_uo0QfiRtiwuZ1Tvs6KacYzf362Itz4_25aRK9R9EMd9COoWOX0C1c6_S_195jvM7JVOK8W_Ik-TSq7G7P4Xyq1mpPO_mERQA1Jzx3XjS-eT1txvlhlo5JitdIW2DR63-I1q4xh78Q/s1600/step2.png" height="142" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Step 3 :</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNTgI7VKtbPglxMD5YFZSlqJskwhHgSE0LZ7T3TIZud0RPvelWhCQdUisuwA1sirNBt3Pak5nH-4mWFrUubN2tLiJjVCOKfwrV0vFMYoI2qc8uPloCW6XEn1TRp-OiewypChj-Tt68Sek/s1600/step+3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNTgI7VKtbPglxMD5YFZSlqJskwhHgSE0LZ7T3TIZud0RPvelWhCQdUisuwA1sirNBt3Pak5nH-4mWFrUubN2tLiJjVCOKfwrV0vFMYoI2qc8uPloCW6XEn1TRp-OiewypChj-Tt68Sek/s1600/step+3.png" height="138" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Step 4 (final) :</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiYv0Eg3getiHdtwaL62tfKriuhicsJZEKTPAFJ9UHwC3efBqfmGPeKm2EuRZS7Ty9C030gmf-rJI8zCf6gsFQwiJiEou3Weea-mS6jMww6MVQSmzIt_GgIFmtS8Zz0q6zIM2rJrywb84/s1600/step4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiYv0Eg3getiHdtwaL62tfKriuhicsJZEKTPAFJ9UHwC3efBqfmGPeKm2EuRZS7Ty9C030gmf-rJI8zCf6gsFQwiJiEou3Weea-mS6jMww6MVQSmzIt_GgIFmtS8Zz0q6zIM2rJrywb84/s1600/step4.png" height="111" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The final "say ()" block will look like below :</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgimf4EU1IJeESqfFvNfsvwL4SIKEetYjh-6BRAIpYSVY11MvMh-3Nr4lMyX19YV5g5SWdiLKQ3uJMKIijorEMHF-5Ie13AUdaHxwAqyyw_ICys3jjb-QM4RJEOY67dqZr3bE7cVcA00p4/s1600/final.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgimf4EU1IJeESqfFvNfsvwL4SIKEetYjh-6BRAIpYSVY11MvMh-3Nr4lMyX19YV5g5SWdiLKQ3uJMKIijorEMHF-5Ie13AUdaHxwAqyyw_ICys3jjb-QM4RJEOY67dqZr3bE7cVcA00p4/s1600/final.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, sans-serif;">Note that 3 different </span><b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: #92d050; font-family: Arial, sans-serif;">join () ()</span></b><span style="background-color: white; color: #92d050; font-family: Arial, sans-serif;"> </span><span style="background-color: white; font-family: Arial, sans-serif;">” blocks are used to concatenate the required text that we want.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The combination of “</span><b><span style="background: white; color: #7030a0; font-family: "Arial","sans-serif";">say ()
for () secs</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” and “</span><b><span style="background: white; color: #92d050; font-family: "Arial","sans-serif";">join ()
()</span></b><span style="background: white; color: #92d050; font-family: "Arial","sans-serif";"> </span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” blocks results in the following<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbiQBvpurRP0cxeFFl4iV0o71oPlAhFInNwIL8_A2ZeWFx1IxokDcy0F5sNaAmImDtXXb23LC28fRFBsazMTAZUpZ-BEMgu30aUk-eSOaKUTmC0ujziB5yuVknjcXdMOakAwK_QxGqW4E/s1600/sprite+say.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbiQBvpurRP0cxeFFl4iV0o71oPlAhFInNwIL8_A2ZeWFx1IxokDcy0F5sNaAmImDtXXb23LC28fRFBsazMTAZUpZ-BEMgu30aUk-eSOaKUTmC0ujziB5yuVknjcXdMOakAwK_QxGqW4E/s1600/sprite+say.png" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The whole script should look like below :</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDux47lLCDxL1ZvOL9rvLKtfop4cQGThk_iLiH3ykVKQRAyDq9eJZbrq7fiyiyzFLnzFoYAs-m9e3raL6VjY2QpoBmuS1_odf3aCjfiv56TjgYKgVnO1zTBvYVm0fvdADTwT-pQWXu204/s1600/script.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDux47lLCDxL1ZvOL9rvLKtfop4cQGThk_iLiH3ykVKQRAyDq9eJZbrq7fiyiyzFLnzFoYAs-m9e3raL6VjY2QpoBmuS1_odf3aCjfiv56TjgYKgVnO1zTBvYVm0fvdADTwT-pQWXu204/s1600/script.png" height="442" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Below is the corresponding flow chart</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2NyiGpWRAwQz4eEynUa0xP9IuMcVF-VCt-aGFLWwk0T9rK1UAR_4WXNJd9MO41pk2oa_tdsnTv_aOVs0LjktRgsWfr7KgIh5urVajZnPhE7sBnlQbmAAB5fT_ESb1PCriFAfa79IxBk0/s1600/chart.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2NyiGpWRAwQz4eEynUa0xP9IuMcVF-VCt-aGFLWwk0T9rK1UAR_4WXNJd9MO41pk2oa_tdsnTv_aOVs0LjktRgsWfr7KgIh5urVajZnPhE7sBnlQbmAAB5fT_ESb1PCriFAfa79IxBk0/s1600/chart.png" height="640" width="462" /></a></div>
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Alternatively, you can create a script to make the Sprite ask for the
groceries you would like to enter.Below is an example :<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWCspI9geNhN0V7FUSG9ZwSscSjFQ2_OP5XnC4PuXBu9KmrGguZTwb46ro9_UeMWSLYa80RFPzOcfz3DFadIwJi-x5tMlunf8DkdvM5nvTOXkjh6swIEcSNu6P2CeNy-YCO0i636UcMaw/s1600/ask+item.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWCspI9geNhN0V7FUSG9ZwSscSjFQ2_OP5XnC4PuXBu9KmrGguZTwb46ro9_UeMWSLYa80RFPzOcfz3DFadIwJi-x5tMlunf8DkdvM5nvTOXkjh6swIEcSNu6P2CeNy-YCO0i636UcMaw/s1600/ask+item.png" height="311" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The above script allows you to enter as many data as you like until “x”
is entered, telling the script you’re done with your entry.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The “</span><b><span style="background: white; color: #0070c0; font-family: "Arial","sans-serif";">ask ()
and wait</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block stores your data to the “</span><b><span style="background: white; color: #0070c0; font-family: "Arial","sans-serif";">answer</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block and pass it to the “</span><b><span style="background: white; color: #ed7d31; font-family: "Arial","sans-serif"; mso-themecolor: accent2;">if () else</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Note that there are two “</span><b><span style="background: white; color: #ed7d31; font-family: "Arial","sans-serif"; mso-themecolor: accent2;">if () else</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” blocks nested together within the “</span><b><span style="background: white; color: #ed7d31; font-family: "Arial","sans-serif"; mso-themecolor: accent2;">repeat until ()</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block, the
“else” statement of the first “</span><b><span style="background: white; color: #ed7d31; font-family: "Arial","sans-serif"; mso-themecolor: accent2;">if () else</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block is itself an “</span><b><span style="background: white; color: #ed7d31; font-family: "Arial","sans-serif"; mso-themecolor: accent2;">if () else</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The first “</span><b><span style="background: white; color: #ed7d31; font-family: "Arial","sans-serif"; mso-themecolor: accent2;">if () else</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block checks whether “x” is entered, if true,
it exits the block. If false, it enters into the “else” statement. The second “</span><b><span style="background: white; color: #ed7d31; font-family: "Arial","sans-serif"; mso-themecolor: accent2;">if () else</span></b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block
checks for “empty” data just in case if you had accidentally pressed the “Enter”
key.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The flow chart below provides a better picture :<o:p></o:p></span></div>
<div class="separator" style="clear: both;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIu-h8N9JiDFdfLPZMmT7ilGM6sN4tMPd0LxTRMMGtnNplYR7p4EbpVWbEhDkP7UgiYHUJwoZH5gixPzqomitC18ZqezxNPEkAxgUHNmtIxTtcjrrkTX9oBUwhpz8yqShTyGZr4LYN3Do/s1600/chart1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIu-h8N9JiDFdfLPZMmT7ilGM6sN4tMPd0LxTRMMGtnNplYR7p4EbpVWbEhDkP7UgiYHUJwoZH5gixPzqomitC18ZqezxNPEkAxgUHNmtIxTtcjrrkTX9oBUwhpz8yqShTyGZr4LYN3Do/s1600/chart1.png" height="640" width="484" /></a></div>
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<span style="background: white; font-family: "Arial","sans-serif";"><br /></span>
<span style="background: white; font-family: "Arial","sans-serif";">The new script is show below.</span><br />
<span style="background: white; font-family: "Arial","sans-serif";"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4M6qlXe5YgbnMV6i0C0p595gYprmodakc1SmMiA3uHQCc3Vsfix2IyQzx4ZzxEkhieCdME-8w307X23nB1WeDOIogDaBDh0sWJfAtbNhInqv9kKVCYmD-lUwOE2GJKPprWZfD-hlXb38/s1600/final.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4M6qlXe5YgbnMV6i0C0p595gYprmodakc1SmMiA3uHQCc3Vsfix2IyQzx4ZzxEkhieCdME-8w307X23nB1WeDOIogDaBDh0sWJfAtbNhInqv9kKVCYmD-lUwOE2GJKPprWZfD-hlXb38/s1600/final.gif" height="640" width="622" /></a></div>
<span style="background: white; font-family: "Arial","sans-serif";"><br /></span>
<span style="background: white; font-family: "Arial","sans-serif";">That's about it. Happy Scratching !!</span><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="background: white; font-family: "Arial","sans-serif";"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Arial","sans-serif";"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/05605261175282274646noreply@blogger.com0tag:blogger.com,1999:blog-8054185149631393631.post-56621833887312392182014-02-05T14:35:00.000+08:002014-02-05T14:35:09.710+08:00Programming Variables<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">I was recently
“motivated” to provide elaborate details of Scratch programming blocks, although,
the name of each block is self-explanatory by itself, I can understand
some of the blocks remain a challenge, particularly to a complete beginner. In
this post, we will demystify the enigmas of some of these blocks. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">Let’s start with the
“Variables” block. <em><span style="background-color: white;">Variables</span></em><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial;"> </span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial;">play an important role in computer<span class="apple-converted-space"> </span><em>programming</em><span class="apple-converted-space"> as it provides flexibility to a p</span><em>rogrammer</em><span class="apple-converted-space"> </span>to write programs. Without it, it’s
analogous to driving a car without steering wheel.</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;">To keep the definition simple, a “variable” in programming context, is a
storage used to hold or process data during execution of the program and a reference
name is usually assigned to it. <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;">We’ll start with a simple program how variables are applied, and a
decision-making block will be included to demonstrate how computers make
decision.<o:p></o:p></span></span></div>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;">Say that I want the default Sprite (a.k.a the cat) to move back and forth
continuously (or “forever” in Scratch’s term) on the screen, and the speed of its movement
is controlled by the “up” and “down” key of the keyboard. Old habits die hard, I’ll start with a flow
chart as follows</span><span style="font-family: Arial, sans-serif;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOmPUoj3VUZczOd04wwXmhKBoNA7bVYLT458DrGsp91SilZPsDtXQsc1SBHqNq09JBvurFx0YZmqNW7O7wBZMiasfT_t9JmP9PofSe94ep2FquxtTRopfwTc3Gz2TVsj2lFImfYgbNla4/s1600/speed2a.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOmPUoj3VUZczOd04wwXmhKBoNA7bVYLT458DrGsp91SilZPsDtXQsc1SBHqNq09JBvurFx0YZmqNW7O7wBZMiasfT_t9JmP9PofSe94ep2FquxtTRopfwTc3Gz2TVsj2lFImfYgbNla4/s1600/speed2a.png" height="253" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The chart on the left column depicts the main program and this is how it
works :<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<ol>
<li><span style="background-color: white; font-family: Arial, sans-serif;"><o:p> </o:p></span><span style="background-color: white; font-family: Arial, sans-serif; text-indent: -18pt;">Set the variable "Speed" to zero</span></li>
<li><span style="font-family: Arial, sans-serif; text-indent: -18pt;"><span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="background-color: white; font-family: Arial, sans-serif; text-indent: -18pt;">Insert value of the variable to the “<span style="color: blue;"><b>move () steps</b></span>” block</span></li>
<li><span style="font-family: Arial, sans-serif; text-indent: -18pt;"><span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="background-color: white; font-family: Arial, sans-serif; text-indent: -18pt;">If on edge, bounce</span></li>
<li><span style="background-color: white; font-family: Arial, sans-serif; text-indent: -18pt;">Loop back to the “<span style="color: blue;"><b>move () steps</b></span>” instruction.</span></li>
</ol>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The chart at the middle and right column represents the blocks to
vary the speed. It increments by 0.1 when the “Up
Arrow” key is pressed and decreases 0.1 by the “Down Arrow” key. Note that
these two blocks are independent of the main block. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The Sprite remains inactive at the beginning of the program until the
“Up Arrow” or “Down Arrow” key is pressed. </span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif;">Below is how the blocks are snapped together to make the script :</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb7xtMioDvGl2bsj1FlNcpAtQz3DKbAnj9pzBgcnAPo8WkjMdBar-9yIkLuNfmaoxFfosBMnj2ok2VYTzSs3hTYAEVr31PEtisDHgXGt6Q8B8wd7sQ8CX1qpdE1vFNXtULWrfGsCf2iTE/s1600/speed1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb7xtMioDvGl2bsj1FlNcpAtQz3DKbAnj9pzBgcnAPo8WkjMdBar-9yIkLuNfmaoxFfosBMnj2ok2VYTzSs3hTYAEVr31PEtisDHgXGt6Q8B8wd7sQ8CX1qpdE1vFNXtULWrfGsCf2iTE/s1600/speed1.png" height="146" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">A variable named “Speed” is created and inserted to the value of “<span style="color: blue;"><b>move () steps</b></span>”
block, its value is now zero instead of its default value of
10. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">By now, any experienced programmer should be able to spot the “bug” in
the above example. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Now, where did we go wrong ??</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">What if the “Down Arrow” key is pressed first at the beginning of the
program ???<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The value of the Speed will decrease from zero to a negative value and
goes on indefinitely as long as the key is pressed. Negative value on the “move
()” block moves the Sprite backwards and positive values move the Sprite
forward. You can control the variable to avoid undesirable values that you do not want, but again, why not let the computer does the dirty job ??. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Unless the script is intended that way, you might like to set a minimum
and maximum limit of the variable “Speed”.
Let’s say we want the minimum speed to be zero and the maximum<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">limit to be 25. That is where the decision-making blocks take on the
role. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The revised flow chart is shown below.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiewdGG-cryfy1F4622yvoEKi0Y40Ec8dhZVnHs880CcgirA14Xo0MmmN5bXnGYXyHrSbE0Jg1HURGXrLzoEDIzNhFz-cQ_s2UVkScqz71meVg0qzX_8kAKiOuEIT8HCbXA3WpHa4w6Qt4/s1600/speed2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiewdGG-cryfy1F4622yvoEKi0Y40Ec8dhZVnHs880CcgirA14Xo0MmmN5bXnGYXyHrSbE0Jg1HURGXrLzoEDIzNhFz-cQ_s2UVkScqz71meVg0qzX_8kAKiOuEIT8HCbXA3WpHa4w6Qt4/s1600/speed2.png" height="340" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Let’s look at how the new algorithm works. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">When the program starts, variable “Speed” is set to zero and enters into
a loop. The Sprite stays stationary until one of the Arrow keys is pressed. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Assume the “Down Arrow” is first pressed,</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<ol>
<li><span style="background-color: white; font-family: Arial, sans-serif;">The variable “Speed” is decreased by 0.1 from the initial setting of
zero. The new value </span><span style="background-color: white; font-family: Arial, sans-serif;">of “Speed” is now -0.1</span></li>
<li><span style="background-color: white; font-family: Arial, sans-serif;">Next, the decision-making block checks if “Speed” is less than zero. In
this case, it holds true and falls into the “<span style="color: #e69138;"><b>if ()</b></span>” block loop whereby the
variable is reset to zero. When the execution within the “<span style="color: #e69138;"><b>if ()</b></span>” block is
completed, it exits the loop and just stops there (as no further instruction is
given after the “<span style="color: #e69138;"><b>if ()</b></span>” block) until the next key press is detected.</span></li>
</ol>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, sans-serif;">The same process applies to the "Up Arrow" key with the exception that the value is positive and limited to a maximum of 25.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">And the final script is shown below.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0jh7nCQ3kS-p5x4yhYaugfotVXkVeII3va8Q7Vp1Nvh6mlPCr8PB2TYMvqAOhSToXgzZ_oJR_Ep_5i3SiwgbnbV8wmjPOGppXTTv6nFpADXKFvliuxbLsSbTQBwGercTleh7lvSCg-cA/s1600/Speed3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0jh7nCQ3kS-p5x4yhYaugfotVXkVeII3va8Q7Vp1Nvh6mlPCr8PB2TYMvqAOhSToXgzZ_oJR_Ep_5i3SiwgbnbV8wmjPOGppXTTv6nFpADXKFvliuxbLsSbTQBwGercTleh7lvSCg-cA/s1600/Speed3.png" height="146" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br />
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">Take a step back and suppose the "<span style="color: blue;"><b>move () steps</b></span>" block was not assigned with a variable and uses its default value
instead, the speed of its movement will be constant and there’s no way to make alteration
to it while the program is running. Variables help to solve that problem.</span></div>
<div class="MsoNormal">
<br /></div>
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">I’ll continue with more examples in my next post how variables are updated / varied by its own during the program execution , so long for now.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/05605261175282274646noreply@blogger.com0tag:blogger.com,1999:blog-8054185149631393631.post-58432018369860736352014-01-15T16:09:00.002+08:002014-01-15T16:09:52.063+08:00A simple Heartbeat animationI remember my wife once asked how I felt the first time I met her, well...that was 26 years ago. For some unknown reasons, that same question inexplicably "haunted" me recently and I decided to deliver the same message again, in a different way with Scratch <a href="http://youtu.be/Ld-QV1vn9s4" style="background-color: white; border: 0px; color: #2793e6; cursor: pointer; font-family: Arial, Helvetica, sans-serif; font-size: small; line-height: 11px; margin: 0px; padding: 0px; text-decoration: none;" target="_blank">http://youtu.be/Ld-QV1vn9s4</a><br />
<br />
Not that I enjoyed revealing my private life, but to share Scratch can do a lot more things than we can imagine. The features of "<span style="color: blue;"><b>change effect() by ()</b></span>" seemed to be known not by many people, and the above animation unveils one of its numerous attributes. The script is shown below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxXcSt5k8xq0uL6d3Xd9B20Y000__eeepVruJR5VGFKyyMBEeXAo8iCIey0I1rfQG8gdAuI-fwrodjLCo_OYy7GEBzylvE9LX66-ExVHNHlCqZVZAP5GHe4ESattFsVq-d2u4bau8__CI/s1600/heart1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxXcSt5k8xq0uL6d3Xd9B20Y000__eeepVruJR5VGFKyyMBEeXAo8iCIey0I1rfQG8gdAuI-fwrodjLCo_OYy7GEBzylvE9LX66-ExVHNHlCqZVZAP5GHe4ESattFsVq-d2u4bau8__CI/s1600/heart1.gif" height="400" width="226" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: center;">
<br /></div>
Anonymoushttp://www.blogger.com/profile/05605261175282274646noreply@blogger.com0tag:blogger.com,1999:blog-8054185149631393631.post-47242679259775950802014-01-14T14:25:00.000+08:002014-01-14T14:25:06.501+08:00More animationHere's a good step-by-step video tutorial from <a href="http://inventwithscratch.com/">http://inventwithscratch.com/</a> how animation is created.<br />
<a href="http://www.youtube.com/watch?v=kZbenCm0AG8&list=PL0-84-yl1fUkall6a14nqzXpG79-RgI1F&index=6">http://www.youtube.com/watch?v=kZbenCm0AG8&list=PL0-84-yl1fUkall6a14nqzXpG79-RgI1F&index=6</a><br />
<br />
Happy ScratchingAnonymoushttp://www.blogger.com/profile/05605261175282274646noreply@blogger.com0tag:blogger.com,1999:blog-8054185149631393631.post-12803453001887550962013-12-29T22:20:00.000+08:002013-12-29T22:20:42.370+08:00Learning simple maths with shapes<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">If you were to ask a kid to draw a square and they would effortlessly
get it done. Have you ever wonder if they really understand the definition of a
square ?? Or a triangle ?? Getting
things done is one thing, being able to describe or communicate effectively to
another is a different story all together.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">There is no doubt programming requires the use of logic, mathematical
literacy and a little common sense, yet communication skill plays an important
part to deliver clear and precise instructions in order for the computer to
carry out the intended task.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><b>How does math comes into picture with shapes ??</b><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">We all know that a closed shape has 360 deg, if we divide 360 by the number
of sides of a shape, for example a square which has 4 sides, that will give you
90 deg on each side. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">So, definition of a square is "a shape having 4 equal sides with 90 deg
at each corner of the 4 sides".<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">Try working out a pentagon, triangle or a hexagon with your kids. </span><o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">Let’s start Scratch to draw a square. Get yourself familiar with the
following blocks where we will be using it for our assignment.</span><o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizpPYE84CxxNr1DKcJPpJPo6xUUhC_abu_1uRw3EjnAPtIE_io7M_6Qh2tzGIYUpZzlmNE9XACrFbSI1BQJvWTvoSORtulZC-jr0PAm6JdaEnG6GwysPn_ew14AK5T9HGWMXOzilLYDfQ/s1600/shapes+block.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizpPYE84CxxNr1DKcJPpJPo6xUUhC_abu_1uRw3EjnAPtIE_io7M_6Qh2tzGIYUpZzlmNE9XACrFbSI1BQJvWTvoSORtulZC-jr0PAm6JdaEnG6GwysPn_ew14AK5T9HGWMXOzilLYDfQ/s1600/shapes+block.png" height="113" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">You might like to shrink the sprite to see clearer how the lines are
drawn. Drawing lines in computer sense means moving an object leaving a trail,
and that’s where the “pen” blocks come into play. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">Let’s work out a sequence for the script based on a flow chart before
we snap the blocks together.</span><o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZIz2Wezdd_HAN9yH3CJgrk9zdQ9QZCK159l8fdFxyC6VaY_lELhL33pUjgYxWIuTSvWV9XZZIWEQ-xzFVf0T5nl-mphjk-w3kshbmhPR_bWLw8g6D47yFqsHtITiBcKp9a82Yj1dLSUU/s1600/flowchart.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZIz2Wezdd_HAN9yH3CJgrk9zdQ9QZCK159l8fdFxyC6VaY_lELhL33pUjgYxWIuTSvWV9XZZIWEQ-xzFVf0T5nl-mphjk-w3kshbmhPR_bWLw8g6D47yFqsHtITiBcKp9a82Yj1dLSUU/s1600/flowchart.png" height="640" width="268" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">This is how the flow chart interprets :</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<ol>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 7pt; text-indent: -18pt;"> </span><span style="text-indent: -18pt;">Clear all the lines whenever the program starts</span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 7pt; text-indent: -18pt;"> </span><span style="text-indent: -18pt;">Draw
the square beginning at position x = 0, y = 0</span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 7pt; text-indent: -18pt;"> </span><span style="text-indent: -18pt;">“Get”
the pen</span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 7pt; text-indent: -18pt;"> </span><span style="text-indent: -18pt;">Move
100 steps</span></span></li>
<li><span style="text-indent: -18pt;"><span style="font-family: Arial, Helvetica, sans-serif;">Turn
90 deg to the right</span></span></li>
<li><span style="text-indent: -18pt;"><span style="font-family: Arial, Helvetica, sans-serif;">Repeat step (4) and step (5) 3 more times</span></span></li>
<li><span style="font-size: 11pt; line-height: 107%;"><span style="font-family: Arial, Helvetica, sans-serif;">“Keep” the pen when finished drawing</span></span></li>
</ol>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">Take note of the loop. As a square has 4 sides, we only need to repeat
the sides 4 times, unlike the “forever” loop covered in my previous post.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">We can now snap the blocks as shown below and that completes our task.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixl77mn1dSmrpvBy3zmMbIaWzUXOv5Pl9sifPr0e2ZZVQz08mF0o4z8dX5nsFCqCosYYzvN4MRVrD0EPj2MMuxrXiCfDVhawelPXtFcgNgVFv6ouJlcAItcAY76fVJYKok-x2UWnljqPA/s1600/square.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixl77mn1dSmrpvBy3zmMbIaWzUXOv5Pl9sifPr0e2ZZVQz08mF0o4z8dX5nsFCqCosYYzvN4MRVrD0EPj2MMuxrXiCfDVhawelPXtFcgNgVFv6ouJlcAItcAY76fVJYKok-x2UWnljqPA/s1600/square.png" height="376" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">Now, what if we want to draw a hexagon ???<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">Hmm……a hexagon has 6 sides and what’s the angle at each side ???<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">Divide 360 by 6 and that gives 60 deg. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">Using the same script we had created, replace 4 with 6 in the “<span style="color: #f6b26b;"><b>repeat</b></span>”
block and 120 deg in the “<b><span style="color: blue;">turn () degrees</span></b>” block. You should have something like below.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiduXBKXm-u-iKNihB_plQYEoyRll7CBm5dPxmGxGTVi5jrcszAXbs_31AdBMzOScsAPxHu1uUXuRlpVthHhn75AAEegVKRALg5CpyVHUfVZo5wbXvLn3KIYKSTHbEnfwYtYIyVOfeqyfw/s1600/hexagon.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiduXBKXm-u-iKNihB_plQYEoyRll7CBm5dPxmGxGTVi5jrcszAXbs_31AdBMzOScsAPxHu1uUXuRlpVthHhn75AAEegVKRALg5CpyVHUfVZo5wbXvLn3KIYKSTHbEnfwYtYIyVOfeqyfw/s1600/hexagon.png" height="406" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;">Try other shapes yourself like triangle, pentagon, etc. A closed shape
is only valid if the number of repeats multiply by the angles should give you
360.</span><o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/05605261175282274646noreply@blogger.com0tag:blogger.com,1999:blog-8054185149631393631.post-62035479253963380312013-12-28T19:55:00.000+08:002013-12-28T03:57:00.017+08:00Scratch TutorialHere are some sites that will aid the beginners :<br />
<br />
<div class="MsoNormal">
<a href="https://mywebspace.wisc.edu/dhawk/scratch/">https://mywebspace.wisc.edu/dhawk/scratch/</a><o:p></o:p></div>
<div class="MsoNormal">
<a href="http://learnscratch.org/">http://learnscratch.org/</a><o:p></o:p></div>
<div class="MsoNormal">
<a href="http://info.scratch.mit.edu/Video_Tutorials">http://info.scratch.mit.edu/Video_Tutorials</a><o:p></o:p></div>
<br />
<div class="MsoNormal">
<a href="http://myreadinglog.net/blog/beginning-scratch/video-tutorials-to-begin-your-scratch-projects/">http://myreadinglog.net/blog/beginning-scratch/video-tutorials-to-begin-your-scratch-projects/</a><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
I'll be more than happy to help if needed :-)</div>
<div class="MsoNormal">
<br /></div>
Anonymoushttp://www.blogger.com/profile/05605261175282274646noreply@blogger.com0Kuala Lumpur, Federal Territory of Kuala Lumpur, Malaysia3.139003 101.686854999999922.885326 101.36413149999993 3.3926800000000004 102.00957849999992tag:blogger.com,1999:blog-8054185149631393631.post-67872107277978651092013-12-26T07:22:00.001+08:002013-12-26T12:57:01.546+08:00Learn to juggle, not a Juggler's way<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">My previous post explained
how Scratch programming blocks were snapped together to make a simple
animation. For convenience sake, the script is reproduced below :</span><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMzu9Z8HpbOaEaXg6oWoM28w9s45WdaXZAUlKYnTJYx3RAmoaayYp_nda2chElzkTbofjB3B3q4_Q2WSXfc1HJwYGA4rneq6VASfQYFYc-8CqWykmua4hAE3E-ivb6_bY95XXObv8wzOo/s1600/script1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMzu9Z8HpbOaEaXg6oWoM28w9s45WdaXZAUlKYnTJYx3RAmoaayYp_nda2chElzkTbofjB3B3q4_Q2WSXfc1HJwYGA4rneq6VASfQYFYc-8CqWykmua4hAE3E-ivb6_bY95XXObv8wzOo/s1600/script1.png" height="200" width="168" /></a></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">Always
remember that the blocks are executed one at a time in succession. In
conclusion, placement of the blocks over another is crucial. The “<b><span style="color: blue;">go to x: ()
y: ()</span></b>” block is first carried out when the “<b><span style="color: orange;">Green Flag</span></b>” button is clicked, followed
by <span style="color: blue;"><b>“move () steps</b></span>”, and so on. <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">At some
point, the rule does not hold depending on your application. Try re-position or
juggle any of the blocks within the “forever” block in the above script. The
animation may look the same to our naked eyes, but it makes a lot of difference
as far as the script is concern.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";"><br /></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">Continuing
with the above script, let’s add some graphics to embellish the backdrop. Click
on the “Stage” and then the “Background” tab.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3C6ye4r_wfoKteemmGeaB4F6ZEnuzoXyMdYHy3wT8jS9bfyWdcLBu5jRihLmV72eocBcC94a5Jr8jp844cR2omSyngugTOmc3YMTaoMY_AMVuTab1GE4Vlz8loGBKhNRM_MF06w8eIT8/s1600/stage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3C6ye4r_wfoKteemmGeaB4F6ZEnuzoXyMdYHy3wT8jS9bfyWdcLBu5jRihLmV72eocBcC94a5Jr8jp844cR2omSyngugTOmc3YMTaoMY_AMVuTab1GE4Vlz8loGBKhNRM_MF06w8eIT8/s1600/stage.png" height="472" width="640" /></a></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Click on the “Edit” button and the Paint Editor appears.
Import the graphics from the built-in library.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJ3QN_qPzt0EaJ3xiYMHW1RccK2NL0VqtB1N_X8SvZuc9iHEawpSAsCj3aA0yD_9OzvIvgQTWGrOwUgC9JUn-sxSxz3vMXSei_zsQ6lUbvUj0t5FrO7g3ADupA8t_7lmm1kYlf5E4zY9A/s1600/edit.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJ3QN_qPzt0EaJ3xiYMHW1RccK2NL0VqtB1N_X8SvZuc9iHEawpSAsCj3aA0yD_9OzvIvgQTWGrOwUgC9JUn-sxSxz3vMXSei_zsQ6lUbvUj0t5FrO7g3ADupA8t_7lmm1kYlf5E4zY9A/s1600/edit.png" height="251" width="640" /></a></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">You can select any of the images from the various folders.
Select “woods” under the Nature folder for the purpose of this practice. Shrink
the sprite by clicking on the “Shrink” button and your stage should look like
below. <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Note : Don't forget to click on the sprite when the “Shrink” button is
pressed. Clicking only the </span><o:p></o:p></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"> "Shrink" button does not minimize the size of the sprite.</span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVNqxRXpg4nGK12m5_wV5MB3cLrK5TzXhOqGbHJadRvgtuo6M5iNwf-lqkZwOTTitGcIXd0fcJR2kUuySDy1K2jFMaItTVPFbVWo3_czF9AJIciFRodS0Z-shG_FqhJElFtiVbUk5ma44/s1600/shrink.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVNqxRXpg4nGK12m5_wV5MB3cLrK5TzXhOqGbHJadRvgtuo6M5iNwf-lqkZwOTTitGcIXd0fcJR2kUuySDy1K2jFMaItTVPFbVWo3_czF9AJIciFRodS0Z-shG_FqhJElFtiVbUk5ma44/s1600/shrink.png" height="373" width="400" /></a></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">That’s not the end. You can add sound, another sprite ,etc
to make it more lively. Your imagination is the limit. </span><o:p></o:p></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Let’s add a sound “<b>meow</b>” to the cat whenever it hits the
edge. Click on the “<b><span style="color: magenta;">Sound</span></b>” button on your left. If you do not see the “<b><span style="color: magenta;">play
sound (meow)</span></b>” block on your screen but “<span style="color: magenta;">play sound (pop)</span>” instead, that
means you are still in the “Stage” Script Area. Click sprite1 (the cat) and it
should appear above the Script Area as shown below <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJdCTunnUlvDMWbOiGa6HmPLnyXb4grkwKu4buMOQrNW2ul-iZY7A-NTkuvxy6j8TFR_M66EVIbOwGpoGMOBO__IOS1rByORsE1c4vXLlAgyIEuadQRf6xAhrzqFGPIbp_kOGjIVCeI_Y/s1600/select+sprite.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJdCTunnUlvDMWbOiGa6HmPLnyXb4grkwKu4buMOQrNW2ul-iZY7A-NTkuvxy6j8TFR_M66EVIbOwGpoGMOBO__IOS1rByORsE1c4vXLlAgyIEuadQRf6xAhrzqFGPIbp_kOGjIVCeI_Y/s1600/select+sprite.png" height="464" width="640" /></a></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Drag the “play sound (meow)” block and insert it below the “<b><span style="color: blue;">if
on edge, bounce</span></b>” block. The script should look like below :<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6DqiPE-gHsLuzkNK5vC-fO_WzjJM-jdElt0gkuLHjMFjqe99ervbuHtSOoYHULb2Xv20EZqQBCbzxW3f8pUiJ13Hoi0Xc1GkUC3SuxerxP2IpLGw-Ki7nTGD17M4_Q0kL6W_fyAu9QIk/s1600/sound.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6DqiPE-gHsLuzkNK5vC-fO_WzjJM-jdElt0gkuLHjMFjqe99ervbuHtSOoYHULb2Xv20EZqQBCbzxW3f8pUiJ13Hoi0Xc1GkUC3SuxerxP2IpLGw-Ki7nTGD17M4_Q0kL6W_fyAu9QIk/s1600/sound.png" /></a></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Start the animation by clicking the “Green Flag” button. Oops !!! <b><span style="color: red;">We got a bug</span></b>.</span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Click the “Stop” button on the far right above the stage
area.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, sans-serif;">The cat keeps "meowing" non-stop and we wanted it to "meow" ONLY when it hits the edge.</span></div>
<div class="MsoNormal">
<span style="font-family: Arial, sans-serif;">This is where the "decision making" blocks come into play. Creating a flow chart helps make the picture clearer.</span></div>
<div class="MsoNormal">
<span style="font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8oMJJyDnsaF0GJYJLyICO3MQe0Gc3JcEB-nvb5cbvUYI5b_9i4TDrvyRnLX0PZgxsJL9DKaX8fnrebKJA6tQf8-nwE3K1dd8fv-ToBZEZtgngzBEKUY4iuJazABbz59CSba9RIgNigOk/s1600/chart3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8oMJJyDnsaF0GJYJLyICO3MQe0Gc3JcEB-nvb5cbvUYI5b_9i4TDrvyRnLX0PZgxsJL9DKaX8fnrebKJA6tQf8-nwE3K1dd8fv-ToBZEZtgngzBEKUY4iuJazABbz59CSba9RIgNigOk/s1600/chart3.png" height="640" width="416" /></a></div>
<div class="MsoNormal">
<span style="font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">We will add two blocks shown below, an “ <b><span style="color: #ed7d31; mso-themecolor: accent2;">if</span></b> ” block for decision making, a “<span style="color: blue;"><b>touching (edge)</b></span>” to
sense the edge</span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy7fIUeIN4-vjl_FyFJpUV9dYuqKF6RT4zYX9hsTYrP1Ux6g1ONrS-pb_z-M41qSikZeN85dE2YgWrjmVuFYoGBGOEGPfxivNZ1u8Wd6raRIWpehQaktKahTyPqGQPAgjoPuNH6LK4Ucw/s1600/touch.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy7fIUeIN4-vjl_FyFJpUV9dYuqKF6RT4zYX9hsTYrP1Ux6g1ONrS-pb_z-M41qSikZeN85dE2YgWrjmVuFYoGBGOEGPfxivNZ1u8Wd6raRIWpehQaktKahTyPqGQPAgjoPuNH6LK4Ucw/s1600/touch.png" /></a></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<o:p></o:p></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">Snap the "</span><span style="color: blue; font-family: Arial, Helvetica, sans-serif;"><b>touching (edge)</b></span><span style="font-family: Arial, Helvetica, sans-serif;">” block into the blank space of the </span><span style="font-family: Arial, Helvetica, sans-serif;"> “ </span><b style="font-family: Arial, Helvetica, sans-serif;"><span style="color: #ed7d31;">if</span></b><span style="font-family: Arial, Helvetica, sans-serif;"> ” block. The final script should resemble below </span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhbEy94zX_ERFaH4KJfGr8kcSKswM_qqcF3TIKO6jQtRT4GgVV0MPCsKHjGPXXh5hEujv1xiaM_YCtqXJf-35AAYrKpVUjzdwxvDYIL-Lg69FdrUUdeR-KSGJzXDA5utEE52NsrOphB20/s1600/final.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhbEy94zX_ERFaH4KJfGr8kcSKswM_qqcF3TIKO6jQtRT4GgVV0MPCsKHjGPXXh5hEujv1xiaM_YCtqXJf-35AAYrKpVUjzdwxvDYIL-Lg69FdrUUdeR-KSGJzXDA5utEE52NsrOphB20/s1600/final.png" height="320" width="251" /></a></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Trying exploring with with your own imagination with more blocks and sprites.</span></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";">Happy Scratching</span></div>
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif";"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/05605261175282274646noreply@blogger.com0tag:blogger.com,1999:blog-8054185149631393631.post-3764609387432570372013-12-22T18:37:00.000+08:002013-12-25T09:09:12.266+08:00Getting Started<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Many parents tend to freak out whenever
“computing” or “programming” subject is brought up, and too often, it’s their
own fear that limit themselves or their children the broader uptake in
technologies. <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Technology has evolved since the dawn of
smartphones. Gone are the days where it takes a person conversant in
electronics to build an alarm clock. With
today’s advancement, a micro-controller and a display, with a little
programming skill is all it takes to achieve that task. With Scratch, as a
block based programming tool, there’s nothing easier than snapping the blocks
together. <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">By the way,
Scratch comes in 2 version. The latest version being Scratch 2.0, and the older
version is Scratch 1.4. As mentioned earlier, other than interactive
programming with Scratch, Arduino micro controller will be included to get
things “physical”. The only stable derivative that I’ve tried so far is S4A, a
Scratch 1.4 extension. Hence, throughout my blog, I’ll stick to Scratch 1.4 and
S4A.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Download Scratch 1.4 at<a href="https://www.blogger.com/goog_1650197820"> </a></span></span><a href="http://scratch.mit.edu/scratch_1.4/">http://scratch.mit.edu/scratch_1.4/</a><o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Start Scratch 1.4 once you have completed the installation. The
interface should look something like below :<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuA24tiN_IEQPihbDEW1T_nBDnmLnFyzQBfcI5sizAuHf1QK5n92XeYc9TF96xKzsiRc4j5PTkoRIR4khuMJ8oY07ERfUF7DFTGigLDby34iHpOky4XvcH_0ZflLny1V3eitfO0N-X0J0/s1600/Layout.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuA24tiN_IEQPihbDEW1T_nBDnmLnFyzQBfcI5sizAuHf1QK5n92XeYc9TF96xKzsiRc4j5PTkoRIR4khuMJ8oY07ERfUF7DFTGigLDby34iHpOky4XvcH_0ZflLny1V3eitfO0N-X0J0/s1600/Layout.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="355" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuA24tiN_IEQPihbDEW1T_nBDnmLnFyzQBfcI5sizAuHf1QK5n92XeYc9TF96xKzsiRc4j5PTkoRIR4khuMJ8oY07ERfUF7DFTGigLDby34iHpOky4XvcH_0ZflLny1V3eitfO0N-X0J0/s1600/Layout.png" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><b><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Make
something move<o:p></o:p></span></b></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">On the Stage area, a default image of a cat is loaded whenever Scratch is
started. You can import or create as many images as you like, and each image is
assigned a name Sprite1, Sprite2 etc. All the sprites are visible on the Sprite
Thumbnail area.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Drag the “</span></span><span class="apple-converted-space"><b><span style="background: white; color: #0070c0; font-family: "Arial","sans-serif";">move
(10) steps</span></b></span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">” block
to the Script Area as shown below :<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeyvPQGNASxxXFxe6pvKGkVu6fFnqULRzF_QHPM2c3tYhzL6kENVQCEnTqQcmo6J36THXwoQRXZEAJLcfPIABG6rmGchhQzWtAkoaUhqMH-HWLOkSCw7Jfu29IbyHcSYS2GwfPGLrexCI/s1600/move10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeyvPQGNASxxXFxe6pvKGkVu6fFnqULRzF_QHPM2c3tYhzL6kENVQCEnTqQcmo6J36THXwoQRXZEAJLcfPIABG6rmGchhQzWtAkoaUhqMH-HWLOkSCw7Jfu29IbyHcSYS2GwfPGLrexCI/s1600/move10.png" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">As the name implies, it moves a sprite 10 steps
whenever it is activated. The number of “steps” represent each pixel on the
computer screen. Try exploring the “move” block by clicking it with your mouse
pointer and change the steps with different number. The sprite should move
accordingly to the steps when the “move” block is clicked.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space">
</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">You can drag the sprite to anywhere on the Stage
Area, which is 360 x 480 pixels wide, as shown below.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPhM145XFqs-dj4_KfqGw5JdZjOPVZvO0WgpixQ5V1yhcAl4yzX2oU_xgkNWEU_5YbEy3EdBGjJFrAbNSYVz0dlLuEkgWSh9-j19ZZMe6Xd78UKMmACjhoENPIz3YHlxI1qF4rqTyTAAo/s1600/xy+grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="586" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPhM145XFqs-dj4_KfqGw5JdZjOPVZvO0WgpixQ5V1yhcAl4yzX2oU_xgkNWEU_5YbEy3EdBGjJFrAbNSYVz0dlLuEkgWSh9-j19ZZMe6Xd78UKMmACjhoENPIz3YHlxI1qF4rqTyTAAo/s1600/xy+grid.png" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The sprite position is shown right above the
Script Area, next to the sprite image :<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space">
</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Try to drag the sprite anywhere the Script Area,
the sprite position changes accordingly.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9UWy7Wsrps3ZibIW0HwJxHbl4IxGdITWm4BQ0wpfMXzSEmNBnu03qwbfb3ywBYQV33hHWC0_pla43FwA0WaSsbUBt8wlf3ajJTZNeBsFuk8muA_t_4HDmqp8mRF47aPd_W19wzhWldJ4/s1600/position.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="352" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9UWy7Wsrps3ZibIW0HwJxHbl4IxGdITWm4BQ0wpfMXzSEmNBnu03qwbfb3ywBYQV33hHWC0_pla43FwA0WaSsbUBt8wlf3ajJTZNeBsFuk8muA_t_4HDmqp8mRF47aPd_W19wzhWldJ4/s1600/position.png" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;">Let’s create a building block, making the sprite
move back and forth around the Stage Area. The program has to meet the
following criteria :<o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space" style="text-indent: -18pt;"><span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<ol>
<li><span class="apple-converted-space" style="text-indent: -18pt;"><span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;">Program starts upon clicking the "<b><span style="color: orange;">when clicked</span></b>" block or the "Green Flag" button.</span></span></span></li>
</ol>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt-CgmeX9Es15MwLTQ_2FGHFGCnpb4G7cJqCbORiYEiEJyz3CjYJZ-6cYfIVaxb1KuQFPfno6WLiAyVRaeAarUP2hXaP_3mlq69BLdEsa00u8dDt3sI_7VzNFKRBbCrliMDrBnGZscsTg/s1600/flag.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="104" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt-CgmeX9Es15MwLTQ_2FGHFGCnpb4G7cJqCbORiYEiEJyz3CjYJZ-6cYfIVaxb1KuQFPfno6WLiAyVRaeAarUP2hXaP_3mlq69BLdEsa00u8dDt3sI_7VzNFKRBbCrliMDrBnGZscsTg/s1600/flag.png" width="320" /></a></div>
<span class="apple-converted-space" style="text-indent: -18pt;"><span style="background-color: white;"><br /></span></span>
<br />
<ol>
<li><span class="apple-converted-space" style="text-indent: -18pt;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The
sprite starts moving at position x = 0, y = 0 at the beginning of the program.</span></span></li>
<li><span style="background-color: white; font-family: Arial, sans-serif; text-indent: -18pt;">When the sprite hits the edge of the screen, turns
back and move to the other end of the screen.</span></li>
</ol>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Let’s follow the above criteria “sequentially”.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span class="apple-converted-space"><span style="background-color: white;">Criteria(1) - </span></span><span class="apple-converted-space"><span style="background-color: white; line-height: 107%;">Click on the “Control” button from the Pallete Block. Drag the </span></span><span style="background-color: white; line-height: 107%;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f">
<v:stroke joinstyle="miter">
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
<v:f eqn="sum @10 21600 0">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></v:shapetype><v:shape id="Picture_x0020_26" o:spid="_x0000_i1025" style="height: 37.5pt; mso-wrap-style: square; visibility: visible; width: 110.25pt;" type="#_x0000_t75">
<v:imagedata o:title="" src="file:///C:\Users\GARYCH~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png">
</v:imagedata></v:shape></span><span class="apple-converted-space"><span style="background-color: white; line-height: 107%;">block as shown below</span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span class="apple-converted-space"><span style="background-color: white; line-height: 107%;"><br /></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjACrgod8J7dmtc4nS9_3ZkHbY_VCuUxJpciR2xlN5gcKPZTXEYh_r5u1V-mbX-AzL1F23fWonJUrw7z-YioodolIyLpAv1Rmv1DD-3cjpkjqJuBY-ZPjA7Aa7J8HZAn1Uu4-iPBJOpfvg/s1600/control.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="446" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjACrgod8J7dmtc4nS9_3ZkHbY_VCuUxJpciR2xlN5gcKPZTXEYh_r5u1V-mbX-AzL1F23fWonJUrw7z-YioodolIyLpAv1Rmv1DD-3cjpkjqJuBY-ZPjA7Aa7J8HZAn1Uu4-iPBJOpfvg/s1600/control.png" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span class="apple-converted-space"><span style="background-color: white; line-height: 107%;"><br /></span></span></span></div>
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%;">Criteria (2) –The sprite starts at position x= 0, y = 0 the minute "<b><span style="color: orange;">when clicked</span></b>" block </span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f">
<v:stroke joinstyle="miter">
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
<v:f eqn="sum @10 21600 0">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></v:shapetype><v:shape id="Picture_x0020_26" o:spid="_x0000_i1025" style="height: 37.5pt; mso-wrap-style: square; visibility: visible; width: 110.25pt;" type="#_x0000_t75">
<v:imagedata o:title="" src="file:///C:\Users\GARYCH~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png">
</v:imagedata></v:shape></span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%;">is clicked
irrespective of where the sprite is. , then move 10 steps continuously. </span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%;">Click on the “<span style="color: blue;"><b>Motion</b></span>” button and drag "<b><span style="color: blue;">go to x:() y:()</span></b>" </span></span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%;">block to the Script
Area</span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, sans-serif;"><span style="font-size: 15px; line-height: 16px;"><br /></span></span><span class="apple-converted-space"><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%;"></span></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<span class="apple-converted-space"><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw3fqBvvn59Eqzx3JjhH5W_XBDIJjnHtKt1VC7l5HaSFl1sCg2ciwHmN3W8jV47UvPiTBhMIFTCYOUHrk1vPBVDZ_bXk9BZ1EvRkxDFKF_zrXaGpZXwaqsK1jp688BLNZmiVVgu4YZGkw/s1600/motion.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="510" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw3fqBvvn59Eqzx3JjhH5W_XBDIJjnHtKt1VC7l5HaSFl1sCg2ciwHmN3W8jV47UvPiTBhMIFTCYOUHrk1vPBVDZ_bXk9BZ1EvRkxDFKF_zrXaGpZXwaqsK1jp688BLNZmiVVgu4YZGkw/s1600/motion.png" width="640" /></a></span></span></span></div>
<span class="apple-converted-space"><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%;">
</span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%;"><br /></span></span><br />
<div style="text-indent: -24px;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div style="text-indent: -24px;">
<span style="font-family: Arial, sans-serif;"><br /></span></div>
<div style="text-indent: -24px;">
<span style="font-family: Arial, sans-serif;"><br /></span></div>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Snap the "<b><span style="color: orange;">when clicked</span></b>" </span></span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">and </span></span><span style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; line-height: 16px;">"<b><span style="color: blue;">go to x:() y:()</span></b>"</span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"> </span></span><v:shape id="Picture_x0020_22" o:spid="_x0000_i1025" style="height: 27pt; visibility: visible; width: 90.75pt;" type="#_x0000_t75">
<v:imagedata o:title="" src="file:///C:\Users\GARYCH~1\AppData\Local\Temp\msohtmlclip1\01\clip_image002.png">
</v:imagedata></v:shape><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">blocks together. It should
look something like below</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVOUXjJhQNutH1aoktRhkjp3-X_uK-pPVQjsdmKUYlgFCvFJRvvFntmCIxj8uH6FonV5TlrGUn6cKCY9oopjnKuMBlBzVRj6wGKkBzpvszR1ps-8vQYuHe45QzWcJ_KSWO2EuKieTJrgo/s1600/snap.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="486" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVOUXjJhQNutH1aoktRhkjp3-X_uK-pPVQjsdmKUYlgFCvFJRvvFntmCIxj8uH6FonV5TlrGUn6cKCY9oopjnKuMBlBzVRj6wGKkBzpvszR1ps-8vQYuHe45QzWcJ_KSWO2EuKieTJrgo/s1600/snap.png" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div style="text-indent: -24px;">
<span style="font-family: Arial, sans-serif;"><br /></span></div>
<br />
<div style="text-indent: -24px;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Drag the "<b><span style="color: blue;">move() steps</span></b>"</span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f"> <v:stroke joinstyle="miter"><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"><v:f eqn="sum @0 1 0"><v:f eqn="sum 0 0 @1"><v:f eqn="prod @2 1 2"><v:f eqn="prod @3 21600 pixelWidth"><v:f eqn="prod @3 21600 pixelHeight"><v:f eqn="sum @0 0 1"><v:f eqn="prod @6 1 2"><v:f eqn="prod @7 21600 pixelWidth"><v:f eqn="sum @8 21600 0"><v:f eqn="prod @7 21600 pixelHeight"><v:f eqn="sum @10 21600 0"></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas><v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f"><o:lock aspectratio="t" v:ext="edit"></o:lock></v:path></v:stroke></v:shapetype><v:shape id="Picture_x0020_23" o:spid="_x0000_i1026" style="height: 27pt; mso-wrap-style: square; visibility: visible; width: 86.25pt;" type="#_x0000_t75"><v:imagedata o:title="" src="file:///C:\Users\GARYCH~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png"></v:imagedata></v:shape></span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">block and snap it below </span></span><span class="apple-converted-space"><span style="background-color: white; font-family: Arial, sans-serif;"> </span></span><span style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; line-height: 16px;">"<b><span style="color: blue;">go to x:() y:()</span></b>" </span><span style="background-color: white; font-family: Arial, sans-serif;">block.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Criteria (3) – The sprite turns back when it hits
the edge of the screen.</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">We have to look for a block that does the job. On the “<b><span style="color: blue;">Motion</span></b>” button, scroll down the list
of blocks and try to locate "<b><span style="color: blue;">if on edge, bounce</span></b>"</span></span><span style="background-color: white; font-family: Arial, sans-serif;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f"><v:stroke joinstyle="miter"><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"><v:f eqn="sum @0 1 0"><v:f eqn="sum 0 0 @1"><v:f eqn="prod @2 1 2"><v:f eqn="prod @3 21600 pixelWidth"><v:f eqn="prod @3 21600 pixelHeight"><v:f eqn="sum @0 0 1"><v:f eqn="prod @6 1 2"><v:f eqn="prod @7 21600 pixelWidth"><v:f eqn="sum @8 21600 0"><v:f eqn="prod @7 21600 pixelHeight"><v:f eqn="sum @10 21600 0"></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas><v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f"><o:lock aspectratio="t" v:ext="edit"></o:lock></v:path></v:stroke></v:shapetype><v:shape id="Picture_x0020_24" o:spid="_x0000_i1025" style="height: 24.75pt; mso-wrap-style: square; visibility: visible; width: 97.5pt;" type="#_x0000_t75"><v:imagedata o:title="" src="file:///C:\Users\GARYCH~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png"></v:imagedata></v:shape></span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"> block.</span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"> </span></span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Snap it to below the </span></span><span style="background-color: white; font-family: Arial, sans-serif;">"</span><b style="font-family: Arial, sans-serif;"><span style="color: blue;">move() steps</span></b><span style="background-color: white; font-family: Arial, sans-serif;">" </span><span style="background-color: white; font-family: Arial, sans-serif;">block.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space">
</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">By now, your script should resemble below <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKit2tYfE2M2pVApOAi252zC_aMt6ppaqdR7wu-4LfXgaLOHfZ6QrrQUxBlJVHG2eKF8WNm-TfjFXk9d6bS1ODFsG5fU8daYGvRYUYpscm_wKxOSx1ajvw4v2TdUEA3nKkEO8S_eg53EQ/s1600/on+edge.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="478" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKit2tYfE2M2pVApOAi252zC_aMt6ppaqdR7wu-4LfXgaLOHfZ6QrrQUxBlJVHG2eKF8WNm-TfjFXk9d6bS1ODFsG5fU8daYGvRYUYpscm_wKxOSx1ajvw4v2TdUEA3nKkEO8S_eg53EQ/s1600/on+edge.png" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Are we ready to go ??? <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space">
</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Let’s analyse the script before we begin. It is
worth noting that the script executes each block (instruction) “sequentially”
once at a time and it looks something like below in “flow chart” terminology.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwlibiR-Gvlfk9069vZ5_4z9Y4HYrw455iIz4eeOJufB5YU_YSKoDVe31hxh4A9IDB9oAaw6XOuNbyrMR7hDN-hJiErnk1iUxA_66LoQm_4CkJnv4C0Fbe1DIf2K0t6t3nAjKBkn8w0NI/s1600/chart1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwlibiR-Gvlfk9069vZ5_4z9Y4HYrw455iIz4eeOJufB5YU_YSKoDVe31hxh4A9IDB9oAaw6XOuNbyrMR7hDN-hJiErnk1iUxA_66LoQm_4CkJnv4C0Fbe1DIf2K0t6t3nAjKBkn8w0NI/s1600/chart1.png" width="152" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">When the </span></span><span style="background-color: white; font-family: Arial, sans-serif;">"</span><b style="font-family: Arial, sans-serif;"><span style="color: blue;">if on edge, bounce</span></b><span style="background-color: white; font-family: Arial, sans-serif;">"</span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"> </span></span><span style="background-color: white; font-family: Arial, sans-serif;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f">
<v:stroke joinstyle="miter">
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
<v:f eqn="sum @10 21600 0">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></v:shapetype><v:shape id="_x0000_i1026" style="height: 24.75pt; mso-wrap-style: square; visibility: visible; width: 97.5pt;" type="#_x0000_t75">
<v:imagedata o:title="" src="file:///C:\Users\GARYCH~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png">
</v:imagedata></v:shape></span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">block is executed, it just
stops there as there are no other instructions to follow, and we want the
sprite to move continuously. To get around it, the solution is to create a loop
so that it “repeats” the operation after the </span></span><span style="background-color: white; font-family: Arial, sans-serif;">"</span><b style="font-family: Arial, sans-serif;"><span style="color: blue;">if on edge, bounce</span></b><span style="background-color: white; font-family: Arial, sans-serif;">" </span><span style="background-color: white; font-family: Arial, sans-serif;">block. </span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVzedyeuE6VCKwZliyu5Emoe27e1G2SCnrqJ6K4lNscREpTQwnMbaHuTvRhOXFxH04fjZWCZoEFRH8G4W2nvLMXH63TiwX5V-G9V-ZVWaauR0cV6bWRZLRqrUEDowhC9xJE5ZFeRduoEU/s1600/chart2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVzedyeuE6VCKwZliyu5Emoe27e1G2SCnrqJ6K4lNscREpTQwnMbaHuTvRhOXFxH04fjZWCZoEFRH8G4W2nvLMXH63TiwX5V-G9V-ZVWaauR0cV6bWRZLRqrUEDowhC9xJE5ZFeRduoEU/s1600/chart2.png" width="173" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">To create a loop based on the above flow chart,
drag the "<b><span style="color: orange;">forever</span></b>" </span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f"><v:stroke joinstyle="miter"><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"><v:f eqn="sum @0 1 0"><v:f eqn="sum 0 0 @1"><v:f eqn="prod @2 1 2"><v:f eqn="prod @3 21600 pixelWidth"><v:f eqn="prod @3 21600 pixelHeight"><v:f eqn="sum @0 0 1"><v:f eqn="prod @6 1 2"><v:f eqn="prod @7 21600 pixelWidth"><v:f eqn="sum @8 21600 0"><v:f eqn="prod @7 21600 pixelHeight"><v:f eqn="sum @10 21600 0"></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas><v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f"><o:lock aspectratio="t" v:ext="edit"></o:lock></v:path></v:stroke></v:shapetype><v:shape id="Picture_x0020_2" o:spid="_x0000_i1027" style="height: 40.5pt; mso-wrap-style: square; visibility: visible; width: 63.75pt;" type="#_x0000_t75"><v:imagedata o:title="" src="file:///C:\Users\GARYCH~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png"></v:imagedata></v:shape></span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">block to the Script Area and
insert the </span></span><span class="apple-converted-space"><span style="background-color: white; font-family: Arial, sans-serif;"> </span></span><span style="background-color: white; font-family: Arial, sans-serif;">"</span><b style="font-family: Arial, sans-serif;"><span style="color: blue;">if on edge, bounce</span></b><span style="background-color: white; font-family: Arial, sans-serif;">" </span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">and </span></span><span style="background-color: white; font-family: Arial, sans-serif;">"</span><b style="font-family: Arial, sans-serif;"><span style="color: blue;">move() steps</span></b><span style="background-color: white; font-family: Arial, sans-serif;">" </span><span style="background-color: white; font-family: Arial, sans-serif;">into the “<b><span style="color: orange;">forever</span></b>” block.
Your script should look something like below</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyAuwz3p1WL5WOsr5vMul-UDyrjk42OewmcVQZvtD3EYwKplGm6ESZM_ciH1iGsTvRikpg3YknUiE5KWn17bnQEoVLlfPhFibfivdL50zHbacYuE44Mp70ZW8julCea4GvIUCOvxypVjE/s1600/forever.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="452" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyAuwz3p1WL5WOsr5vMul-UDyrjk42OewmcVQZvtD3EYwKplGm6ESZM_ciH1iGsTvRikpg3YknUiE5KWn17bnQEoVLlfPhFibfivdL50zHbacYuE44Mp70ZW8julCea4GvIUCOvxypVjE/s1600/forever.png" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">That looks more sensible. Now, click on the </span></span><span style="background-color: white; font-family: Arial, sans-serif;"> "</span><b style="font-family: Arial, sans-serif;"><span style="color: orange;">when clicked</span></b><span style="background-color: white; font-family: Arial, sans-serif;">" or the "green" flag on the top right </span><span style="background-color: white; font-family: Arial, sans-serif;">to start the program.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space">
</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">You will note the following :</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space" style="text-indent: -18pt;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<ol>
<li><span class="apple-converted-space" style="text-indent: -18pt;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The sprite moves very fast. </span></span></li>
<li><span style="background-color: white; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%; text-indent: -18pt;">When the sprite hits
the right edge, it “bounced” back moving to the left direction upside down</span></li>
</ol>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">While the sprite is still moving, slow down the
speed by inserting the "<b><span style="color: orange;">wait () secs</span></b>" </span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f">
<v:stroke joinstyle="miter">
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
<v:f eqn="sum @10 21600 0">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></v:shapetype><v:shape id="Picture_x0020_6" o:spid="_x0000_i1025" style="height: 26.25pt; mso-wrap-style: square; visibility: visible; width: 69pt;" type="#_x0000_t75">
<v:imagedata o:title="" src="file:///C:\Users\GARYCH~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png">
</v:imagedata></v:shape></span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">block as shown below<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdd9VWT5UgLxa5IlHcUsYsE3n_f4UAvKNuO2qb40uls3X6klvP53lm2s0rrdMXlDdsle25hlORUGekOG23vw-0__zhqkSWiLWjD0NpfYYzMV50ERSBexNSyNXO8tMip2QTboIR7y-lejU/s1600/blocks.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdd9VWT5UgLxa5IlHcUsYsE3n_f4UAvKNuO2qb40uls3X6klvP53lm2s0rrdMXlDdsle25hlORUGekOG23vw-0__zhqkSWiLWjD0NpfYYzMV50ERSBexNSyNXO8tMip2QTboIR7y-lejU/s1600/blocks.png" width="298" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">The sprite now moves 10 steps every 1 sec and
this is too slow. Change the delay from 1 sec to 0.2 sec, or any value at your
comfort.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%;">Next, click on the “left-right” button as shown below</span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%;"><br /></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEginwD87qsMwGkrXxyCHUR-8IvZWozkVGhIwyKjE_8u9apPUUCJqPYxl_DsNO17lA4jwE0G2FEzw_DFKTKrPwRe2pzX8pGpR2_ND5lt77mt5-8LKbmpoIWPKwYjzeGSIBcBC5nNFaNJkLw/s1600/left-right.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="111" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEginwD87qsMwGkrXxyCHUR-8IvZWozkVGhIwyKjE_8u9apPUUCJqPYxl_DsNO17lA4jwE0G2FEzw_DFKTKrPwRe2pzX8pGpR2_ND5lt77mt5-8LKbmpoIWPKwYjzeGSIBcBC5nNFaNJkLw/s1600/left-right.png" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 11pt; line-height: 107%;"><br /></span></span></span></div>
<div style="text-indent: -24px;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div style="text-indent: -24px;">
<span style="font-family: Arial, sans-serif;"><span style="font-size: 15px; line-height: 16px;"><br /></span></span></div>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">That should fix the “upside down” position of the
sprite.</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif; text-indent: -24px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif; text-indent: -24px;">Somehow, something is still missing. The sprite
doesn’t look vibrant, and we need to add a little “spice” to </span><span style="background-color: white; font-family: Arial, sans-serif; text-indent: -24px;"> </span><span style="background-color: white; font-family: Arial, sans-serif; text-indent: -24px;">the script with some animation</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif; text-indent: -24px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif; text-indent: -24px;">Under the “Looks” button, click on the “Costumes”
tab</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif; text-indent: -24px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitly8YQo7hP9vOFgZINbCvjMk9yWf6b-TPXAB442AW6tRqpBdJYcZtvu0V10Fe56ztgxAEZNKAZe3yOtdp3FzyuFg9ah4vF5LxtLwlH38u8Yac3KnIfeU5x3U1q5a6oeR_G-b4LhTaEkA/s1600/costume.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="348" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitly8YQo7hP9vOFgZINbCvjMk9yWf6b-TPXAB442AW6tRqpBdJYcZtvu0V10Fe56ztgxAEZNKAZe3yOtdp3FzyuFg9ah4vF5LxtLwlH38u8Yac3KnIfeU5x3U1q5a6oeR_G-b4LhTaEkA/s1600/costume.png" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif; text-indent: -24px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif; text-indent: -24px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">You will see two costumes, namely Costume1 and
Costume2. <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Note : Each sprite can have multiple costumes,
either created by yourself or imported from the built-in library. You can have
as many sprites as you like.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Imagine if the costume of the sprite switches
each time it moves, doesn’t it give a bit of zing to the sprite ??<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Return to the Script Area by clicking on the “Scripts”
tab a show below.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUc9otZ6DXWBzlc2CPyBHfXocz8o_uDHsZQ9TBSu8bTCduqhnBRXFCYOjVvrHVk2GHnSivPJFZxqFYemi0B7IBE2uu4RxGPL3ArpFpkSQHZqy9_gfqDNENjlzXWMZQy7MGHJCgqApMn0Y/s1600/script.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUc9otZ6DXWBzlc2CPyBHfXocz8o_uDHsZQ9TBSu8bTCduqhnBRXFCYOjVvrHVk2GHnSivPJFZxqFYemi0B7IBE2uu4RxGPL3ArpFpkSQHZqy9_gfqDNENjlzXWMZQy7MGHJCgqApMn0Y/s1600/script.png" width="302" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Click on the “<b><span style="color: #674ea7;">Looks</span></b>” button, and insert the "<b><span style="color: #8e7cc3;">next costume</span></b>" </span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f"><v:stroke joinstyle="miter"><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"><v:f eqn="sum @0 1 0"><v:f eqn="sum 0 0 @1"><v:f eqn="prod @2 1 2"><v:f eqn="prod @3 21600 pixelWidth"><v:f eqn="prod @3 21600 pixelHeight"><v:f eqn="sum @0 0 1"><v:f eqn="prod @6 1 2"><v:f eqn="prod @7 21600 pixelWidth"><v:f eqn="sum @8 21600 0"><v:f eqn="prod @7 21600 pixelHeight"><v:f eqn="sum @10 21600 0"></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas><v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f"><o:lock aspectratio="t" v:ext="edit"></o:lock></v:path></v:stroke></v:shapetype><v:shape id="Picture_x0020_8" o:spid="_x0000_i1026" style="height: 21.75pt; mso-wrap-style: square; visibility: visible; width: 81pt;" type="#_x0000_t75"><v:imagedata o:title="" src="file:///C:\Users\GARYCH~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png"></v:imagedata></v:shape></span><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">right below the </span></span><span style="background-color: white; font-family: Arial, sans-serif;">"</span><b style="font-family: Arial, sans-serif;"><span style="color: blue;">move() steps</span></b><span style="background-color: white; font-family: Arial, sans-serif;">" </span><span style="background-color: white; font-family: Arial, sans-serif;">block.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwqvd8bbd0RBEZ-9EIwk4vAnEGx_InLE6tN7aSGGfKAsHKcKqGwrjCSEC4ATS6g5y0Sk9km4L_2q9n7MOHE0gSNIsYKxjbV5ub_yHnjIdEWWBjaXqFxW5t2YFyuguBENj-zZwNOa3sNCk/s1600/next+costume.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwqvd8bbd0RBEZ-9EIwk4vAnEGx_InLE6tN7aSGGfKAsHKcKqGwrjCSEC4ATS6g5y0Sk9km4L_2q9n7MOHE0gSNIsYKxjbV5ub_yHnjIdEWWBjaXqFxW5t2YFyuguBENj-zZwNOa3sNCk/s1600/next+costume.png" width="588" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Your script now should look like below</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgChbaqgCpo5elhZ9Klnkwg95ooEhFroHtkkYjySbzG7sWGsWMotBpKBPcA4YBcpPcH1hiXUeoCfZJ5GQEa1KwwOKu4EHCJZMf-SbvjXJQbGc5WFwvAiJ4GvuREpRRK5W2ISItN5vmY7UU/s1600/complete.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgChbaqgCpo5elhZ9Klnkwg95ooEhFroHtkkYjySbzG7sWGsWMotBpKBPcA4YBcpPcH1hiXUeoCfZJ5GQEa1KwwOKu4EHCJZMf-SbvjXJQbGc5WFwvAiJ4GvuREpRRK5W2ISItN5vmY7UU/s1600/complete.png" width="332" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">By now, the sprite should look more vibrant, “walking”
back and forth the Stage Area.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><br /></span></span>
<span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;">Here's a good video tutorial </span></span><a href="http://www.youtube.com/watch?v=pkhjX792yVI">http://www.youtube.com/watch?v=pkhjX792yVI</a> to help you started.</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/05605261175282274646noreply@blogger.com0tag:blogger.com,1999:blog-8054185149631393631.post-80166319714257212502013-12-16T16:56:00.002+08:002014-02-04T13:56:17.749+08:00Physical Computing with Scratch and Arduino<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background: white; color: #444444;">In my previous post, I briefly touched on the 21<sup>st</sup> Century
Learning paradigm and Scratch, a visual block based programming tool developed </span><span style="background: white; color: #2e3030;">by a
collaboration between elementary educators and MIT computer science scholars</span><span style="background: white; color: #444444;"> (oh…..did
I say Scratch is free ??). </span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background: white; color: #444444;">Since its inception in 2007, their web site has
become a vibrant online community with (reportedly) more than a million Scratchers
worldwide sharing and remixing their projects. Check out their site at </span><a href="http://scratched.media.mit.edu/">http://scratched.media.mit.edu/</a>, there
are tons of information to learn and share.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background: white; color: #444444;">A number of derivatives has emerged with added features that was not
available in Scratch. The most popular being SNAP, developed by Jens Mönig of University
of California, Berkeley. </span><span style="background-color: white; color: #444444; line-height: 107%;">It’s a web-based application though, might not
be favourable or suitable to those with connectivity issues</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: #444444; font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: #444444;">Next development well-worth mentioning created by Citilab from Spain, is
<b>S4A</b>, short for “<b>Scratch for Arduino</b>”. </span><span style="background-color: white;">It provides new blocks for managing sensors and
actuators connected to Arduino micro controller.<o:p></o:p></span></span></div>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;">With its pins mostly assigned to its specific function, it doesn’t
provide any flexibility at all. But hey, what more do you expect ??? It’s free and a good start for beginners. </span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: #444444;"> For those who likes to get physical (definitely
<b>NOT</b> with Olivia Newton-John), <b>S4A</b> is
absolutely right up your alley. <o:p></o:p></span></span></div>
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, Helvetica, sans-serif;"><span style="color: #444444;">Scratch and Arduino practically equates to </span><b><span style="color: blue;">Physical Computing</span></b><span style="color: #444444;"> !!!</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: #444444; font-family: "Arial","sans-serif";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8w8He6iXBhue6CoeM14HCDYZ5t0HqFuP4U7WSUtV6vFW89uwZu9CqioIJy5ZiAvYqIh9-Xqad2dUWpWxgjvxrHNdvsy4PtFCz2hvJV0vogcmbT57YxrWY458VOsyB-G5D0plfJ-BMzuc/s1600/Picture1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8w8He6iXBhue6CoeM14HCDYZ5t0HqFuP4U7WSUtV6vFW89uwZu9CqioIJy5ZiAvYqIh9-Xqad2dUWpWxgjvxrHNdvsy4PtFCz2hvJV0vogcmbT57YxrWY458VOsyB-G5D0plfJ-BMzuc/s1600/Picture1.png" height="409" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: #444444; font-family: "Arial","sans-serif";">More about Scratch coming up soon, where I’ll go through a short
tutorial and some projects from there on.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: #444444; font-family: "Arial","sans-serif";">Happy Scratching.<o:p></o:p></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/05605261175282274646noreply@blogger.com0tag:blogger.com,1999:blog-8054185149631393631.post-1796223912572785782013-12-12T17:49:00.005+08:002013-12-14T05:32:29.172+08:00Let's start Scratching<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3.6pt; vertical-align: baseline;">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: whitesmoke; font-family: "Arial","sans-serif";">There
are many commercially available software in the market today purportedly
claimed to provide computing skills to young learners, as a matter of fact, it
is nothing more than just another captivating game to test their cognitive
reflexes or a pre-designed program to teach what is “1 + 1”. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: whitesmoke; font-family: "Arial","sans-serif";">The
concept of teaching computing skills to kids with coding and scripting is a
challenge, and I would say almost impossible. The insipid language and
frustrating syntax itself will drive them away, let alone creating interest in
them.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: whitesmoke; font-family: "Arial","sans-serif";">Having
said, how do we initiate kids to embrace programming interest without daunting
them with all the programming jargons
?? It might not be conceivable
30 years ago, but with today’s technology, it is feasible with the development
of 21<sup>st</sup> century learning skills and tools. If you google what <b>21<sup>st</sup> Century Learning</b> is
about, the learning paradigm generally refers to the 3Cs. No…….I’m not talking
about Cash, Cars and Condominium. It’s all about</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<ul>
<li><span style="background-color: whitesmoke; font-family: Arial, sans-serif;">Creativity
& Innovation</span></li>
<li><span style="background-color: whitesmoke; font-family: Arial, sans-serif;">Critical
thinking and problem solving</span></li>
<li><span style="background-color: whitesmoke; font-family: Arial, sans-serif;">Communication
and Collaboration</span></li>
</ul>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: whitesmoke; font-family: "Arial","sans-serif";">Coming
back to computing for kids, Lifelong Kindergarten Group of MIT has developed an
educational software program, called <b>Scratch</b>, that supports the </span><span style="font-family: "Arial","sans-serif"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-MY;">nine types of 21st century learning skills
identified by the <b>Partnership for the 21st Century</b> (</span><a href="http://www.p21.org/"><span style="color: windowtext; font-family: "Arial","sans-serif"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-MY; text-decoration: none; text-underline: none;">http://www.p21.org</span></a><span style="font-family: "Arial","sans-serif"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-MY;">). These skills include:</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<ul>
<li><span style="font-family: Arial, sans-serif;">thinking creatively</span></li>
<li><span style="font-family: Arial, sans-serif;">communicating clearly</span></li>
<li><span style="font-family: Arial, sans-serif;">analyzing systematically</span></li>
<li><span style="font-family: Arial, sans-serif;">collaborating effectively</span></li>
<li><span style="font-family: Arial, sans-serif;">designing iteratively, and</span></li>
<li><span style="font-family: Arial, sans-serif;">learning continuously</span></li>
</ul>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: whitesmoke; font-family: "Arial","sans-serif";">What
is <b>Scratch</b> anyway ?? <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: whitesmoke; font-family: "Arial","sans-serif";"><b>Scratch</b>
is a visual block-based programming tool where you snap together programs from
logical building blocks that is dragged over from the blocks palette.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: whitesmoke; font-family: "Arial","sans-serif";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzjRARMYrdn3z2QpPyrH32WaJHXcuvDg7xPwzmlAaWimuDWDphHjhf5CJ3ydO1LdhK2WRxTMgwJ-neHfcNsaz_4FLKvI-L86w2X5fTwwV4YV2hGp3JbEzh4gJ75b-JpxkznL8xRc56qls/s1600/Scratch.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzjRARMYrdn3z2QpPyrH32WaJHXcuvDg7xPwzmlAaWimuDWDphHjhf5CJ3ydO1LdhK2WRxTMgwJ-neHfcNsaz_4FLKvI-L86w2X5fTwwV4YV2hGp3JbEzh4gJ75b-JpxkznL8xRc56qls/s1600/Scratch.JPG" height="454" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: whitesmoke; font-family: "Arial","sans-serif";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: whitesmoke; font-family: "Arial","sans-serif";"></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif;"><b>Scratch</b> covers a range of educational and entertainment <span style="color: blue;">constructivist</span> </span><span style="font-family: "Arial","sans-serif";">projects from <span style="color: blue;">maths</span><span class="apple-converted-space"><span style="background-position: initial initial; background-repeat: initial initial;"> </span></span>and <span style="color: blue;">science</span>, including <span style="color: blue;">simulations</span> and
<span style="color: blue;">visualizations</span> of experiments, recording lectures with animated presentations,
to social sciences animated
stories, and <span style="color: blue;">interactive</span> art<span class="apple-converted-space"><span style="background-position: initial initial; background-repeat: initial initial;"> </span></span>and
music.<span style="background: whitesmoke; color: #222222;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Arial","sans-serif";"><span style="background-position: initial initial; background-repeat: initial initial;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, sans-serif;">How is it possible for parents (or teachers) who has no programming experience, teach their kids at home ??? As Scratch is developed to support one of the 3Cs mentioned earlier, you can join the Scratch Community where you can share and learn from the community. Bear in mind that there are more than a million Scratch users around the globe, and more than 3 million projects uploaded to the web, readily to be shared. </span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, sans-serif;">I will also post some tutorials and projects as time goes, this is exactly what this blog is about.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Arial, sans-serif;">In my next post, I'll talk about physical programming. </span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/05605261175282274646noreply@blogger.com0Kuala Lumpur, Federal Territory of Kuala Lumpur, Malaysia3.139003 101.686854999999922.885326 101.36413149999993 3.3926800000000004 102.00957849999992