<snapdata remixID="10084810"><project name="Numbers in expanded form!" app="Snap! 6, https://snap.berkeley.edu" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAACeklEQVR4Xu3XsWnDUABF0W/tYk3gRVxrCs8ll55He7iSIZCQJglpfEEctRI8dP8BodO+7/twKRAVOAEYlTf7UQBAENICAKb5jQPIQFoAwDS/cQAZSAsAmOY3DiADaQEA0/zGAWQgLQBgmt84gAykBQBM8xsHkIG0AIBpfuMAMpAWADDNbxxABtICAKb5jQPIQFoAwDS/cQAZSAsAmOY3DiADaQEA0/zGAWQgLQBgmt84gAykBQBM8xsHkIG0AIBpfuMAMpAWADDNbxxABtICAKb5jQPIQFoAwDS/cQAZSAsAmOY3DiADaQEA0/zGAWQgLQBgmt84gAykBQBM8xsHkIG0AIBpfuMAMpAWADDNbxxABtICAKb5jQPIQFoAwDS/cQAZSAsAmOY3DiADaQEAf8h/uVzG7XYby7KkB3T0cQB/OeHr9fp1d9u2cb/fx/l8PrqJt74fgH/k/o7w89Fpmsbz+RyPx+Oth3XEMQABTF0D+I9P8LquY57n9MCONg6gn5DUNIBpfuMAMpAWADDNbxxABtICAKb5jQPIQFoAwDS/cQAZSAsAmOY3DiADaQEA0/zGAWQgLQBgmt84gAykBQBM8xsHkIG0AIBpfuMAMpAWADDNbxxABtICAKb5jQPIQFoAwDS/cQAZSAsAmOY3DiADaQEA0/zGAWQgLQBgmt84gAykBQBM8xsHkIG0AIBpfuMAMpAWADDNbxxABtICAKb5jQPIQFoAwDS/cQAZSAsAmOY3DiADaQEA0/zGAWQgLQBgmt84gAykBQBM8xsHkIG0AIBpfuMAMpAWADDNbxxABtICAKb5jQPIQFoAwDS/cQAZSAsAmOY3/gLXCfyohseIjQAAAABJRU5ErkJggg==</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,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="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="8"><costumes><list struct="atomic" id="9"></list></costumes><sounds><list struct="atomic" id="10"></list></sounds><blocks></blocks><variables></variables><scripts><script x="193" y="120"><block s="receiveGo"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="doForever"><script><block s="doAsk"><l>Number?</l></block><block s="doSayFor"><custom-block s="%n in expanded form as a %txt"><block s="getLastAnswer"></block><l>text</l></custom-block><l>2</l></block><block s="doAsk"><l>Number?</l></block><block s="doSayFor"><custom-block s="%n in expanded form as a %txt"><block s="getLastAnswer"></block><l>list</l></custom-block><l>2</l></block></script></block></script></scripts></sprite></sprites></stage><hidden></hidden><headers></headers><code></code><blocks><block-definition s="%&apos;num&apos; in expanded form as a %&apos;text/list&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n">1</input><input type="%txt">list<options>text&#xD;list</options></input></inputs><script><block s="doDeclareVariables"><list><l>d</l></list></block><block s="doSetVar"><l>d</l><block s="reportIfElse"><block s="reportEquals"><block s="reportListItem"><l>1</l><block s="reportTextSplit"><block var="num"/><l><option>letter</option></l></block></block><l>-</l></block><l>-1</l><l>1</l></block></block><block s="doIfElse"><block s="reportIsA"><block var="num"/><l><option>number</option></l></block><script><block s="doIfElse"><block s="reportListContainsItem"><block s="reportTextSplit"><block var="num"/><l><option>letter</option></l></block><l>.</l></block><script><block s="doDeclareVariables"><list><l>a</l><l>b</l><l>c</l></list></block><block s="doSetVar"><l>b</l><block s="reportListIndex"><l>.</l><block s="reportTextSplit"><block var="num"/><l><option>letter</option></l></block></block></block><block s="doSetVar"><l>a</l><block s="reportNewList"><list><block s="reportProduct"><block s="reportProduct"><block s="reportLetter"><block s="reportIfElse"><block s="reportListContainsItem"><block s="reportTextSplit"><block var="num"/><l><option>letter</option></l></block><l>-</l></block><l>2</l><l>1</l></block><block var="num"/></block><custom-block s="New 10^ of %n"><block s="reportDifference"><block var="b"/><block s="reportIfElse"><block s="reportListContainsItem"><block s="reportTextSplit"><block var="num"/><l><option>letter</option></l></block><l>-</l></block><l>3</l><l>2</l></block></block></custom-block></block><block var="d"/></block></list></block></block><block s="doWarp"><script><block s="doFor"><l>i</l><block s="reportIfElse"><block s="reportListContainsItem"><block s="reportTextSplit"><block var="num"/><l><option>letter</option></l></block><l>-</l></block><l>3</l><l>2</l></block><block s="reportDifference"><block var="b"/><l>1</l></block><script><block s="doAddToList"><block s="reportProduct"><block s="reportProduct"><block s="reportLetter"><block var="i"/><block var="num"/></block><custom-block s="New 10^ of %n"><block s="reportDifference"><block s="reportDifference"><block var="b"/><l>1</l></block><block var="i"/></block></custom-block></block><block var="d"/></block><block var="a"/></block></script></block></script></block><block s="doWarp"><script><block s="doSetVar"><l>c</l><l>-1</l></block><block s="doFor"><l>i</l><block s="reportSum"><block var="b"/><l>1</l></block><block s="reportStringSize"><block var="num"/></block><script><block s="doAddToList"><block s="reportProduct"><block s="reportProduct"><block s="reportLetter"><block var="i"/><block var="num"/></block><custom-block s="New 10^ of %n"><block var="c"/></custom-block></block><block var="d"/></block><block var="a"/></block><block s="doChangeVar"><l>c</l><l>-1</l></block></script></block></script></block><block s="doIf"><block s="reportEquals"><block var="text/list"/><l>text</l></block><script><block s="doSetVar"><l>a</l><block s="reportCombine"><block var="a"/><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l></l><l> + </l><l></l></list></block></autolambda><list></list></block></block></block></script></block><block s="doReport"><block var="a"/></block></script><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><block s="reportNewList"><list><block s="reportProduct"><block s="reportProduct"><block s="reportLetter"><block s="reportIfElse"><block s="reportListContainsItem"><block s="reportTextSplit"><block var="num"/><l><option>letter</option></l></block><l>-</l></block><l>2</l><l>1</l></block><block var="num"/></block><custom-block s="New 10^ of %n"><block s="reportDifference"><block s="reportStringSize"><block var="num"/></block><block s="reportIfElse"><block s="reportListContainsItem"><block s="reportTextSplit"><block var="num"/><l><option>letter</option></l></block><l>-</l></block><l>2</l><l>1</l></block></block></custom-block></block><block var="d"/></block></list></block></block><block s="doIf"><block s="reportGreaterThan"><block s="reportStringSize"><block var="num"/></block><l>1</l></block><script><block s="doWarp"><script><block s="doFor"><l>i</l><block s="reportIfElse"><block s="reportListContainsItem"><block s="reportTextSplit"><block var="num"/><l><option>letter</option></l></block><l>-</l></block><l>3</l><l>2</l></block><block s="reportStringSize"><block var="num"/></block><script><block s="doAddToList"><block s="reportProduct"><block s="reportProduct"><block s="reportLetter"><block var="i"/><block var="num"/></block><custom-block s="New 10^ of %n"><block s="reportDifference"><block s="reportStringSize"><block var="num"/></block><block var="i"/></block></custom-block></block><block var="d"/></block><block var="a"/></block></script></block></script></block></script></block><block s="doIf"><block s="reportEquals"><block var="text/list"/><l>text</l></block><script><block s="doSetVar"><l>a</l><block s="reportCombine"><block var="a"/><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l></l><l> + </l><l></l></list></block></autolambda><list></list></block></block></block></script></block><block s="doReport"><block var="a"/></block></script></block></script><script><custom-block s="error %txt"><l>Expecting number but getting text</l></custom-block></script></block></script></block-definition><block-definition s="safely try %&apos;action&apos; then if %&apos;error&apos; %&apos;handler&apos;" type="command" category="control"><comment x="0" y="0" w="276" collapsed="false">Catch errors.&#xD;&#xD;Runs the first script.  If it succeeds, nothing else happens.&#xD;But if it has an error (something that would otherwise result&#xD;in a red halo around the block), then the second script is run,&#xD;with the text of the error message that would have been shown in the variable ERROR.</comment><header></header><code></code><translations>pt:tenta executar _ e, em caso de erro _ , executa _&#xD;</translations><inputs><input type="%cs"></input><input type="%upvar"></input><input type="%cs"></input></inputs><script><custom-block s="let %upvar be %s"><l>reset</l><block s="evaluate"><block s="reportJSFunction"><list><l>proc</l></list><l>var oldHandleError = proc.handleError,&#xD;    oldCatchingErrors = proc.isCatchingErrors;&#xD;&#xD;return function(){&#xD; proc.handleError = oldHandleError;&#xD; proc.isCatchingErrors = oldCatchingErrors;&#xD;}</l></block><list></list></block></custom-block><block s="doCallCC"><block s="reifyScript"><script><block s="doRun"><block s="reportJSFunction"><list><l>reset</l><l>action</l><l>handler</l><l>proc</l></list><l>proc.isCatchingErrors = true;&#xD;proc.handleError = function(error, element){&#xD; reset();&#xD; proc.context = handler;&#xD; proc.context.variables.setVar("error", error);&#xD;}&#xD;&#xD;try{&#xD; proc.evaluate(action, new List(), true);&#xD;}&#xD;catch(e){&#xD; proc.handleError(e, null);&#xD;} </l></block><list><block var="reset"/><block var="action"/><block s="reifyScript"><script><block s="doRun"><block s="reifyScript"><script><block s="doRun"><block var="handler"/><list></list></block><block s="doRun"><block var="return"/><list></list></block></script><list></list></block><list></list></block></script><list></list></block></list></block></script><list><l>return</l></list></block></block><block s="doRun"><block var="reset"/><list></list></block></script></block-definition><block-definition s="error %&apos;msg&apos;" type="command" category="control"><comment x="0" y="0" w="268.6666666666667" collapsed="false">Throw an error.&#xD;&#xD;Makes a red halo appear around the script that runs it,&#xD;with the input text shown in a speech balloon next to&#xD;the script, just like any Snap! error.&#xD;&#xD;This is useful to put in the second script of SAFELY TRY&#xD;after some other instructions to undo the partial work of&#xD;the first script.</comment><header></header><code></code><translations>pt:lança o erro _&#xD;</translations><inputs><input type="%txt"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>msg</l></list><l>throw new Error(msg);</l></block><list><block var="msg"/></list></block></script></block-definition><block-definition s="let %&apos;var&apos; be %&apos;val&apos;" type="command" category="other"><comment x="0" y="0" w="183.33333333333334" collapsed="false">LET (FOO) BE (5)&#xD;is equivalent to&#xD;SCRIPT VARIABLES (FOO)&#xD;SET (FOO) TO (5)</comment><header></header><code></code><translations>pt:cria a variável de guião _ com valor _&#xD;</translations><inputs><input type="%upvar"></input><input type="%s"></input></inputs><script><block s="doSetVar"><l>var</l><block var="val"/></block></script></block-definition><block-definition s="safely try reporting %&apos;this&apos; then if %&apos;error&apos; report %&apos;that&apos;" type="reporter" category="control"><comment x="0" y="0" w="316.6666666666667" collapsed="false">Catch errors in a reporter.&#xD;&#xD;Evaluates its first input.  If that expression successfully reports a value, this block reports that value.  If the expression causes a Snap! error,&#xD;then the final input slot is evaluated with the text of what would have&#xD;been the error message in variable ERROR.  SAFELY TRY then reports the value of that final expression.&#xD;&#xD;Sometimes you&apos;ll want to throw an error in the final expression.  You&#xD;can put an ERROR block inside a CALL block to do that.</comment><header></header><code></code><translations></translations><inputs><input type="%anyUE"></input><input type="%upvar"></input><input type="%anyUE"></input></inputs><script><block s="doDeclareVariables"><list><l>value</l></list></block><custom-block s="safely try %cs then if %upvar %cs"><script><block s="doSetVar"><l>value</l><block s="evaluate"><block var="this"/><list></list></block></block></script><l>err</l><script><block s="doSetVar"><l>error</l><block var="err"/></block><block s="doSetVar"><l>value</l><block s="evaluate"><block var="that"/><list></list></block></block></script></custom-block><block s="doReport"><block var="value"/></block></script></block-definition><block-definition s="what is %&apos;thingy&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doIf"><block s="reportIsA"><block var="thingy"/><l><option>number</option></l></block><script><block s="doReport"><l>number</l></block></script></block><block s="doIf"><block s="reportIsA"><block var="thingy"/><l><option>text</option></l></block><script><block s="doReport"><l>text</l></block></script></block><block s="doIf"><block s="reportIsA"><block var="thingy"/><l><option>Boolean</option></l></block><script><block s="doReport"><l>boolean</l></block></script></block><block s="doIf"><block s="reportIsA"><block var="thingy"/><l><option>list</option></l></block><script><block s="doReport"><l>list</l></block></script></block><block s="doIf"><block s="reportIsA"><block var="thingy"/><l><option>sprite</option></l></block><script><block s="doReport"><l>sprite</l></block></script></block><block s="doIf"><block s="reportIsA"><block var="thingy"/><l><option>costume</option></l></block><script><block s="doReport"><l>costume</l></block></script></block><block s="doIf"><block s="reportIsA"><block var="thingy"/><l><option>sound</option></l></block><script><block s="doReport"><l>sound</l></block></script></block><block s="doIf"><block s="reportIsA"><block var="thingy"/><l><option>command</option></l></block><script><block s="doReport"><l>command</l></block></script></block><block s="doIf"><block s="reportIsA"><block var="thingy"/><l><option>reporter</option></l></block><script><block s="doReport"><l>reporter</l></block></script></block><block s="doIf"><block s="reportIsA"><block var="thingy"/><l><option>predicate</option></l></block><script><block s="doReport"><l>predicate</l></block></script></block></script></block-definition><block-definition s="New 10^ of %&apos;exp&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n">1</input></inputs><script><block s="doReport"><block s="reportIfElse"><block s="reportGreaterThanOrEquals"><block var="exp"/><l>0</l></block><block s="reportMonadic"><l><option>10^</option></l><block var="exp"/></block><block s="reportQuotient"><l>1</l><block s="reportMonadic"><l><option>10^</option></l><block s="reportMonadic"><l><option>abs</option></l><block var="exp"/></block></block></block></block></block></script></block-definition><block-definition s="USE BIGNUMS %&apos;bool&apos;" type="command" category="operators"><comment x="0" y="0" w="303.3333333333333" collapsed="false">call with True to turn on the entire Scheme numeric tower, including infinite-precision integers, exact rationals, and complex numbers; call with False to restore native JavaScript arithmetic.</comment><header></header><code></code><translations>pt:altera utilização de aritmética do Scheme para _&#xD;</translations><inputs><input type="%b"></input></inputs><script><block s="doDeclareVariables"><list><l>isDone</l></list></block><block s="doSetVar"><l>isDone</l><block s="evaluate"><block s="reportJSFunction"><list><l>useBigNums</l></list><l>var done = false;&#xD;&#xD;function initialize (callback) {&#xD;    var bigScript = document.createElement(&apos;script&apos;);&#xD;    bigScript.src = &apos;//snap.berkeley.edu/snap/libraries/biginteger.js&apos;;&#xD;    bigScript.onload = loadScheme;&#xD;    document.head.appendChild(bigScript);&#xD;&#xD;    function loadScheme () {&#xD;        var schemeScript = document.createElement(&apos;script&apos;);&#xD;        schemeScript.src = &apos;//snap.berkeley.edu/snap/libraries/schemeNumber.js&apos;;&#xD;        schemeScript.onload = finish;&#xD;        document.head.appendChild(schemeScript);&#xD;    }&#xD;&#xD;    function finish () {&#xD;        makeGlobalObject();&#xD;        callback();&#xD;    }&#xD;}&#xD;&#xD;function makeGlobalObject () {&#xD;    window.bigNumbers = {&#xD;        originalEvaluate: InputSlotMorph.prototype.evaluate,&#xD;        originalChangeVar: VariableFrame.prototype.changeVar,&#xD;        originalPrims: {&#xD;            reportBasicSum: Process.prototype.reportBasicSum,&#xD;            reportBasicDifference: Process.prototype.reportBasicDifference,&#xD;            reportBasicProduct: Process.prototype.reportBasicProduct,&#xD;            reportBasicQuotient: Process.prototype.reportBasicQuotient,&#xD;            reportBasicPower: Process.prototype.reportBasicPower,&#xD;            reportBasicModulus: Process.prototype.reportBasicModulus,&#xD;            reportBasicRandom: Process.prototype.reportBasicRandom,&#xD;            reportBasicLessThan: Process.prototype.reportBasicLessThan,&#xD;            reportBasicGreaterThan: Process.prototype.reportBasicGreaterThan,&#xD;            reportEquals: Process.prototype.reportEquals,&#xD;            reportIsIdentical: Process.prototype.reportIsIdentical,&#xD;            reportMonadic: Process.prototype.reportMonadic&#xD;        }&#xD;    };&#xD;}&#xD;&#xD;function loadBlocks () {&#xD;    var fn = SchemeNumber.fn;&#xD;    var originalPrims = window.bigNumbers.originalPrims;&#xD;    if (useBigNums) {&#xD;        InputSlotMorph.prototype.evaluate = function () {&#xD;            var contents = this.contents();&#xD;            if (this.constant) {&#xD;                return this.constant;&#xD;            }&#xD;            if (this.isNumeric) {&#xD;                return parseNumber(contents.text || &apos;0&apos;);&#xD;            }&#xD;            return contents.text;&#xD;        };&#xD;        VariableFrame.prototype.changeVar = function (name, delta, sender) {&#xD;            var frame = this.find(name),&#xD;                value,&#xD;                newValue;&#xD;            if (frame) {&#xD;                value = parseNumber(frame.vars[name].value);&#xD;                newValue = Number.isNaN(value) ? delta : fn[&apos;+&apos;](value, parseNumber(delta));&#xD;                if (sender instanceof SpriteMorph &amp;&amp;&#xD;                        (frame.owner instanceof SpriteMorph) &amp;&amp;&#xD;                        (sender !== frame.owner)) {&#xD;                    sender.shadowVar(name, newValue);&#xD;                } else {&#xD;                    frame.vars[name].value = newValue;&#xD;                }&#xD;&#xD;            }&#xD;        };&#xD;        Object.assign(Process.prototype, {&#xD;            reportBasicSum: function (a, b) {&#xD;                a = parseNumber(a);&#xD;                b = parseNumber(b);&#xD;                if (Number.isNaN(a) || Number.isNaN(b)) return NaN;&#xD;                return fn[&apos;+&apos;](a, b);&#xD;            },&#xD;            reportBasicDifference: function (a, b) {&#xD;                a = parseNumber(a);&#xD;                b = parseNumber(b);&#xD;                if (Number.isNaN(a) || Number.isNaN(b)) return NaN;&#xD;                return fn[&apos;-&apos;](a, b);&#xD;            },&#xD;            reportBasicProduct: function (a, b) {&#xD;                a = parseNumber(a);&#xD;                b = parseNumber(b);&#xD;                if (Number.isNaN(a) || Number.isNaN(b)) return NaN;&#xD;                return fn[&apos;*&apos;](a, b);&#xD;            },&#xD;            reportBasicQuotient: function (a, b) {&#xD;                a = parseNumber(a);&#xD;                b = parseNumber(b);&#xD;                if (fn[&apos;=&apos;](b, &apos;0&apos;) &amp;&amp; !fn[&apos;=&apos;](a, &apos;0&apos;)) {&#xD;                      return (fn[&apos;&lt;&apos;](a, &apos;0&apos;) ? SchemeNumber(&apos;-inf.0&apos;) : SchemeNumber(&apos;+inf.0&apos;))&#xD;                };&#xD;                if (Number.isNaN(a) || Number.isNaN(b) || fn[&apos;=&apos;](b, &apos;0&apos;)) return NaN;&#xD;                return fn[&apos;/&apos;](a, b);&#xD;            },&#xD;            reportBasicPower: function (a, b) {&#xD;                a = parseNumber(a);&#xD;                b = parseNumber(b);&#xD;                if (Number.isNaN(a) || Number.isNaN(b)) return NaN;&#xD;                return fn[&apos;expt&apos;](a, b);&#xD;            },&#xD;            reportBasicModulus: function (a, b) {&#xD;                a = parseNumber(a);&#xD;                b = parseNumber(b);&#xD;                if (Number.isNaN(a) || Number.isNaN(b)) return NaN;&#xD;                var result = fn.mod(a, b);&#xD;                if (fn[&apos;&lt;&apos;](b, &apos;0&apos;) &amp;&amp; fn[&apos;&gt;&apos;](result, &apos;0&apos;)) {&#xD;                    result = fn[&apos;+&apos;](result, b);&#xD;                }&#xD;                return result;&#xD;            },&#xD;            reportBasicRandom: function (min, max) {&#xD;                var floor = parseNumber(min),&#xD;                    ceil = parseNumber(max);&#xD;                if (Number.isNaN(floor) || Number.isNaN(ceil)) return NaN;&#xD;                if (!fn[&apos;=&apos;](fn.mod(floor, &apos;1&apos;), &apos;0&apos;) || !fn[&apos;=&apos;](fn.mod(ceil, &apos;1&apos;), &apos;0&apos;)) {&#xD;                    // One of the numbers isn&apos;t whole. Include the decimal.&#xD;                    return fn[&apos;+&apos;](&#xD;                        fn[&apos;*&apos;](&#xD;                            Math.random(),&#xD;                            fn[&apos;-&apos;](ceil, floor)&#xD;                        ),&#xD;                        floor&#xD;                    );&#xD;                }&#xD;                return fn.floor(&#xD;                    fn[&apos;+&apos;](&#xD;                        fn[&apos;*&apos;](&#xD;                            Math.random(),&#xD;                            fn[&apos;+&apos;](&#xD;                                fn[&apos;-&apos;](ceil, floor),&#xD;                                &apos;1&apos;&#xD;                            )&#xD;                        ),&#xD;                        floor&#xD;                    )&#xD;                );&#xD;            },&#xD;            reportBasicLessThan: function (a, b) {&#xD;                a = parseNumber(a);&#xD;                b = parseNumber(b);&#xD;                if (Number.isNaN(a) || Number.isNaN(b)) return NaN;&#xD;                return fn[&apos;&lt;&apos;](a, b);&#xD;            },&#xD;            reportBasicGreaterThan: function (a, b) {&#xD;                a = parseNumber(a);&#xD;                b = parseNumber(b);&#xD;                if (Number.isNaN(a) || Number.isNaN(b)) return NaN;&#xD;                return fn[&apos;&gt;&apos;](a, b);&#xD;            },&#xD;            reportEqual: function (a, b) {&#xD;                x = parseNumber(a);&#xD;                y = parseNumber(b);&#xD;                if (Number.isNaN(x) || Number.isNaN(y)) return snapEquals(a, b);&#xD;                return fn[&apos;=&apos;](x, y);&#xD;            },&#xD;            reportIsIdentical: function (a, b) {&#xD;                x = parseNumber(a);&#xD;                y = parseNumber(b);&#xD;                if (Number.isNaN(x) || Number.isNaN(y)) return originalPrims.reportIsIdentical(a, b);&#xD;                return fn[&apos;=&apos;](x, y);&#xD;            },&#xD;            reportMonadic: function (fname, n) {&#xD;                if (this.enableHyperOps) {&#xD;                    if (n instanceof List) {&#xD;                        return n.map(each =&gt; this.reportMonadic(fname, each));&#xD;                    }&#xD;                }&#xD;&#xD;                n = parseNumber(n);&#xD;                if (Number.isNaN(n)) return NaN;&#xD;&#xD;                switch (Process.prototype.inputOption(fname)) {&#xD;                case &apos;abs&apos;:&#xD;                    return fn.abs(n);&#xD;                case &apos;neg&apos;:&#xD;                    return fn[&apos;-&apos;](n);&#xD;                case &apos;ceiling&apos;:&#xD;                    return fn.ceiling(n);&#xD;                case &apos;floor&apos;:&#xD;                    return fn.floor(n);&#xD;                case &apos;sqrt&apos;:&#xD;                    return sqrt(n);&#xD;                case &apos;sin&apos;:&#xD;                    return fn.sin(radians(n));&#xD;                case &apos;cos&apos;:&#xD;                    return fn.cos(radians(n));&#xD;                case &apos;tan&apos;:&#xD;                    return fn.tan(radians(n));&#xD;                case &apos;asin&apos;:&#xD;                    return degrees(fn.asin(n));&#xD;                case &apos;acos&apos;:&#xD;                    return degrees(fn.acos(n));&#xD;                case &apos;atan&apos;:&#xD;                    return degrees(fn.atan(n));&#xD;                case &apos;ln&apos;:&#xD;                    return fn.log(n);&#xD;                case &apos;log&apos;:&#xD;                    return fn.log(n, &apos;10&apos;);&#xD;                case &apos;lg&apos;:&#xD;                    return fn.log(n, &apos;2&apos;);&#xD;                case &apos;e^&apos;:&#xD;                    return fn.exp(n);&#xD;                case &apos;10^&apos;:&#xD;                    return fn.expt(&apos;10&apos;, n);&#xD;                case &apos;2^&apos;:&#xD;                    return fn.expt(&apos;2&apos;, n);&#xD;                default:&#xD;                    return SchemeNumber(&apos;0&apos;);&#xD;                }&#xD;            }&#xD;        });&#xD;    } else {&#xD;        InputSlotMorph.prototype.evaluate = window.bigNumbers.originalEvaluate;&#xD;        VariableFrame.prototype.changeVar = window.bigNumbers.originalChangeVar;&#xD;        Object.assign(Process.prototype, originalPrims);&#xD;    }&#xD;    done = true;&#xD;}&#xD;&#xD;function parseNumber (n) {&#xD;    var fn = SchemeNumber.fn;&#xD;    if (!fn[&apos;number?&apos;](n)) {&#xD;        n = &apos;&apos; + n;&#xD;        try {&#xD;            return parseENotation(n) || SchemeNumber(n);&#xD;        } catch (err) {&#xD;            return NaN;&#xD;        }&#xD;    }&#xD;    return n;&#xD;}&#xD;&#xD;function parseENotation (n) {&#xD;    var fn = SchemeNumber.fn;&#xD;&#xD;    var numbers = n.match(/^(-?\d+\.?\d*|-?\.\d+)e(-?\d+)$/i);&#xD;    if (!numbers) return null;&#xD;&#xD;    var coefficient = numbers[1];&#xD;    var exponent = numbers[2];&#xD;    return fn[&apos;*&apos;](&#xD;        coefficient,&#xD;        fn.expt(&apos;10&apos;, exponent)&#xD;    );&#xD;}&#xD;&#xD;function sqrt (n) {&#xD;    var fn = SchemeNumber.fn;&#xD;&#xD;    if (!fn[&apos;exact?&apos;](n) || !fn[&apos;rational?&apos;](n) || fn[&apos;&lt;&apos;](n,&apos;0&apos;)) return fn.sqrt(n);&#xD;&#xD;    var rootNumerator = fn[&apos;exact-integer-sqrt&apos;](fn.numerator(n));&#xD;    if (!fn[&apos;=&apos;](rootNumerator[1], &apos;0&apos;)) return fn.sqrt(n);&#xD;&#xD;    var rootDenominator = fn[&apos;exact-integer-sqrt&apos;](fn.denominator(n));&#xD;    if (!fn[&apos;=&apos;](rootDenominator[1], &apos;0&apos;)) return fn.sqrt(n);&#xD;&#xD;    return fn[&apos;/&apos;](rootNumerator[0], rootDenominator[0]);&#xD;}&#xD;&#xD;function isDone () {&#xD;    return done;&#xD;}&#xD;&#xD;if (window.bigNumbers) {&#xD;    loadBlocks();&#xD;} else {&#xD;    initialize(loadBlocks);&#xD;}&#xD;&#xD;return isDone;</l></block><list><block var="bool"/></list></block></block><block s="doWaitUntil"><block s="evaluate"><block var="isDone"/><list></list></block></block></script></block-definition><block-definition s="%&apos;n&apos; !" type="reporter" category="operators"><comment x="0" y="0" w="190.66666666666666" collapsed="false">The factorial function, to make very large numbers, to demo bignums.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportIfElse"><block s="reportEquals"><block var="n"/><l>0</l></block><l>1</l><block s="reportProduct"><block var="n"/><custom-block s="%n !"><block s="reportDifference"><block var="n"/><l>1</l></block></custom-block></block></block></block></script></block-definition><block-definition s="%&apos;x&apos;" type="reporter" category="operators"><comment x="0" y="0" w="234.66666666666666" collapsed="false">The identity function: reports its input.&#xD;It&apos;s useful to get things like 3/4 or 5-2i into&#xD;numeric input slots.</comment><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="Scheme number %&apos;function&apos; of %&apos;number&apos;" type="reporter" category="operators"><comment x="0" y="0" w="300" collapsed="true">Provides Scheme arithmetic functions not in JavaScript</comment><header></header><code></code><translations>pt:_ de _&#xD;</translations><inputs><input type="%s" readonly="true"><options>number?&#xD;complex?&#xD;real?&#xD;rational?&#xD;integer?&#xD;exact?&#xD;inexact?&#xD;exact&#xD;inexact&#xD;finite?&#xD;infinite?&#xD;nan?&#xD;numerator&#xD;denominator&#xD;real-part&#xD;imag-part&#xD;magnitude&#xD;angle</options></input><input type="%s"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>which</l><l>num</l></list><l>function parseNumber (n) {&#xD;    var fn = SchemeNumber.fn;&#xD;    if (!fn[&apos;number?&apos;](n)) {&#xD;        n = &apos;&apos; + n;&#xD;        try {&#xD;            return parseENotation(n) || SchemeNumber(n);&#xD;        } catch (err) {&#xD;            return NaN;&#xD;        }&#xD;    }&#xD;    return n;&#xD;}&#xD;&#xD;function parseENotation (n) {&#xD;    var fn = SchemeNumber.fn;&#xD;&#xD;    var numbers = n.match(/^(-?\d+\.?\d*|-?\.\d+)e(-?\d+)$/i);&#xD;    if (!numbers) return null;&#xD;&#xD;    var coefficient = numbers[1];&#xD;    var exponent = numbers[2];&#xD;    return fn[&apos;*&apos;](&#xD;        coefficient,&#xD;        fn.expt(&apos;10&apos;, exponent)&#xD;    );&#xD;}&#xD;var fn=SchemeNumber.fn,&#xD;      number=parseNumber(num);&#xD;&#xD;switch (which) {&#xD;  case &apos;number?&apos;:&#xD;  case &apos;complex?&apos;:&#xD;    return (fn[&apos;number?&apos;](number));&#xD;  case &apos;real?&apos;:&#xD;    return (fn[&apos;real?&apos;](number) || fn[&apos;real-valued?&apos;](number));&#xD;  case &apos;rational?&apos;:&#xD;    return (fn[&apos;rational?&apos;](number) || (fn[&apos;=&apos;](number, fn.rationalize(number, parseNumber(&apos;1.0e-5&apos;)))));&#xD;  case &apos;integer?&apos;:&#xD;    return (fn[&apos;integer?&apos;](number) || fn[&apos;integer-valued?&apos;](number));&#xD;  case &apos;exact?&apos;:&#xD;  case &apos;inexact?&apos;:&#xD;  case &apos;finite?&apos;:&#xD;  case &apos;infinite?&apos;:&#xD;  case &apos;nan?&apos;:&#xD;  case &apos;real-part&apos;:&#xD;  case &apos;imag-part&apos;:&#xD;    return (fn[which](number));&#xD;  case &apos;magnitude&apos;:&#xD;    return (fn.magnitude(number));&#xD;  case &apos;angle&apos;:&#xD;    return (fn.angle(number));&#xD;  case &apos;numerator&apos;:&#xD;    return (fn.numerator(number));&#xD;  case &apos;denominator&apos;:&#xD;    return (fn.denominator(number));&#xD;  case &apos;exact&apos;:&#xD;    return (fn.exact(number));&#xD;case &apos;inexact&apos;:&#xD;    return (fn.inexact(number));&#xD;}</l></block><list><block var="function"/><block var="number"/></list></block></block></script></block-definition></blocks><variables></variables></project><media name="Numbers in expanded form!" app="Snap! 6, https://snap.berkeley.edu" version="1"></media></snapdata>