<snapdata remixID="10172461"><project name="U5L3-TimingAlgorithms" app="Snap! 6, https://snap.berkeley.edu" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAADxElEQVR4Xu3YPUqjARCA4Ykiglgo2CgWgqhY+W/jT2dr4Y3W1lPsFTxArqSIjYpkyQe7XZZBdnZAnoDdOEOevMboaDKZTMKDQI/Aj5EAe+RdHQQEKIRWAQG28jsuQA20Cgiwld9xAWqgVUCArfyOC1ADrQICbOV3XIAaaBUQYCu/4wLUQKuAAFv5HRegBloFBNjK77gANdAqIMBWfscFqIFWAQG28jsuQA20Cgiwld9xAWqgVUCArfyOC1ADrQICbOV3XIAaaBUQYCu/4wLUQKuAAFv5HRegBloFBNjK77gANdAqIMBWfscFqIFWAQG28jsuQA20Cgiwld9xAWqgVUCArfyOC1ADrQICbOV3XIAaaBUQYCu/4wLUQKuAAFv5HRegBloFBNjK77gANdAqIMBWfscFqIFWAQG28jsuQA20Cgiwld9xAWqgVUCAs/g/Pz9jbm4uRqNR6yv0zY8LcNYLfHd3FwcHB3F9fR1nZ2exvLz8zVtoeXoCnMV+fHwcGxsb8fz8HG9vb7G9vR2np6dxdXUVh4eHsbi42PKKfbOjApz1gt7f38d4PI7V1dVhZDKZxPv7ezw9PQ2/lnd3d+Py8nL42tnZifn5+W/Wxn95OgKcxfzw8BCPj4+xtrb2Z2Qa4PQdcfrY2tqK8/PzuLm5ib29PQF+rVcBznI7OTmJ9fX1eHl5iY+Pj9jc3Bw+E07f8Y6OjmJpaSkWFha+xu67fgsIcFYLt7e3sb+/HxcXF8M73crKyvC5z1/F//SnR4CzOF9fX4d3uem/YjzKBARYRmtxRkCAGSUzZQICLKO1OCMgwIySmTIBAZbRWpwREGBGyUyZgADLaC3OCAgwo2SmTECAZbQWZwQEmFEyUyYgwDJaizMCAswomSkTEGAZrcUZAQFmlMyUCQiwjNbijIAAM0pmygQEWEZrcUZAgBklM2UCAiyjtTgjIMCMkpkyAQGW0VqcERBgRslMmYAAy2gtzggIMKNkpkxAgGW0FmcEBJhRMlMmIMAyWoszAgLMKJkpExBgGa3FGQEBZpTMlAkIsIzW4oyAADNKZsoEBFhGa3FGQIAZJTNlAgIso7U4IyDAjJKZMgEBltFanBEQYEbJTJmAAMtoLc4ICDCjZKZMQIBltBZnBASYUTJTJiDAMlqLMwICzCiZKRMQYBmtxRkBAWaUzJQJCLCM1uKMgAAzSmbKBARYRmtxRkCAGSUzZQICLKO1OCMgwIySmTIBAZbRWpwREGBGyUyZgADLaC3OCAgwo2SmTGAIcFy23mICfxf4+QthdlQOAp0BzgAAAABJRU5ErkJggg==</thumbnail><stage name="Stage" width="480" height="360" costume="0" color="255,255,255,1" tempo="60" threadsafe="false" penlog="false" volume="100" pan="0" lines="round" ternary="true" hyperops="true" codify="false" inheritance="false" sublistIDs="false" scheduled="false" id="1"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAOhUlEQVR4Xu3VwQkAAAjEMN1/abewn7jAQRC64wgQIECAAIF3gX1fNEiAAAECBAiMAHsCAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQIHLFxAWmhEwHPAAAAAElFTkSuQmCC</pentrails><costumes><list struct="atomic" id="2"></list></costumes><sounds><list struct="atomic" id="3"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites><sprite name="Sprite" idx="1" x="1.9421509282425164" y="-2.642415210184365" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="80,80,80,1" pen="tip" id="8"><costumes><list struct="atomic" id="9"></list></costumes><sounds><list struct="atomic" id="10"></list></sounds><blocks></blocks><variables></variables><scripts><script x="79.76683937823822" y="327.7979274611397"><custom-block s="add numbers 1 to %s using combine"><l></l></custom-block></script><script x="80.28497409326422" y="350.2590673575128"><custom-block s="add numbers 1 to %s using math trick"><l></l></custom-block></script><script x="59.94818652849733" y="273.04186599522995"><custom-block s="time function %repRing"><block s="reifyReporter"><script></script><list></list></block></custom-block></script><comment x="21.398963730569932" y="10" w="315.38860103626945" collapsed="false">Use this &quot;list from x through y&quot; block to build the following blocks: </comment><script x="91.28538781526208" y="302.23794442660244"><custom-block s="add numbers 1 to %s using for"><l></l></custom-block></script><script x="10.30499565839932" y="65.94382677954368"><custom-block s="1000 numbers starting from %s"><l></l></custom-block></script><script x="293.8736231093797" y="67.51245423052407"><custom-block s="all %s digit numbers"><l></l></custom-block></script><comment x="10" y="192.901554404145" w="435.07772020725395" collapsed="false">Use the &quot;time function&quot; block to determine which algorithms (from above and below) can be executed in &quot;reasonable time&quot;.  &#xD;Also, run the &quot;time function&quot; multiple times on all the algorithms to determine if they are constant, linear, quadratic, cubic, exponential, or log time.</comment><comment x="14.145077720207269" y="103.26424870466329" w="495.18134715025906" collapsed="false">Also make a factorial block.</comment><script x="132.46185840349733" y="163.04186599522993"><custom-block s="factorial of %s"><l></l></custom-block></script><script x="51" y="707.1333333333331"><block s="doSetVar"><l>sorted list</l><custom-block s="numbers from %n to %n"><l>1</l><l></l></custom-block></block></script><script x="49" y="605.1333333333331"><block s="doSetVar"><l>randomList</l><block s="reportNewList"><list></list></block></block><block s="doRepeat"><l>200</l><script><block s="doAddToList"><block s="reportRandom"><l>1</l><l>100000</l></block><block var="randomList"/></block></script></block></script><script x="43.078431372549005" y="533.6666666666665"><custom-block s="distance between %s %s %s %s"><l>4</l><l>5</l><l>3</l><l>2</l><comment w="247" collapsed="false">Enter in X1, Y1, X2, Y2 Coordinates. Please do not use parentheses. Ex. (4,5) (3,2) --&gt; 4 5 3 2</comment></custom-block></script><script x="34.94818652849733" y="480.8751993285632"><custom-block s="position of number %s in unsorted list %s of size %s"><l>0</l><block var="randomList"/><l></l><comment w="90" collapsed="true">keep the &quot;position of number&quot; = 0. Change the &quot;size&quot; and put in your chart.</comment></custom-block></script><script x="32.46185840349733" y="411.04186599522984"><custom-block s="matching %s"><l></l><comment w="208" collapsed="true">Just enter a number here - this algorithm is often used to see if there are duplicates. It has been modified to never have a duplicate so we can have accurate timings when run.</comment></custom-block></script><script x="33.94818652849733" y="452.8751993285633"><custom-block s="position of number %s in sorted list %s of size %s"><l>0</l><block var="sorted list"/><l></l><comment w="90" collapsed="true">keep the &quot;position of number&quot; = 0. Change the &quot;size&quot; and put in your chart.</comment></custom-block></script></scripts></sprite><watcher var="randomList" style="normal" x="-0.8005076197623566" y="0.11413990346572689" color="243,118,29" hidden="true"/><watcher var="sorted list" style="normal" x="0.3119020478584389" y="0.10968935550565817" color="243,118,29" hidden="true"/></sprites></stage><hidden></hidden><headers></headers><code></code><blocks><block-definition s="map %&apos;function&apos; over %&apos;lists&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%mult%l"></input></inputs><script><block s="doWarp"><script><block s="doDeclareVariables"><list><l>mapone</l><l>mapmany</l></list></block><block s="doSetVar"><l>mapone</l><block s="reifyScript"><script><block s="doIf"><custom-block s="empty? %l"><block var="data"/></custom-block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doReport"><block s="reportCONS"><block s="evaluate"><block var="function"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><block s="evaluate"><block var="mapone"/><list><block s="reportCDR"><block var="data"/></block></list></block></block></block></script><list><l>data</l></list></block></block><block s="doSetVar"><l>mapmany</l><block s="reifyScript"><script><block s="doIf"><custom-block s="empty? %l"><block s="reportListItem"><l>1</l><block var="data lists"/></block></custom-block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doReport"><block s="reportCONS"><block s="evaluate"><block var="function"/><custom-block s="map %repRing over %mult%l"><block s="reifyReporter"><autolambda><block s="reportListItem"><l>1</l><l/></block></autolambda><list></list></block><list><block var="data lists"/></list></custom-block></block><block s="evaluate"><block var="mapmany"/><list><custom-block s="map %repRing over %mult%l"><block s="reifyReporter"><autolambda><block s="reportCDR"><l/></block></autolambda><list></list></block><list><block var="data lists"/></list></custom-block></list></block></block></block></script><list><l>data lists</l></list></block></block><block s="doIfElse"><custom-block s="empty? %l"><block s="reportCDR"><block var="lists"/></block></custom-block><script><block s="doReport"><block s="evaluate"><block var="mapone"/><list><block s="reportListItem"><l>1</l><block var="lists"/></block></list></block></block></script><script><block s="doReport"><block s="evaluate"><block var="mapmany"/><list><block var="lists"/></list></block></block></script></block></script></block></script></block-definition><block-definition s="tell %&apos;sprite&apos; to %&apos;action&apos;" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%s">Sprite</input><input type="%cs"></input></inputs><script><block s="doRun"><block s="reportAttributeOf"><block var="action"/><block var="sprite"/></block><list></list></block></script></block-definition><block-definition s="ask %&apos;sprite&apos; for %&apos;expression&apos;" type="reporter" category="control"><header></header><code></code><translations></translations><inputs><input type="%s">Sprite</input><input type="%repRing"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportAttributeOf"><block var="expression"/><block var="sprite"/></block><list></list></block></block></script></block-definition><block-definition s="list from %&apos;min&apos; through %&apos;max&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doIfElse"><block s="reportGreaterThan"><block var="min"/><block var="max"/></block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script><script><block s="doReport"><block s="reportCONS"><block var="min"/><custom-block s="list from %s through %s"><block s="reportSum"><block var="min"/><l>1</l></block><block var="max"/></custom-block></block></block></script></block></script></block-definition><block-definition s="1000 numbers starting from %&apos;num&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doReport"><custom-block s="list from %s through %s"><block var="num"/><block s="reportSum"><block var="num"/><l>1000</l></block></custom-block></block></script></block-definition><block-definition s="all %&apos;num&apos; digit numbers" type="reporter" category="lists"><comment x="0" y="0" w="90" collapsed="true">The list of 2-digit numbers goes from 10 to 99. There&apos;s a math operations block that can give you powers of 10. You don&apos;t need to include zero in 1 digit numbers.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doReport"><custom-block s="list from %s through %s"><block s="reportPower"><l>10</l><block s="reportDifference"><block var="num"/><l>1</l></block></block><block s="reportDifference"><block s="reportPower"><l>10</l><block var="num"/></block><l>1</l></block></custom-block></block></script></block-definition><block-definition s="time function %&apos;function&apos;" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input></inputs><script><block s="doDeclareVariables"><list><l>start time</l></list></block><block s="doSetVar"><l>start time</l><block s="reportDate"><l><option>time in milliseconds</option></l></block></block><custom-block s="ignore %s"><block s="evaluate"><block var="function"/><list></list></block></custom-block><block s="doReport"><block s="reportDifference"><block s="reportDate"><l><option>time in milliseconds</option></l></block><block var="start time"/></block></block></script></block-definition><block-definition s="label %&apos;text&apos; of size %&apos;size&apos;" type="command" category="pen"><comment x="0" y="0" w="90" collapsed="false">LABEL will stamp text on the stage at the given font size. The direction of the text is the direction the sprite is facing, and color will match the pen color.</comment><header></header><code></code><translations></translations><inputs><input type="%txt">Hello!</input><input type="%n">12</input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>text</l><l>size</l></list><l>var stage = this.parentThatIsA(StageMorph),&#xD;    context = stage.penTrails().getContext(&apos;2d&apos;),&#xD;    rotation = radians(this.direction() - 90),&#xD;    trans = new Point(&#xD;      this.center().x - stage.left(),&#xD;      this.center().y - stage.top()&#xD;    ),&#xD;    isWarped = this.Warped,&#xD;    len,&#xD;    pos;&#xD;&#xD;if (isWarped) {endWarp(); }&#xD;context.save();&#xD;context.font = size + &apos;px monospace&apos;;&#xD;context.textAlign = &apos;left&apos;;&#xD;context.textBaseline = &apos;alphabetic&apos;;&#xD;context.fillStyle = this.color.toString();&#xD;len = context.measureText(text).width;&#xD;trans = trans.multiplyBy(1 / stage.scale);&#xD;context.translate(trans.x, trans.y);&#xD;context.rotate(rotation);&#xD;context.fillText(text, 0, 0);&#xD;context.translate(-trans.x, -trans.y);&#xD;context.restore();&#xD;pos = new Point(&#xD;  len * Math.sin(radians(this.direction())),&#xD;  len * Math.cos(radians(this.direction())));&#xD;pos = pos.add(new Point(this.xPosition(), this.yPosition()));&#xD;this.gotoXY(pos.x, pos.y, false);&#xD;this.changed();&#xD;if (isWarped) {this.startWarp(); }&#xD;stage.changed();</l></block><list><block var="text"/><block var="size"/></list></block></script></block-definition><block-definition s="empty? %&apos;data&apos;" type="predicate" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportEquals"><block var="data"/><block s="reportNewList"><list></list></block></block></block></script></block-definition><block-definition s="keep items such that %&apos;pred&apos; from %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%predRing"></input><input type="%l"></input></inputs><script><block s="doWarp"><script><block s="doIf"><custom-block s="empty? %l"><block var="data"/></custom-block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doIfElse"><block s="evaluate"><block var="pred"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><script><block s="doReport"><block s="reportCONS"><block s="reportListItem"><l>1</l><block var="data"/></block><custom-block s="keep items such that %predRing from %l"><block var="pred"/><block s="reportCDR"><block var="data"/></block></custom-block></block></block></script><script><block s="doReport"><custom-block s="keep items such that %predRing from %l"><block var="pred"/><block s="reportCDR"><block var="data"/></block></custom-block></block></script></block></script></block></script></block-definition><block-definition s="combine with %&apos;function&apos; items of %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doWarp"><script><block s="doIf"><custom-block s="empty? %l"><block s="reportCDR"><block var="data"/></block></custom-block><script><block s="doReport"><block s="reportListItem"><l>1</l><block var="data"/></block></block></script></block><block s="doReport"><block s="evaluate"><block var="function"/><list><block s="reportListItem"><l>1</l><block var="data"/></block><custom-block s="combine with %repRing items of %l"><block var="function"/><block s="reportCDR"><block var="data"/></block></custom-block></list></block></block></script></block></script></block-definition><block-definition s="if %&apos;test&apos; then %&apos;true&apos; else %&apos;false&apos;" type="reporter" category="control"><header></header><code></code><translations></translations><inputs><input type="%b"></input><input type="%anyUE"></input><input type="%anyUE"></input></inputs><script><block s="doIfElse"><block var="test"/><script><block s="doReport"><block s="evaluate"><block var="true"/><list></list></block></block></script><script><block s="doReport"><block s="evaluate"><block var="false"/><list></list></block></block></script></block></script></block-definition><block-definition s="for %&apos;i&apos; = %&apos;start&apos; to %&apos;end&apos; %&apos;action&apos;" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%n">1</input><input type="%n">10</input><input type="%cs"></input></inputs><script><block s="doDeclareVariables"><list><l>step</l><l>tester</l></list></block><block s="doIfElse"><block s="reportGreaterThan"><block var="start"/><block var="end"/></block><script><block s="doSetVar"><l>step</l><l>-1</l></block><block s="doSetVar"><l>tester</l><block s="reifyReporter"><autolambda><block s="reportLessThan"><block var="i"/><block var="end"/></block></autolambda><list></list></block></block></script><script><block s="doSetVar"><l>step</l><l>1</l></block><block s="doSetVar"><l>tester</l><block s="reifyReporter"><autolambda><block s="reportGreaterThan"><block var="i"/><block var="end"/></block></autolambda><list></list></block></block></script></block><block s="doSetVar"><l>i</l><block var="start"/></block><block s="doUntil"><block s="evaluate"><block var="tester"/><list></list></block><script><block s="doRun"><block var="action"/><list></list></block><block s="doChangeVar"><l>i</l><block var="step"/></block></script></block></script></block-definition><block-definition s="join words %&apos;words&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doWarp"><script><block s="doIf"><custom-block s="empty? %l"><block s="reportCDR"><block var="words"/></block></custom-block><script><block s="doReport"><block s="reportListItem"><l>1</l><block var="words"/></block></block></script></block><block s="doIf"><block s="reportEquals"><l></l><block s="reportListItem"><l>1</l><block var="words"/></block></block><script><block s="doReport"><custom-block s="join words %mult%txt"><block s="reportCDR"><block var="words"/></block></custom-block></block></script></block><block s="doIf"><block s="reportEquals"><l></l><block s="reportListItem"><l>2</l><block var="words"/></block></block><script><block s="doReport"><custom-block s="join words %mult%txt"><block s="reportCONS"><block s="reportListItem"><l>1</l><block var="words"/></block><block s="reportCDR"><block s="reportCDR"><block var="words"/></block></block></block></custom-block></block></script></block><block s="doReport"><block s="reportJoinWords"><list><block s="reportListItem"><l>1</l><block var="words"/></block><l> </l><custom-block s="join words %mult%txt"><block s="reportCDR"><block var="words"/></block></custom-block></list></block></block></script></block></script><scripts><script x="229.00000299999996" y="196.77778077777774"><block s="reportJoinWords"><list><l></l><l></l></list></block></script></scripts></block-definition><block-definition s="list $arrowRight sentence %&apos;data&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doWarp"><script><block s="doReport"><custom-block s="join words %mult%txt"><block var="data"/></custom-block></block></script></block></script></block-definition><block-definition s="sentence $arrowRight list %&apos;text&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doWarp"><script><block s="doReport"><block s="reportTextSplit"><block var="text"/><l><option>whitespace</option></l></block></block></script></block></script></block-definition><block-definition s="catch %&apos;tag&apos; %&apos;action&apos;" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="doCallCC"><block s="reifyScript"><script><block s="doSetVar"><l>tag</l><block var="cont"/></block><block s="doRun"><block var="action"/><list></list></block></script><list><l>cont</l></list></block></block><custom-block s="ignore %s"><l>3</l></custom-block></script></block-definition><block-definition s="throw %&apos;cont&apos;" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%s">catchtag</input></inputs><script><block s="doRun"><block var="cont"/><list></list></block></script></block-definition><block-definition s="catch %&apos;tag&apos; %&apos;value&apos;" type="reporter" category="control"><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%anyUE"></input></inputs><script><block s="doCallCC"><block s="reifyScript"><script><block s="doSetVar"><l>tag</l><block var="cont"/></block><block s="doReport"><block s="evaluate"><block var="value"/><list></list></block></block></script><list><l>cont</l></list></block></block></script></block-definition><block-definition s="throw %&apos;tag&apos; %&apos;value&apos;" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%s">catchtag</input><input type="%s"></input></inputs><script><block s="doRun"><block var="tag"/><list><block var="value"/></list></block></script></block-definition><block-definition s="for each %&apos;item&apos; of %&apos;data&apos; %&apos;action&apos;" type="command" category="lists"><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%l"></input><input type="%cs"></input></inputs><script><block s="doUntil"><custom-block s="empty? %l"><block var="data"/></custom-block><script><block s="doSetVar"><l>item</l><block s="reportListItem"><l>1</l><block var="data"/></block></block><block s="doRun"><block var="action"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><block s="doSetVar"><l>data</l><block s="reportCDR"><block var="data"/></block></block></script></block></script></block-definition><block-definition s="if %&apos;test&apos; do %&apos;action&apos; and pause all $pause-1-255-220-0" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%boolUE"></input><input type="%cs"></input></inputs><script><block s="doDeclareVariables"><list><l>breakpoint</l></list></block><block s="doIf"><block s="evaluate"><block var="test"/><list></list></block><script><block s="doSetVar"><l>breakpoint</l><block var="test"/></block><block s="doShowVar"><l>breakpoint</l></block><block s="doRun"><block var="action"/><list></list></block><block s="doPauseAll"></block><block s="doHideVar"><l></l></block></script></block></script></block-definition><block-definition s="word $arrowRight list %&apos;word&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doWarp"><script><block s="doReport"><block s="reportTextSplit"><block var="word"/><l><option>letter</option></l></block></block></script></block></script></block-definition><block-definition s="ignore %&apos;x&apos;" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs></block-definition><block-definition s="list $arrowRight word %&apos;list&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doWarp"><script><block s="doReport"><block s="reportJoinWords"><block var="list"/></block></block></script></block></script></block-definition><block-definition s="%&apos;x&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doReport"><block var="x"/></block></script></block-definition><block-definition s="numbers from %&apos;from&apos; to %&apos;to&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%n">1</input><input type="%n">10</input></inputs><script><block s="doIf"><block s="reportGreaterThan"><block var="from"/><block var="to"/></block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doReport"><block s="reportCONS"><block var="from"/><custom-block s="numbers from %n to %n"><block s="reportSum"><block var="from"/><l>1</l></block><block var="to"/></custom-block></block></block></script></block-definition><block-definition s="map %&apos;func&apos; over %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="empty? %l"><block var="data"/></custom-block><script><block s="doReport"><block var="data"/></block></script></block><block s="doReport"><block s="reportCONS"><block s="evaluate"><block var="func"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><custom-block s="map %repRing over %l"><block var="func"/><block s="reportCDR"><block var="data"/></block></custom-block></block></block></script></block-definition><block-definition s="add numbers 1 to %&apos;max&apos; using for" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><l>0</l></block><custom-block s="for %upvar = %n to %n %cs"><l>i</l><l>1</l><block var="max"/><script><block s="doChangeVar"><l>a</l><block var="i"/></block></script></custom-block><block s="doReport"><block var="a"/></block></script></block-definition><block-definition s="add numbers 1 to %&apos;max&apos; using combine" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doReport"><custom-block s="combine with %repRing items of %l"><block s="reifyReporter"><autolambda><block s="reportSum"><l></l><l></l></block></autolambda><list></list></block><custom-block s="numbers from %n to %n"><l>1</l><block var="max"/></custom-block></custom-block></block></script></block-definition><block-definition s="add numbers 1 to %&apos;max&apos; using math trick" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doReport"><block s="reportQuotient"><block s="reportProduct"><block var="max"/><block s="reportSum"><block var="max"/><l>1</l></block></block><l>2</l></block></block></script></block-definition><block-definition s="factorial of %&apos;num&apos;" type="reporter" category="operators"><comment x="0" y="0" w="144.5098039215686" collapsed="true">5 factorial -&gt; 5! = 5x4x3x2x1&#xD;You can choose to worry about zero/negative numbers or not </comment><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doIf"><block s="reportEquals"><block var="num"/><l>1</l></block><script><block s="doReport"><l>1</l></block></script></block><block s="doReport"><block s="reportProduct"><block var="num"/><custom-block s="factorial of %s"><block s="reportDifference"><block var="num"/><l>1</l></block></custom-block></block></block></script></block-definition><block-definition s="position of number %&apos;number&apos; in unsorted list %&apos;list&apos; of size %&apos;size&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input><input type="%s"></input></inputs><script><block s="doSetVar"><l>randomList</l><block s="reportNewList"><list></list></block></block><block s="doRepeat"><block var="size"/><script><block s="doAddToList"><block s="reportRandom"><l>1</l><l>100000</l></block><block var="randomList"/><comment w="90" collapsed="true">leave these numbers alone</comment></block></script></block><custom-block s="for %upvar = %n to %n %cs"><l>i</l><l>1</l><block s="reportListLength"><block var="list"/></block><script><block s="doIf"><block s="reportEquals"><block var="number"/><block s="reportListItem"><block var="i"/><block var="list"/></block></block><script><block s="doReport"><block var="i"/></block></script></block></script></custom-block><block s="doReport"><l>NIL</l></block></script></block-definition><block-definition s="position of number %&apos;num&apos; in sorted list %&apos;sorted&apos; of size %&apos;size&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>a</l><l>b</l><l>c</l></list></block><block s="doSetVar"><l>sorted list</l><custom-block s="list from %s through %s"><l>1</l><block var="size"/></custom-block></block><block s="doSetVar"><l>a</l><l>1</l></block><block s="doSetVar"><l>b</l><block s="reportListLength"><block var="sorted"/></block></block><block s="doSetVar"><l>c</l><block s="reportMonadic"><l><option>floor</option></l><block s="reportQuotient"><block s="reportSum"><block var="a"/><block var="b"/></block><l>2</l></block></block></block><block s="doUntil"><block s="reportEquals"><block var="num"/><block s="reportListItem"><block var="c"/><block var="sorted"/></block></block><script><block s="doIf"><block s="reportOr"><block s="reportEquals"><block var="c"/><block var="a"/></block><block s="reportEquals"><block var="c"/><block var="b"/></block></block><script><block s="doReport"><l>NIL</l></block></script></block><block s="doIfElse"><block s="reportLessThan"><block var="num"/><block s="reportListItem"><block var="c"/><block var="sorted"/></block></block><script><block s="doSetVar"><l>b</l><block var="c"/></block><block s="doSetVar"><l>c</l><block s="reportMonadic"><l><option>floor</option></l><block s="reportQuotient"><block s="reportSum"><block var="a"/><block var="b"/></block><l>2</l></block></block></block></script><script><block s="doSetVar"><l>a</l><block var="c"/></block><block s="doSetVar"><l>c</l><block s="reportMonadic"><l><option>floor</option></l><block s="reportQuotient"><block s="reportSum"><block var="a"/><block var="b"/></block><l>2</l></block></block></block></script></block></script></block><block s="doReport"><block var="c"/></block></script></block-definition><block-definition s="matching %&apos;num&apos;" type="reporter" category="control"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>list</l></list></block><block s="doSetVar"><l>list</l><custom-block s="list from %s through %s"><l>0</l><block var="num"/></custom-block></block><block s="doFor"><l>i</l><l>1</l><block s="reportListLength"><block var="list"/></block><script><block s="doFor"><l>j</l><l>1</l><block s="reportListLength"><block var="list"/></block><script><block s="doIf"><block s="reportAnd"><block s="reportNot"><block s="reportEquals"><block var="i"/><block var="j"/></block></block><block s="reportEquals"><block s="reportListItem"><block var="i"/><block var="list"/></block><block s="reportListItem"><block var="j"/><block var="list"/></block></block></block><script><block s="doReport"><custom-block s="join words %mult%txt"><list><l>Match found at </l><block var="i"/><l> </l><block var="j"/></list></custom-block></block></script></block></script></block></script></block><block s="doReport"><l>No match found</l></block></script></block-definition><block-definition s="distance between %&apos;x1&apos; %&apos;y1&apos; %&apos;x2&apos; %&apos;y2&apos;" type="reporter" category="sensing"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input><input type="%s"></input><input type="%s"></input></inputs><script><block s="doReport"><block s="reportMonadic"><l><option>sqrt</option></l><block s="reportSum"><block s="reportPower"><block s="reportDifference"><block var="x1"/><block var="x2"/></block><l>2</l></block><block s="reportPower"><block s="reportDifference"><block var="y1"/><block var="y2"/></block><l>2</l></block></block></block></block></script></block-definition></blocks><variables><variable name="randomList"><list struct="atomic" id="1082">15435,66337,35133,25732,37979,39553,37474,79834,43328,56278,93932,18901,93171,89364,32473,30247,59001,18745,44203,84462,79582,96736,15131,46251,91748,97140,98229,72122,46493,53209,34705,26184,3957,12027,53899,87497,68611,13093,42930,97803,50057,5114,12697,23857,66676,16828,72782,41632,40596,64257,14058,16484,67139,55664,69626,66936,39880,49879,47215,76018,34437,50433,709,2577,79914,70740,74937,46624,12287,49122,67568,8560,59465,23922,83064,92796,76641,40982,28050,28360,50089,72695,77476,96151,15005,19671,27286,97839,37633,53706,51941,17918,51535,70048,20538,28570,24553,55637,95842,21080,28811,94717,66006,83516,99379,87147,76728,89986,2756,85071,83437,67891,25208,1158,45515,96331,4089,89786,31081,97529,855,87528,58341,70209,77901,11396,6368,67310,22814,61725,83904,39053,52866,13431,3685,72420,61730,22138,81729,9580,72574,6135,46729,94335,42434,73083,43247,42352,44548,54289,63849,50716,94475,86700,28624,64136,93495,9473,97673,47692,9977,17853,41955,56456,67835,88354,52309,48056,91344,67632,65652,93015,42100,87146,12154,26523,83163,35354,1751,5897,3575,82401,69235,75949,77241,79743,62059,12570,40741,43807,43955,22867,47706,30540,85343,92714,871,34586,80801,51038</list></variable><variable name="sorted list"><list struct="atomic" id="1083"></list></variable></variables></project><media name="U5L3-TimingAlgorithms" app="Snap! 6, https://snap.berkeley.edu" version="1"></media></snapdata>