<snapdata remixID="9621305"><project name="script builder" app="Snap! 6, https://snap.berkeley.edu" version="1"><notes>A library for building scripts within scripts, if you want to do that.&#xD;&#xD;See inside</notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAC3klEQVR4Xu3XMUokYRhF0U9RMBF0A+7HXBANWgV34nbchGvRTExMRERLMJoZcIJp8DpyOu7iVd//UEVvLMuyjI8CUYENAKPyZj8KAAhCWgDANL9xABlICwCY5jcOIANpAQDT/MYBZCAtAGCa3ziADKQFAEzzGweQgbQAgGl+4wAykBYAMM1vHEAG0gIApvmNA8hAWgDANL9xABlICwCY5jcOIANpAQDT/MYBZCAtAGCa3ziADKQFAEzzGweQgbQAgGl+4wAykBYAMM1vHEAG0gIApvmNA8hAWgDANL9xABlICwCY5jcOIANpAQDT/MYBZCAtAGCa3ziADKQFAEzzGweQgbQAgGl+4wAykBYAMM1vHEAG0gIApvmNA8hAWgDANL9xABlICwCY5jcOIANpAQDT/MYBZCAtAOAn+a+vr+fh4WEODw/n4OAgPaSfPA7gJ6f7+Pg4l5eX8/LyMvf393NycjJbW1tzdnY2Ozs7P9nEl/42AP+S++bmZq6urmZ3d/e3bz09Pc35+fksyzLHx8dzd3c3r6+vX3pwv47t7+/P3t5etr/OMID/APD5+XlWq9Vsbm7O0dHR3N7eztvb2zrnsNa1AK6V73te/Ocr+PT09OMVfHFxMdvb29/zpv/Du/IE9CckZQtgmt84gAykBQBM8xsHkIG0AIBpfuMAMpAWADDNbxxABtICAKb5jQPIQFoAwDS/cQAZSAsAmOY3DiADaQEA0/zGAWQgLQBgmt84gAykBQBM8xsHkIG0AIBpfuMAMpAWADDNbxxABtICAKb5jQPIQFoAwDS/cQAZSAsAmOY3DiADaQEA0/zGAWQgLQBgmt84gAykBQBM8xsHkIG0AIBpfuMAMpAWADDNbxxABtICAKb5jQPIQFoAwDS/cQAZSAsAmOY3DiADaQEA0/zGAWQgLQBgmt84gAykBQBM8xsHkIG0AIBpfuMAMpAWADDNbxxABtICAKb5jb8DyR4jtwRbansAAAAASUVORK5CYII=</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="false" hyperops="true" codify="false" inheritance="true" sublistIDs="false" scheduled="false" id="1"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAQAklEQVR4Xu3VwW3DQBADQFslpZA8VKgeLiQlCWlCMAliVIB2d3gA3y8fAQIECBAg8HWB99cnGkiAAAECBAi8FLBHQIAAAQIEAgIKOIBuJAECBAgQUMDeAAECBAgQCAgo4AC6kQQIECBAQAF7AwQIECBAICCggAPoRhIgQIAAAQXsDRAgQIAAgYCAAg6gG0mAAAECBBSwN0CAAAECBAICCjiAbiQBAgQIEFDA3gABAgQIEAgIKOAAupEECBAgQEABewMECBAgQCAgoIAD6EYSIECAAAEF7A0QIECAAIGAgAIOoBtJgAABAgQUsDdAgAABAgQCAgo4gG4kAQIECBBQwN4AAQIECBAICCjgALqRBAgQIEBAAXsDBAgQIEAgIKCAA+hGEiBAgAABBewNECBAgACBgIACDqAbSYAAAQIEFLA3QIAAAQIEAgIKOIBuJAECBAgQUMDeAAECBAgQCAgo4AC6kQQIECBAQAF7AwQIECBAICCggAPoRhIgQIAAAQXsDRAgQIAAgYCAAg6gG0mAAAECBBSwN0CAAAECBAICCjiAbiQBAgQIEFDA3gABAgQIEAgIKOAAupEECBAgQEABewMECBAgQCAgoIAD6EYSIECAAAEF7A0QIECAAIGAgAIOoBtJgAABAgQUsDdAgAABAgQCAgo4gG4kAQIECBBQwN4AAQIECBAICCjgALqRBAgQIEBAAXsDBAgQIEAgIKCAA+hGEiBAgAABBewNECBAgACBgIACDqAbSYAAAQIEFLA3QIAAAQIEAgIKOIBuJAECBAgQUMDeAAECBAgQCAgo4AC6kQQIECBAQAF7AwQIECBAICCggAPoRhIgQIAAAQXsDRAgQIAA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4ACbk7HbgQIECAwK6CAZ6N1GAECBAg0Cyjg5nTsRoAAAQKzAgp4NlqHESBAgECzgAJuTsduBAgQIDAroIBno3UYAQIECDQLKODmdOxGgAABArMCCng2WocRIECAQLOAAm5Ox24ECBAgMCuggGejdRgBAgQINAso4OZ07EaAAAECswIKeDZahxEgQIBAs4ACbk7HbgQIECAwK6CAZ6N1GAECBAg0Cyjg5nTsRoAAAQKzAgp4NlqHESBAgECzgAJuTsduBAgQIDAroIBno3UYAQIECDQLKODmdOxGgAABArMCCng2WocRIECAQLOAAm5Ox24ECBAgMCuggGejdRgBAgQINAso4OZ07EaAAAECswIKeDZahxEgQIBAs4ACbk7HbgQIECAwK6CAZ6N1GAECBAg0Cyjg5nTsRoAAAQKzAgp4NlqHESBAgECzgAJuTsduBAgQIDAroIBno3UYAQIECDQLKODmdOxGgAABArMCCng2WocRIECAQLOAAm5Ox24ECBAgMCuggGejdRgBAgQINAso4OZ07EaAAAECswIKeDZahxEgQIBAs4ACbk7HbgQIECAwK6CAZ6N1GAECBAg0Cyjg5nTsRoAAAQKzAgp4NlqHESBAgECzgAJuTsduBAgQIDAroIBno3UYAQIECDQLKODmdOxGgAABArMCCng2WocRIECAQLOAAm5Ox24ECBAgMCuggGejdRgBAgQINAso4OZ07EaAAAECswIKeDZahxEgQIBAs4ACbk7HbgQIECAwK6CAZ6N1GAECBAg0Cyjg5nTsRoAAAQKzAgp4NlqHESBAgECzgAJuTsduBAgQIDAroIBno3UYAQIECDQLKODmdOxGgAABArMCCng2WocRIECAQLOAAm5Ox24ECBAgMCuggGejdRgBAgQINAso4OZ07EaAAAECswIKeDZahxEgQIBAs4ACbk7HbgQIECAwK6CAZ6N1GAECBAg0Cyjg5nTsRoAAAQKzAgp4NlqHESBAgECzgAJuTsduBAgQIDAroIBno3UYAQIECDQLKODmdOxGgAABArMCCng2WocRIECAQLOAAm5Ox24ECBAgMCuggGejdRgBAgQINAso4OZ07EaAAAECswIKeDZahxEgQIBAs4ACbk7HbgQIECAwK6CAZ6N1GAECBAg0Cyjg5nTsRoAAAQKzAgp4NlqHESBAgECzgAJuTsduBAgQIDAroIBno3UYAQIECDQLKODmdOxGgAABArMCCng2WocRIECAQLOAAm5Ox24ECBAgMCuggGejdRgBAgQINAso4OZ07EaAAAECswIKeDZahxEgQIBAs4ACbk7HbgQIECAwK6CAZ6N1GAECBAg0Cyjg5nTsRoAAAQKzAgp4NlqHESBAgECzgAJuTsduBAgQIDAroIBno3UYAQIECDQLKODmdOxGgAABArMCCng2WocRIECAQLOAAm5Ox24ECBAgMCuggGejdRgBAgQINAso4OZ07EaAAAECswIKeDZahxEgQIBAs4ACbk7HbgQIECAwK6CAZ6N1GAECBAg0Cyjg5nTsRoAAAQKzAgp4NlqHESBAgECzgAJuTsduBAgQIDAroIBno3UYAQIECDQLKODmdOxGgAABArMCCng2WocRIECAQLOAAm5Ox24ECBAgMCuggGejdRgBAgQINAso4OZ07EaAAAECswIKeDZahxEgQIBAs4ACbk7HbgQIECAwK6CAZ6N1GAECBAg0Cyjg5nTsRoAAAQKzAgp4NlqHESBAgECzgAJuTsduBAgQIDAroIBno3UYAQIECDQLKODmdOxGgAABArMCCng2WocRIECAQLOAAm5Ox24ECBAgMCuggGejdRgBAgQINAso4OZ07EaAAAECswIKeDZahxEgQIBAs4ACbk7HbgQIECAwK6CAZ6N1GAECBAg0Cyjg5nTsRoAAAQKzAgp4NlqHESBAgECzgAJuTsduBAgQIDAroIBno3UYAQIECDQLKODmdOxGgAABArMCCng2WocRIECAQLOAAm5Ox24ECBAgMCuggGejdRgBAgQINAso4OZ07EaAAAECswIKeDZahxEgQIBAs4ACbk7HbgQIECAwK6CAZ6N1GAECBAg0Cyjg5nTsRoAAAQKzAgp4NlqHESBAgECzgAJuTsduBAgQIDAroIBno3UYAQIECDQLKODmdOxGgAABArMCCng2WocRIECAQLOAAm5Ox24ECBAgMCuggGejdRgBAgQINAso4OZ07EaAAAECswIKeDZahxEgQIBAs4ACbk7HbgQIECAwK6CAZ6N1GAECBAg0Cyjg5nTsRoAAAQKzAgp4NlqHESBAgECzgAJuTsduBAgQIDAroIBno3UYAQIECDQLKODmdOxGgAABArMC/5PcEWmQqOdjAAAAAElFTkSuQmCC</pentrails><costumes><list struct="atomic" id="2"></list></costumes><sounds><list struct="atomic" id="3"></list></sounds><variables></variables><blocks></blocks><scripts><script x="29" y="39.333333333333854"><block s="evaluate"><block s="reportJSFunction"><list><l>f</l></list><l>return f.expression.definition.body;</l></block><list><block s="reifyReporter"><autolambda><custom-block s="%s put into slot %n of %cmdRing"><l></l><l></l><block s="reifyScript"><script></script><list></list></block></custom-block></autolambda><list></list></block></list></block></script><script x="29" y="130.00000000000043"><block s="evaluate"><block s="reportJSFunction"><list><l>f</l></list><l>return f.expression.blockSpec;</l></block><list><block s="reifyReporter"><autolambda><custom-block s="%s put into slot %n of %cmdRing"><l></l><l></l><block s="reifyScript"><script></script><list></list></block></custom-block></autolambda><list></list></block></list></block></script><script x="667.8310546874991" y="484.99999999999955"><block s="reportNumbers"><l>1</l><l></l></block></script><script x="479.9999999999991" y="404.16666666666686"><block s="evaluate"><custom-block s="%s into first empty slot of %repRing"><l>10</l><custom-block s="%s into first empty slot of %repRing"><l>1</l><block s="reifyReporter"><autolambda><block s="reportNumbers"><l></l><l></l></block></autolambda><list></list></block></custom-block></custom-block><list></list></block></script><script x="677.9999999999998" y="523.6666666666664"><block var="foo"/></script><script x="121.99999999999955" y="322.3333333333337"><block s="doRun"><block s="reportJSFunction"><list><l>o</l></list><l>console.log(o.expression);</l></block><list><block s="reifyReporter"><autolambda><custom-block s="%s into first empty slot of %repRing"><l></l><block s="reifyReporter"><script></script><list></list></block></custom-block></autolambda><list></list></block></list></block></script></scripts><sprites><sprite name="Sprite" idx="1" x="0" y="0" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="80,80,80,1" pen="tip" id="97"><costumes><list struct="atomic" id="98"></list></costumes><sounds><list struct="atomic" id="99"></list></sounds><blocks></blocks><variables></variables><scripts><script x="10" y="10"><block s="doSetVar"><l>foo</l><block s="reifyReporter"><autolambda><block s="reportSum"><l>1</l><l>2</l></block></autolambda><list></list></block></block><block s="doReport"><block s="reportEquals"><block var="foo"/><block var="foo"/></block></block></script><script x="10" y="84.83333333333337"><block s="doSetVar"><l>foo</l><block s="reifyReporter"><autolambda><block s="reportSum"><l>1</l><l>2</l></block></autolambda><list></list></block></block><block s="doReport"><block s="reportEquals"><block var="foo"/><custom-block s="copy %s"><block var="foo"/></custom-block></block></block></script><script x="10" y="163.66666666666677"><custom-block s="%cmdRing put after %cmdRing"><block s="reifyScript"><script><block s="down"></block><block s="forward"><l>100</l></block><block s="up"></block></script><list></list></block><block s="reifyScript"><script><block s="up"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="setHeading"><l>90</l></block><block s="clear"></block></script><list></list></block></custom-block></script><script x="10" y="266.33333333333303"><custom-block s="blocks in %cmdRing"><block s="reifyScript"><script><block s="up"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="setHeading"><l>90</l></block><block s="clear"></block><block s="doSayFor"><l>Hello!</l><l>2</l></block><block s="doSayFor"><l>World!</l><l>2</l></block><block s="down"></block><block s="doRepeat"><l>5</l><script><block s="forward"><l>100</l></block><block s="turn"><l>90</l></block></script></block><block s="up"></block></script><list></list></block></custom-block></script><script x="10" y="520.6666666666662"><custom-block s="%s put into slot %n of %cmdRing"><l>5</l><l>1</l><block s="reifyReporter"><autolambda><block s="reportSum"><l></l><l>5</l></block></autolambda><list></list></block></custom-block></script><script x="10" y="563.6666666666666"><custom-block s="%s put into slot %n of %cmdRing"><block s="reifyReporter"><autolambda><block s="reportProduct"><l>2</l><l>3</l></block></autolambda><list></list></block><l>2</l><block s="reifyReporter"><autolambda><block s="reportSum"><l>4</l><l>23</l></block></autolambda><list></list></block></custom-block></script><script x="10" y="606.6666666666669"><custom-block s="%s put into slot %n of %cmdRing"><block s="reifyScript"><script><block s="doSayFor"><l>Hello!</l><l>2</l></block></script><list></list></block><l>1</l><block s="reifyScript"><script><block s="doRun"><block s="reifyScript"><script></script><list></list></block><list></list></block></script><list></list></block></custom-block></script><script x="10" y="654.6666666666669"><custom-block s="%s put into slot %n of %cmdRing"><custom-block s="%cmdRing put after %cmdRing"><block s="reifyScript"><script><block s="turn"><l>90</l></block></script><list></list></block><block s="reifyScript"><script><block s="forward"><l>50</l></block></script><list></list></block></custom-block><l>2</l><custom-block s="%s put into slot %n of %cmdRing"><l>4</l><l>1</l><block s="reifyScript"><script><block s="doRepeat"><l></l><script></script></block></script><list></list></block></custom-block></custom-block></script><script x="10" y="756.6666666666664"><custom-block s="%s into first empty slot of %repRing"><l>2</l><block s="reifyReporter"><autolambda><block s="reportProduct"><l>5</l><l></l></block></autolambda><list></list></block></custom-block></script><script x="10" y="799.6666666666662"><custom-block s="%s into first empty slot of %repRing"><l>No</l><custom-block s="%s into first empty slot of %repRing"><l>Yes</l><block s="reifyReporter"><autolambda><block s="reportIfElse"><l><bool>true</bool></l><l></l><l></l></block></autolambda><list></list></block></custom-block></custom-block></script><script x="10" y="860.666666666666"><custom-block s="%s into first empty slot of %repRing"><block s="reportBoolean"><l><bool>true</bool></l></block><block s="reifyScript"><script><block s="bubble"><l></l></block></script><list></list></block></custom-block></script><script x="10" y="906.666666666666"><custom-block s="%s into first empty slot of %repRing"><block s="reifyScript"><script><block s="bubble"><l>bar</l></block></script><list></list></block><block s="reifyScript"><script><block s="doIfElse"><l><bool>true</bool></l><script><block s="bubble"><l>foo</l></block></script><script></script></block></script><list></list></block></custom-block></script><script x="10" y="1007.4999999999994"><custom-block s="%s into first empty slot of %repRing"><block s="reportBoolean"><l><bool>true</bool></l></block><block s="reifyScript"><script><block s="doIfElse"><l/><script><block s="bubble"><l>foo</l></block></script><script><block s="bubble"><l>bar</l></block></script></block></script><list></list></block></custom-block></script><script x="10" y="1119.3333333333312"><custom-block s="%s into first empty slot of %repRing"><custom-block s="%s into first empty slot of %repRing"><l>4</l><block s="reifyPredicate"><autolambda><block s="reportEquals"><l></l><block s="reportSum"><l>2</l><l>2</l></block></block></autolambda><list></list></block></custom-block><block s="reifyScript"><script><block s="doIfElse"><l/><script><block s="bubble"><l>foo</l></block></script><script><block s="bubble"><l>bar</l></block></script></block></script><list></list></block></custom-block></script><script x="10" y="1263.1666666666647"><custom-block s="slot %n of %repRing"><l>1</l><block s="reifyReporter"><script><block s="gotoXY"><l>123</l><l>456</l></block></script><list></list></block></custom-block></script><script x="10" y="1309.1666666666645"><custom-block s="slot %n of %repRing"><l>2</l><block s="reifyReporter"><autolambda><block s="reportLetter"><l>1</l><l>world</l></block></autolambda><list></list></block></custom-block></script><script x="10" y="1352.166666666665"><custom-block s="slot %n of %repRing"><l>1</l><block s="reifyReporter"><script><block s="gotoXY"><block s="reportProduct"><block s="reportMonadic"><l><option>sin</option></l><block s="direction"></block></block><l>10</l></block><block s="reportProduct"><block s="reportMonadic"><l><option>cos</option></l><block s="direction"></block></block><l>10</l></block></block></script><list></list></block></custom-block></script><script x="10" y="1431.999999999998"><custom-block s="slot %n of %repRing"><l>2</l><block s="reifyReporter"><script><block s="gotoXY"><block s="reportProduct"><block s="reportMonadic"><l><option>sin</option></l><block s="direction"></block></block><l>10</l></block><block s="reportProduct"><block s="reportMonadic"><l><option>cos</option></l><block s="direction"></block></block><l>10</l></block></block></script><list></list></block></custom-block></script><script x="10" y="1511.8333333333321"><custom-block s="slot %n of %repRing"><l>1</l><block s="reifyReporter"><script><block s="doCallCC"><block s="reifyScript"><script><block s="doGlide"><l>1</l><l>0</l><l>0</l></block></script><list></list></block></block></script><list></list></block></custom-block></script></scripts></sprite></sprites></stage><hidden></hidden><headers></headers><code></code><blocks><block-definition s="%&apos;thing&apos; put into slot %&apos;slot&apos; of %&apos;target&apos;" type="reporter" category="operators"><comment w="90" collapsed="false">Puts a block/value inside a specified input of another block.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%n"></input><input type="%cmdRing"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>thing</l><l>slot</l><l>target</l></list><l>//if empty&#xD;if (!(target.expression instanceof BlockMorph)) return thing;&#xD;if (!(thing.expression instanceof BlockMorph || thing.expression instanceof ReporterBlockMorph || typeof(thing) == "string" || typeof(thing) == "number" || typeof(thing) == "boolean")) return target;&#xD;&#xD;var type = typeof(thing);&#xD;var slotNum = 1;&#xD;//console.log();&#xD;&#xD;var outExpr = target.expression;  //.fullCopy();&#xD;var outCtx = new Context(undefined, outExpr);&#xD;//outCtx.inputs = thing.inputs || [];&#xD;&#xD;var block;&#xD;&#xD;if (thing.expression instanceof Morph) block = thing.expression;   //.fullCopy();&#xD;&#xD;for (let i in outExpr.children) {&#xD; let child = outExpr.children[i];&#xD;&#xD; if (type == "boolean") {&#xD;  if (child instanceof BooleanSlotMorph) {&#xD;   child.value = thing;&#xD;   return outCtx;&#xD;  }&#xD; } else&#xD; if (child instanceof InputSlotMorph || child instanceof RingMorph || child instanceof CSlotMorph || child instanceof ArgMorph) {&#xD;  if (slotNum == slot) {&#xD;   //console.log(child);&#xD;&#xD;   if (type == "string" || type == "number") {&#xD;    if (!(child.children[0] instanceof InputSlotStringMorph)) return target;&#xD;&#xD;    child.setContents(thing);&#xD;    delete child.bindingID;&#xD;    return outCtx;     &#xD;   }&#xD;&#xD;   if (child instanceof RingMorph) {&#xD;    child.embed(block, thing.inputs);&#xD;&#xD;    return outCtx;&#xD;   } if (child instanceof CSlotMorph) {&#xD;    let input = child;&#xD;&#xD;    //clear children&#xD;    while (input.children[0] !== undefined) input.removeChild(input.children[0]);&#xD;&#xD;    input.children.push(block);&#xD;    block.parent = input;&#xD;    input.fixLayout(); &#xD;   } else {&#xD;    if (child instanceof InputSlotMorph) {&#xD;     thing.expression.isNumeric = child.isNumeric;&#xD;     thing.expression.fixLayout();&#xD;    }&#xD;&#xD;    outExpr.children.splice(i, 1, block);&#xD;    block.parent = outExpr;&#xD;    outExpr.fixLayout();&#xD;   }&#xD;&#xD;   //target.expression.fixLayout();&#xD;   //outCtx.inputs = thing.inputs; &#xD;   return outCtx;&#xD;  }&#xD;&#xD;  slotNum++;&#xD; }&#xD;}&#xD;&#xD;return target; </l></block><list><block var="thing"/><block var="slot"/><block var="target"/></list></block></block></script></block-definition><block-definition s="%&apos;child&apos; put after %&apos;script&apos;" type="reporter" category="operators"><comment x="0" y="0" w="90" collapsed="false">Puts the blocks in the first script at the end of the second script.</comment><header></header><code></code><translations></translations><inputs><input type="%cmdRing"></input><input type="%cmdRing"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>child</l><l>script</l></list><l>//if empty&#xD;if (!(script.expression instanceof BlockMorph)) return child;&#xD;if (!(child.expression instanceof BlockMorph)) return script;&#xD;&#xD;var tailBlock = script.expression.fullCopy();&#xD;var outCtx = new Context(undefined, tailBlock);&#xD;var lastChild = tailBlock.nextBlock();&#xD;&#xD;while (lastChild instanceof BlockMorph) {&#xD; tailBlock = lastChild;&#xD; lastChild = lastChild.nextBlock();&#xD;}&#xD;&#xD;tailBlock.add(child.expression.fullCopy());&#xD;tailBlock.fixLayout();&#xD;&#xD;//combine inputs&#xD;outCtx.inputs = script.inputs;&#xD;&#xD;for (let v of child.inputs) {&#xD; if (outCtx.inputs.indexOf(v) &lt; 0) {&#xD;  outCtx.inputs.push(v);&#xD; }&#xD;}&#xD;&#xD;return outCtx;</l></block><list><block var="child"/><block var="script"/></list></block></block></script></block-definition><block-definition s="%&apos;val&apos; into first empty slot of %&apos;expr&apos;" type="reporter" category="operators"><comment w="90" collapsed="false">Puts an expression/value inside the first empty slot of another command/expression.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%repRing"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>val</l><l>expr</l></list><l>if (!(expr.expression instanceof BlockMorph)) return expr;&#xD;&#xD;var isBlock = val.expression instanceof BlockMorph;&#xD;var type = typeof(val);&#xD;var block = null;&#xD;&#xD;if (type == "boolean") {&#xD; //Create true/false boolean block&#xD; //Just copying properties from a boolean block i logged to the dev console&#xD; block = new ReporterBlockMorph();&#xD; block.isPredicate = true;&#xD; block.selector = "reportBoolean";&#xD; block.blockSpec = "%bool";&#xD; block.category = "operators";&#xD; block.color = new Color(98, 194, 19, 1);&#xD;&#xD; let slotMorph = new BooleanSlotMorph();&#xD; slotMorph.color = new Color(98, 194, 19);&#xD; slotMorph.value = val;&#xD; //slotMorph.type = null;&#xD; slotMorph.isStatic = true;&#xD; //slotMorph.isTemplate = false;&#xD; //slotMorph.isFreeForm = false;&#xD;&#xD; slotMorph.fixLayout();&#xD; block.add(slotMorph);&#xD; block.fixLayout();&#xD;} else if (isBlock) {&#xD; block = val.expression.fullCopy();&#xD;}&#xD;&#xD;var outCtx = new Context(undefined, expr.expression);&#xD;&#xD;for (let i in outCtx.expression.children) {&#xD; let input = outCtx.expression.children[i];&#xD;&#xD; //console.log(input);&#xD; &#xD; if (input instanceof RingMorph) { //Ring &#xD;  if (input.children[0].children.length == 0) { //If empty&#xD;   if (isBlock) {&#xD;    input.children[0].add(block);&#xD;    input.children[0].fixLayout();&#xD;&#xD;    return outCtx; &#xD;   }&#xD;  }&#xD; } else if (input instanceof CSlotMorph) {&#xD;  if (input.children[0] === undefined) { //is empty&#xD;  //if (input.isEmptySlot()) {&#xD;   if (isBlock || type == "boolean") {&#xD;    if (block instanceof CommandBlockMorph) {&#xD;     input.add(block);&#xD;     input.fixLayout();&#xD;    } else {&#xD;     outCtx.expression.children.splice(i, 1, block);&#xD;     block.parent = outCtx.expression;&#xD;&#xD;     block.fixLayout();&#xD;    }&#xD;&#xD;    return outCtx;&#xD;   }&#xD;  } &#xD; } else if (input instanceof InputSlotMorph) { //Input slot&#xD;  //if (input.children[0].text == "") { //is empty&#xD;  if (input.isEmptySlot()) {&#xD;   if (type == "string" || type == "number") {&#xD;    input.setContents(val);&#xD;    delete input.bindingID; &#xD;   } else {&#xD;    outCtx.expression.children.splice(i, 1, block);&#xD;    block.parent = outCtx.expression;&#xD;&#xD;    block.fixLayout();&#xD;   }&#xD;&#xD;   return outCtx;&#xD;  }&#xD; } else if (input instanceof BooleanSlotMorph) { //Bool slot&#xD;  if (input.value === null) { //is empty&#xD;   if (type == "boolean") {&#xD;    input.value = val;&#xD;    return outCtx;&#xD;   } else if (isBlock) {&#xD;    outCtx.expression.children.splice(i, 1, block);&#xD;    block.parent = outCtx.expression;&#xD;&#xD;    block.fixLayout(); &#xD;   }&#xD;&#xD;   return outCtx; &#xD;  } &#xD; }&#xD;}&#xD;&#xD;return expr; </l></block><list><block var="val"/><block var="expr"/></list></block></block></script><scripts><comment x="409.00000000000136" y="175.1999999999996" w="241.828125" collapsed="false">RingMorph.children[0].children is empty&#xD;InputSlotMorph.children[0.text == &quot;&quot;&#xD;BooleanSlotMorph.value == null&#xD;CSlotMorph.children is empty</comment></scripts></block-definition><block-definition s="slot %&apos;n&apos; of %&apos;block&apos;" type="reporter" category="operators"><comment w="90" collapsed="false">Gets the block/value at the nth slot of a block.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%repRing"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>n</l><l>target</l></list><l>//if empty&#xD;if (!(target.expression instanceof BlockMorph)) return new Context();&#xD;&#xD;function get(child) {&#xD;  if (child instanceof BooleanSlotMorph) {&#xD;    return child.value;&#xD;  } else if (child instanceof InputSlotMorph) {&#xD;    return child.children[0].text;&#xD;  } else if (child instanceof CSlotMorph) {&#xD;    var block = child.children[0];&#xD;    //if (block instanceof BlockMorph) block = block.fullCopy();&#xD;&#xD;    return new Context(null, block);&#xD;  } else if (child instanceof RingMorph) {&#xD;    var block = child.children[0].children[0];&#xD;    //if (block instanceof BlockMorph) block = block.fullCopy();&#xD;&#xD;    return new Context(null, block);&#xD;  } else if (child instanceof MultiArgMorph) {&#xD;     var outArr = [];&#xD;&#xD;     for (let j = 0; j &lt; child.children.length - 1; j++) {&#xD;       outArr.push( get(child.children[j]) );&#xD;     }&#xD;&#xD;     return new List(outArr);&#xD;  } else {&#xD;    return new Context(null, child);&#xD;  }&#xD;}&#xD;&#xD;var slotNum = 1;&#xD;for (let i in target.expression.children) {&#xD; let child = target.expression.children[i];&#xD;&#xD; if (child instanceof InputSlotMorph || child instanceof RingMorph || child instanceof CSlotMorph || child instanceof ArgMorph || child instanceof BlockMorph) {&#xD;  if (n === slotNum) {&#xD;   console.log(child);&#xD;&#xD;   return get(child);&#xD;  }&#xD;&#xD;  slotNum++;&#xD; }&#xD;}&#xD;&#xD;return new Context(); </l></block><list><block var="n"/><block var="block"/></list></block></block></script></block-definition><block-definition s="blocks in %&apos;expr&apos;" type="reporter" category="operators"><comment w="90" collapsed="false">Reports a list of the blocks in a stack</comment><header></header><code></code><translations></translations><inputs><input type="%cmdRing"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>expr</l></list><l>var out = [];&#xD;var block = expr.expression;&#xD;&#xD;while (block) {&#xD;  var itm = block.fullCopy();&#xD;  if (itm.nextBlock())  itm.children.pop();&#xD;  out.push( new Context(0, itm) );&#xD;  block = block.nextBlock();&#xD;}&#xD;&#xD;return new List(out);</l></block><list><block var="expr"/></list></block></block></script></block-definition><block-definition s="copy %&apos;obj&apos;" type="reporter" category="other"><comment w="90" collapsed="false">Creates a copy of the input</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>obj</l></list><l>if (typeof obj === "object") {&#xD;  if (obj instanceof Context) {&#xD;    var ctx = new Context();&#xD;    ctx.inputs = copy(obj.inputs);&#xD;    if (obj.expression)  ctx.expression = obj.expression.fullCopy();&#xD;    return ctx;&#xD;  }&#xD;&#xD;  return ("fullCopy" in obj) ?&#xD;    obj.fullCopy() : //copy everything, including inputs&#xD;    copy(obj);       //use built-in shallow copy function&#xD;}&#xD;&#xD;return obj; //for primitive types</l></block><list><block var="obj"/></list></block></block></script></block-definition><block-definition s="# of slots in %&apos;expr&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>expr</l></list><l>return expr.expression.inputs().length;</l></block><list><block var="expr"/></list></block></block></script></block-definition></blocks><variables><variable name="foo"><context id="594"><inputs></inputs><variables></variables><block s="reportSum"><l>1</l><l>2</l></block><receiver><ref id="97"></ref></receiver><origin><ref id="97"></ref></origin><context id="600"><inputs><input>false</input></inputs><variables></variables><receiver><ref id="97"></ref></receiver><origin><ref id="97"></ref></origin></context></context></variable></variables></project><media name="script builder" app="Snap! 6, https://snap.berkeley.edu" version="1"></media></snapdata>