<snapdata remixID="9002782"><project name="varBlocks" app="Snap! 5.1, http://snap.berkeley.edu" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAADFElEQVR4nO3YP0tbYRSA8fsdpJ3s0g466NzBWRcdkm79HP0DpWsnR5cMGcShFBQEnepysSCpXDKktBhJbLUquEgraicDp5MXtSbBwTwhfX5wlst94T3wQMhNQgIl9AX0fzNAoQxQKAMUygCFMkChDFAoAxTKAIUyQKEMUCgDFMoAheoa4NHRUWxvb9/bHB8f92JP9amOAZbL5djZ2bnT/Dk/j2b9W2x/rXWcL9XN/EypVOrVvuozbQOcm5uLra2tO8+HZw/j14vh+P2y85y8Go7Dw8P83N7eXi/3Vp9oG+D6+nrUarWo1WqRJElMTU1FuVyOiYmJmJ2dvfYsSZL83Y/PH8TZ60f5tBqfovX987Vnl7O7u5ufW11d7eXe6hNtA8yyLJ8kSWJycjJarVbMz8/H0NDQtWdJkuTv/hPgTiVaPzZvDbDZbObn1tbWerm3+kTbABcWFmJjYyOfSqUSp6enUa1W4+Li4tqzRqORv3czwLM3j+PszZNbA6zX6/m5lZWVXu6tPtHxT0iapneen+/f3hrbzTl59zSyLIs0TWNpaalX+6rPdP0Mk6ZplEqle5ssy3qxp/qUH6KFMkChDFAoAxTKAIUyQKEMUCgDFMoAhTJAoQxQKAMUygCFMkChDFAoAxTKAIUyQKEMUCgDFMoAhTJAoQxQKAMUygCFMkChDFAoAxTKAIUyQKEMUCgDFMoAhTJAoQxQKANsY3R0NBYXF+lrDDwD7KBYLEahUIhCoRBjY2Oxv79PX2ngGGAXlwFenWKxGDMzM/TVBoIBdtEuwOnpafpqA8EAO7j6Ezw+Ph4HBwf0lQaOAbYxMjISy8vL9DUGngEKZYBCGaBQBiiUAQplgEIZoFAGKJQBCmWAQhmgUAYolAEKZYBCGaBQBiiUAQplgEIZoFAGKJQBCmWAQhmgUAYolAEKZYBCGaBQBiiUAQplgEIZoFAGKJQBCmWAQhmgUAYolAEKZYBCGaBQBiiUAQplgEIZoFAGKJQBCmWAQhmgUAYolAEKZYBCGaBQBiiUAQplgEIZoFAGKJQBCvUXcP/c4klm1CEAAAAASUVORK5CYII=</thumbnail><stage name="Stage" width="480" height="360" costume="0" color="255,255,255,1" tempo="60" threadsafe="false" volume="100" pan="0" lines="round" ternary="false" codify="false" inheritance="true" sublistIDs="false" scheduled="false" id="1"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAACtUlEQVR4nO3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+Bo3+AAF/RMkcAAAAAElFTkSuQmCC</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="0" y="2.842170943040401e-14" 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="20" y="20"><custom-block s="variable %s watcher x"><l></l><comment w="183" collapsed="false">I need help with these two reporters.</comment></custom-block></script><script x="20" y="77"><custom-block s="variable %s watcher y"><l></l><comment w="183" collapsed="false">I need help with these two reporters.</comment></custom-block></script><script x="20" y="134"><custom-block s="change variable %s watcher x by %n"><l></l><l>10</l><comment w="348" collapsed="false">The definitions of these four commands will depend on the two reporters.</comment></custom-block></script><script x="20" y="191"><custom-block s="set variable %s watcher x to %n"><l></l><l>0</l><comment w="348" collapsed="false">The definitions of these four commands will depend on the two reporters.</comment></custom-block></script><script x="20" y="248"><custom-block s="change variable %s watcher y by %n"><l></l><l>10</l><comment w="348" collapsed="false">The definitions of these four commands will depend on the two reporters.</comment></custom-block></script><script x="20" y="362"><custom-block s="global variables %mult%txt"><list><l></l></list></custom-block><custom-block s="sprite-local variables %mult%txt"><list><custom-block s="does variable %s exist?"><l></l></custom-block></list><comment w="210" collapsed="false">These three blocks were not created by me, but I created the other custom blocks&#xD;(see the Variables palette)</comment></custom-block></script><script x="20" y="464"><block s="evaluate"><block s="reportJSFunction"><list><l>v</l></list><l>return(this.findVariableWatcher(v).topLeft().y);</l></block><list><l>tester</l></list></block></script><script x="20" y="305"><custom-block s="set variable %s watcher y to %n"><l></l><l>0</l><comment w="348" collapsed="false">The definitions of these four commands will depend on the two reporters.</comment></custom-block></script></scripts></sprite><watcher var="tester" style="normal" x="18.000000000000455" y="44" color="243,118,29"/></sprites></stage><hidden></hidden><headers></headers><code></code><blocks><block-definition s="global variables %&apos;names&apos;" type="command" category="variables"><header></header><code></code><translations>pt:cria as variáveis globais _&#xD;</translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doForEach"><l>each item</l><block var="names"/><script><block s="doRun"><block s="reportJSFunction"><list><l>name</l></list><l>if ((typeof name) != "string") {&#xD;    throw new Error("name isn&apos;t a string: " + name);&#xD;}&#xD;if (name != "") this.addVariable(name, true);</l></block><list><block var="each item"/></list></block></script></block><block s="doRun"><block s="reportJSFunction"><list></list><l>var ide = this.parentThatIsA(IDE_Morph);&#xD;ide.flushBlocksCache(&apos;variables&apos;); // b/c of inheritance&#xD;ide.refreshPalette();</l></block><list></list></block></script></block-definition><block-definition s="sprite-local variables %&apos;names&apos;" type="command" category="variables"><header></header><code></code><translations>pt:cria as variáveis de objecto _&#xD;</translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doForEach"><l>each item</l><block var="names"/><script><block s="doRun"><block s="reportJSFunction"><list><l>name</l></list><l>if ((typeof name) != "string") {&#xD;    throw new Error("name isn&apos;t a string: " + name);&#xD;}&#xD;if (name != "") this.addVariable(name, false);</l></block><list><block var="each item"/></list></block></script></block><block s="doRun"><block s="reportJSFunction"><list></list><l>var ide = this.parentThatIsA(IDE_Morph);&#xD;ide.flushBlocksCache(&apos;variables&apos;); // b/c of inheritance&#xD;ide.refreshPalette();</l></block><list></list></block></script></block-definition><block-definition s="does variable %&apos;var&apos; exist?" type="predicate" category="variables"><header></header><code></code><translations>pt:a variável _ existe&#xD;</translations><inputs><input type="%s"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>varname</l></list><l>if ((typeof varname) != "string") {&#xD;    throw new Error("name isn&apos;t a string: " + varname);&#xD;}&#xD;return this.isVariableNameInUse(varname, true);</l></block><list><block var="var"/></list></block></block></script></block-definition><block-definition s="variable %&apos;var&apos;" type="reporter" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input></inputs><script><block s="doIf"><custom-block s="does variable %s exist?"><block var="var"/></custom-block><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>v</l></list><l>return this.variables.getVar(v)</l></block><list><block var="var"/></list></block></block></script></block><block s="doRun"><block s="reportJSFunction"><list><l>v</l></list><l>throw new ReferenceError(`Variable ${v} does not exist.`)</l></block><list><block var="var"/></list></block></script></block-definition><block-definition s="show all globals" type="command" category="variables"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doForEach"><l>var</l><block s="evaluate"><block s="reportJSFunction"><list></list><l>return new List(Object.getOwnPropertyNames(this.globalVariables().vars))</l></block><list></list></block><script><block s="doShowVar"><l></l></block></script></block></script></block-definition><block-definition s="hide all globals" type="command" category="variables"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doForEach"><l>var</l><block s="evaluate"><block s="reportJSFunction"><list></list><l>return new List(Object.getOwnPropertyNames(this.globalVariables().vars))</l></block><list></list></block><script><block s="doHideVar"><l></l></block></script></block></script></block-definition><block-definition s="delete variable %&apos;var&apos;" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input></inputs><script><block s="doIf"><custom-block s="does variable %s exist?"><block var="var"/></custom-block><script><block s="doRun"><block s="reportJSFunction"><list><l>v</l></list><l>this.deleteVariable(v)</l></block><list><block var="var"/></list></block></script></block></script></block-definition><block-definition s="set variable %&apos;var&apos; watcher %&apos;type&apos;" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input><input type="%s" readonly="true">normal<options>normal&#xD;large&#xD;slider</options></input></inputs><script><block s="doIf"><custom-block s="does variable %s exist?"><block var="var"/></custom-block><script><block s="doRun"><block s="reportJSFunction"><list><l>v,t</l></list><l>var watcher = this.findVariableWatcher(v)&#xD;switch(t) {&#xD;case "normal": watcher.styleNormal(); break;&#xD;case "large": watcher.styleLarge(); break;&#xD;case "slider": watcher.styleSlider(); break;&#xD;}</l></block><list><block var="var"/><block var="type"/></list></block></script></block></script></block-definition><block-definition s="variable %&apos;var&apos; slider min" type="reporter" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input></inputs><script><block s="doIf"><custom-block s="does variable %s exist?"><block var="var"/></custom-block><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>v</l></list><l>return this.findVariableWatcher(v).sliderMorph.start</l></block><list><block var="var"/></list></block></block></script></block><block s="doReport"><l>NaN</l></block></script></block-definition><block-definition s="variable %&apos;var&apos; slider max" type="reporter" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input></inputs><script><block s="doIf"><custom-block s="does variable %s exist?"><block var="var"/></custom-block><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>v</l></list><l>return this.findVariableWatcher(v).sliderMorph.stop</l></block><list><block var="var"/></list></block></block></script></block><block s="doReport"><l>NaN</l></block></script></block-definition><block-definition s="set variable %&apos;var&apos; slider min %&apos;val&apos;" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input><input type="%n"></input></inputs><script><block s="doIf"><custom-block s="does variable %s exist?"><block var="var"/></custom-block><script><block s="doRun"><block s="reportJSFunction"><list><l>v,u</l></list><l>this.findVariableWatcher(v).sliderMorph.setStart(u)</l></block><list><block var="var"/><block var="val"/></list></block></script></block></script></block-definition><block-definition s="set variable %&apos;var&apos; slider max %&apos;val&apos;" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input><input type="%n"></input></inputs><script><block s="doIf"><custom-block s="does variable %s exist?"><block var="var"/></custom-block><script><block s="doRun"><block s="reportJSFunction"><list><l>v,u</l></list><l>this.findVariableWatcher(v).sliderMorph.setStop(u)</l></block><list><block var="var"/><block var="val"/></list></block></script></block></script></block-definition><block-definition s="move variable %&apos;var&apos; watcher to x: %&apos;x&apos; y: %&apos;y&apos;" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input><input type="%n">0</input><input type="%n">0</input></inputs><script><block s="doIf"><custom-block s="does variable %s exist?"><block var="var"/></custom-block><script><block s="doRun"><block s="reportJSFunction"><list><l>v,x,y</l></list><l>var watcher = this.findVariableWatcher(v)&#xD;&#xD;//Copied from SpriteMorph&apos;s gotoXY method&#xD;&#xD;var stage = this.parentThatIsA(StageMorph),&#xD;  newX,&#xD;  newY,&#xD;  dest;&#xD;&#xD;if(!stage) {return;}&#xD;x = !isFinite(+x) ? 0 : +x;&#xD;y = !isFinite(+y) ? 0 : +y;&#xD;newX = stage.center().x + x * stage.scale;&#xD;newY = stage.center().y - y * stage.scale;&#xD;dest = new Point(newX, newY).subtract(watcher.extent().divideBy(2));&#xD;watcher.setPosition(dest)</l></block><list><block var="var"/><block var="x"/><block var="y"/></list></block></script></block></script></block-definition><block-definition s="change variable %&apos;var&apos; watcher x by %&apos;delta&apos;" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input><input type="%n">10</input></inputs><script><block s="doIf"><custom-block s="does variable %s exist?"><block var="var"/></custom-block><script><block s="doRun"><block s="reportJSFunction"><list><l>v</l><l>x</l></list><l>this.findVariableWatcher(v).moveBy(Point(x, 0));</l></block><list><block var="var"/><block var="delta"/></list></block></script></block></script></block-definition><block-definition s="set variable %&apos;var&apos; watcher x to %&apos;x&apos;" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input><input type="%n">0</input></inputs><script><block s="doIf"><custom-block s="does variable %s exist?"><block var="var"/></custom-block><script><custom-block s="move variable %s watcher to x: %n y: %n"><block var="var"/><block var="x"/><custom-block s="variable %s watcher y"><block var="var"/></custom-block></custom-block></script></block></script></block-definition><block-definition s="change variable %&apos;var&apos; watcher y by %&apos;delta&apos;" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input><input type="%n">10</input></inputs><script><block s="doIf"><custom-block s="does variable %s exist?"><block var="var"/></custom-block><script><block s="doRun"><block s="reportJSFunction"><list><l>v</l><l>y</l></list><l>this.findVariableWatcher(v).moveBy(Point(0, y));</l></block><list><block var="var"/><block var="delta"/></list></block></script></block></script></block-definition><block-definition s="set variable %&apos;var&apos; watcher y to %&apos;y&apos;" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input><input type="%n">0</input></inputs><script><block s="doIf"><custom-block s="does variable %s exist?"><block var="var"/></custom-block><script><custom-block s="move variable %s watcher to x: %n y: %n"><block var="var"/><custom-block s="variable %s watcher x"><block var="var"/></custom-block><block var="y"/></custom-block></script></block></script></block-definition><block-definition s="variable %&apos;var&apos; watcher x" type="reporter" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>v</l></list><l>return this.findVariableWatcher(v).topLeft().x;</l></block><list><block var="var"/></list></block></block></script></block-definition><block-definition s="variable %&apos;var&apos; watcher y" type="reporter" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>v</l></list><l>return this.findVariableWatcher(v).topLeft().y;</l></block><list><block var="var"/></list></block></block></script></block-definition><block-definition s="swap %&apos;a&apos; ⇄ %&apos;b&apos;" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input><input type="%s"><options>§_getVarNamesDict</options></input></inputs><script><block s="doIf"><block s="reportAnd"><custom-block s="does variable %s exist?"><block var="a"/></custom-block><custom-block s="does variable %s exist?"><block var="b"/></custom-block></block><script><block s="doRun"><block s="reifyScript"><script><block s="doDeclareVariables"><list><l>temp</l></list></block><block s="doSetVar"><l>temp</l><custom-block s="variable %s"><block var="a"/></custom-block></block><block s="doSetVar"><l></l><custom-block s="variable %s"><block var="b"/></custom-block></block><block s="doSetVar"><l></l><block var="temp"/></block></script><list></list></block><list><block var="a"/><block var="b"/></list></block></script></block></script></block-definition><block-definition s="move variable %&apos;var&apos; watcher by x: %&apos;x&apos; y: %&apos;y&apos;" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input><input type="%n">0</input><input type="%n">0</input></inputs><script><block s="doIf"><custom-block s="does variable %s exist?"><block var="var"/></custom-block><script><block s="doRun"><block s="reportJSFunction"><list><l>v,x,y</l></list><l>this.findVariableWatcher(v).moveBy(x, y);</l></block><list><block var="var"/><block var="x"/><block var="y"/></list></block></script></block></script></block-definition></blocks><variables><variable name="tester"><l>0</l></variable></variables></project><media name="varBlocks" app="Snap! 5.1, http://snap.berkeley.edu" version="1"></media></snapdata>