<project name="dragon_curve_iterative" app="Snap! 4.0, http://snap.berkeley.edu" version="1"><notes/><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAHUUlEQVR4nO2dP48TRxiH74vQpYzgC1BSpWGvgEOUdPwz3B3GKCdFJzoO0cQoQsh3iJWQErG+xg3VdQgnTpCuwL47WSF0V6QgsSIXtviliNYZr2fHY3u9787u75HcjHe9s9Lj2XnnfcdeAYDBYIBer5faq9/vgxAAWAGAXq+Hbreb2uv09FT6vklGMAp4eHhoFKl3/8zYq/9jCf2f1ifae/fPUECiRSvg5cuXcXJygkuXLuHq1avodDq4du0a9vf3R+/pBBweHWD4+88UkFijFfDx48dotVp4/vw53rx5gw8fPuDJkye4ffv26D2tgB9/wfBjiwISa6zngOGoZ3oEm14UkOhYKAj584crVvL99d3XFJBoWQGAfr+P09PT1F6fP3+Wvm+SEUSWYbhcQ0JSEfDvb7/iXJFo0Qp47949dLtdrK2toVKpoNvtolar4fj4eHTM+/fvR++9evUKnU4HDx48QKPRwNraGnZ3d3F0dKQNVga/1SkgARAjoOd56HQ6qNfruHv3Lt69e4e3b99idXV1TMDwvcPDQ2xvb+Pk5AQ7Ozuo1+totVrY2dnRCvjP999g+MevFJDoBdzc3ES320W5XB6Nhi9evBhbimm326P3jo+Psb+/j+vXr+PZs2col8tot9toNBpcriFGOAckojAKJqKsSHeAFBsKSEShgEQUCkhEoYBEFApIRKGAKdJsNuH7PprNJgDA931Uq9Wp56nHPX36FL7vL7WfaUIBU6RerwMAXr58OdE2z7l5gAKmSLPZRBAEKJVKCIIAQRBgY2MDQRAYR8IgCLC+vj5x7sOHD1Ps/XKggALoRsBpI9sio2eWoYBLJgnZvnz5kgvZdFDAJVMul+H7Pnzfx61bt+D7Pm7cuGEMJGq12thxvu+jVCqNBTB5gQKmyKyBxDyjp2tQwJRQAw5dILG1tYUgCAAAu7u7CIIAd+7cGR23ubk5dq56XBjAuBiYUMAUMQUSSbe5gv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cmNEpGrkWEJg9MJl2nOka8wQmuuOKRC4FTOqHHWctUJh2DRYjTJJLAdWMhG35VPQxqyvH0qFmPXTlXaZMCODeT+omTS4FVGHAkW1yKaBtRkIt5Zo3IxGX4TBdt6ilVzpyKWDaIxHzvvOTSwF1mDaDJ10qZfu/HqQAAqb5fyK2/+tR1IBDR+4FTHPtLallnSKRewFNey6S/n8N2//1IP+TewFJtqGARBQKSEShgEQUCkhEoYBEFApIRKGARBQKSEShgEQUCkhEoYBEFApIRKGARBQKSEShgEQUCkhEoYBEFApIRKGARBQKSEShgEQUCkhEoYBEFApIRKGARBQKSEShgEQUCkhEoYBEFApIRKGARBQKSEShgEQUCkhEoYBEFApIRKGARBQKSEShgEQUCkhEoYBEFApIRKGARBQKSEShgESUfwFp3gDnlP+g0QAAAABJRU5ErkJggg==</thumbnail><stage name="Stage" width="480" height="360" costume="0" tempo="60" threadsafe="false" lines="round" codify="false" scheduled="false" id="1"><pentrails>data:image/png;base64,[encoded data, 4404 characters]</pentrails><costumes><list id="2"/></costumes><sounds><list id="3"/></sounds><variables/><blocks/><scripts/><sprites><sprite name="Sprite" idx="1" x="-70" y="60" heading="0" scale="1" rotation="1" draggable="true" costume="0" color="80,80,80" pen="tip" id="8"><costumes><list id="9"/></costumes><sounds><list id="10"/></sounds><variables/><blocks/><scripts><script x="28" y="18"><block s="receiveGo"/><block s="doSetVar"><l>steps</l><l>1000</l></block><block s="doSetVar"><l>step_length</l><l>5</l></block><block s="up"/><block s="clear"/><block s="gotoXY"><l>100</l><l>70</l></block><block s="setHeading"><l>0</l></block><block s="down"/><block s="doRepeat"><block var="steps"/><script><block s="forward"><block var="step_length"/></block><block s="doIfElse"><block s="reportEquals"><custom-block s="%n &amp; %n"><custom-block s="%n &lt;&lt; %n"><custom-block s="%n &amp; %n"><block var="steps"/><block s="reportProduct"><l>-1</l><block var="steps"/></block></custom-block><l>1</l></custom-block><block var="steps"/></custom-block><l>0</l></block><script><block s="turn"><l>90</l></block></script><script><block s="turnLeft"><l>90</l></block></script><comment w="203" collapsed="false">Uses bitwise operations to figure out which direction to take.

See "(Un)Folding the Dragon" on Wikipedia's page on the Dragon Curve for more details.</comment></block><block s="doChangeVar"><l>steps</l><l>-1</l></block></script></block></script><script x="336" y="421"><custom-block s="%n &lt;&lt; %n"><l/><l/><comment w="207" collapsed="false">Thanks to (snapusername) "DigiTechs" for the bitwise and/or and bitshifting operators based on javascript function calls
</comment></custom-block></script><script x="336" y="442"><custom-block s="%n &amp; %n"><l/><l/></custom-block></script><comment x="415" y="21" w="204" collapsed="false">DRAGON CURVE ITERATIVE

An iterative Example of generating a Dragon Curve.
</comment></scripts></sprite><watcher var="steps" style="normal" x="5" y="2.00000399999999" color="243,118,29"/><watcher var="step_length" style="normal" x="5" y="24.00000799999998" color="243,118,29"/><watcher scope="Stage" s="getLastMessage" style="normal" x="10" y="10" color="230,168,34" hidden="true"/></sprites></stage><hidden/><headers/><code/><blocks><block-definition s="%'one' &lt;&lt; %'two'" type="reporter" category="operators"><header/><code/><inputs><input type="%n"/><input type="%n"/></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>a</l><l>b</l></list><l>return a&lt;&lt;b;</l></block><list><block var="one"/><block var="two"/></list></block></block></script></block-definition><block-definition s="%'one' &gt;&gt; %'two'" type="reporter" category="operators"><header/><code/><inputs><input type="%n"/><input type="%n"/></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>a</l><l>b</l></list><l>return a&gt;&gt;b;</l></block><list><block var="one"/><block var="two"/></list></block></block></script></block-definition><block-definition s="%'one' &gt;&gt;&gt; %'two'" type="reporter" category="operators"><header/><code/><inputs><input type="%n"/><input type="%n"/></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>a</l><l>b</l></list><l>return a&gt;&gt;&gt;b;</l></block><list><block var="one"/><block var="two"/></list></block></block></script></block-definition><block-definition s="%'one' &amp; %'two'" type="reporter" category="operators"><header/><code/><inputs><input type="%n"/><input type="%n"/></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>a</l><l>b</l></list><l>return a&amp;b;</l></block><list><block var="one"/><block var="two"/></list></block></block></script></block-definition><block-definition s="%'one' | %'two'" type="reporter" category="operators"><header/><code/><inputs><input type="%n"/><input type="%n"/></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>a</l><l>b</l></list><l>return a|b;</l></block><list><block var="one"/><block var="two"/></list></block></block></script></block-definition></blocks><variables><variable name="steps"><l>0</l></variable><variable name="step_length"><l>5</l></variable></variables></project>