<snapdata remixID="9404077"><project name="Bubble Sort Lesson - piece by piece" app="Snap! 5.4, http://snap.berkeley.edu" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAADk0lEQVR4nO3cP0iUcRzH8UdCtMyUXMKCQoqwqQwVIQIj819DRC5peBIiCSVaZNoRNFTwIEkOuejWIkKLnqLgnIN0IIeDgqOLq4Mg3LfpxOu81Hye+zx47xd81+/3Gd4ot/wcA4Qc9QcguxEgpAgQUgQIKQKEFAFCigAhRYCQIkBIESCkCBBSBAgpAoQUAeJAsVjMt90EiENxVhrNWWm02y/qLB6Pe7fXs0040aampnYjTEzJdJMNDAwcK0gCxKEVLTSnRJiYgrc3bX19/cg7CRCHcrqrPCm4M2N3bGJi4th7CRAH6u7vseKFZnv1vs/z3QQIKQKEFAFCigAhRYCQIkBIESCkCBBSBAgpAoQUAUKKACFFgJAiQEgRIKQIEFIEiBSRSMTa2jszcosAsa+rFQ3m1AybUzNs56p6bXR01Jc7BIi0zlb370a4d05dbrKlpSVPbhAg0iqq6iNAaFyvuLcbXEFVv3399t2XOwSIFJFIxB497c7ILQKEFAFCigAhRYCQkga4urpqzxtKbGNjI2M3C6enLT8ctpmZmYzdRHryv4BbW1sWG3J2p7OtyfebTjSaNKWtrba5uen7XaSSB2hmNjIykhRhYn68Pm+u6/py8+8IE5MTjVplba0vN5Eq0AH+fFdkw+5Hz+/lh8Mp4eUODtrc/Lznt/Bv8gD3/gv+7ebZy/Y6X+/Vd3SYE41a8eSkhV3X0+dmcXTyHyEDLUUZ+xGytrZGcAEj/wuI7EaAkCJASBEgpAgQUgQIKQKEFAFCigAhRYCQIkBIESCkCBBSBAgpAoQUAUKKACFFgJAiQEgRIKQIEFIECCkChBQBQooAIUWAkCJASBEgpAgQUoEKsHCo3PLbL/J8bhYJVIBmZs5YWdKUNl/j+dwTLHABmqVGmJicsTKrvFut/rysMTs76/t7ioELMD90KSW83GcXbG5+Tv1pWclxQ+a4Ict5cMt+LS56v9/zjcdQ39pszliZFX+6YeHPH3jNNCASEe6d8oe1trOzc/zdHnyfJ3g+N7i63/TuG6Hjhqyg77GNj4//9+7ABIhgWl5eTgou70vIWnq6PNtPgEgrHo+b44bsypP7tr297csNAoQUAUKKACFFgJAiQEgRIKQIEFIECCkChBQBQooAIUWAkCJASBEgpAgQUgQIKQKEFAFCigAhRYCQIkBIESCkCBBSBAgpAoQUAUKKACFFgJAiQEgRIKQIEFJ/AFS6sixBZCy3AAAAAElFTkSuQmCC</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" codify="false" inheritance="true" sublistIDs="false" scheduled="false" id="1"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAACtUlEQVR4nO3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+Bo3+AAF/RMkcAAAAAElFTkSuQmCC</pentrails><costumes><list id="2"><item><costume name="Untitled" center-x="201" center-y="180" image="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAOdUlEQVR4nO3cQW5cRxIE0F7St9BRdCTfkEfRSjNc+A6aFYGGRiJDyabjV9V7QC4NdAcqM2w3pNuNd327ffn6Oi+3v/5O5v6fuZ/2d+E6vA2Ad/zn9vTjUdP+LlzHz2/jd//SpqSBYylgPoP3A/AOBcxn8H4A3qGA+QzeD8A7FDAf9avfc39+G9+D8TswcBQFzEd5QwADjicf5Q0BDDiefJQ3BDDgePJR3hDAgOPJR3lDAAOOJx/lDQEMOJ58lDcEMOB48lHeEMCA48lHvdyenn+eyft5uT09t78LwL9GAfMZvB+AdyhgPsPkv4TbnxngX6WA+UzeD8BvTH63+9Vvfn6/41cUMEDAoeTRFDBAwKHk0RQwQMCh5NEUMEDAoeTRFDBAwKHk0RQwQMCh5NGWKeD/fvm6xQBrWuJQspRlCvifpx9bDLCmJQ4lS1HAChgILHEoWYoCVsBAYIlDyVIUsAIGAkscSpaigBUwEFjiULIUBayAgcASh5KlKGAFDASWOJQsRQErYCCwxKFkKQpYAQOBJQ4lS1HAChgILHEoWYoCVsBAYIlDyVIUsAIGAkscSpaigBU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AgQIGgAIFDAAFL7en50dM+3twpv8BNv2pSb+eAqQAAAAASUVORK5CYII=" id="3"/></item></list></costumes><sounds><list struct="atomic" id="4"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites><sprite name="Example Blocks" idx="1" x="-106" y="-71" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="0,155.54999999999998,34.22099999999996,1" pen="tip" id="9"><costumes><list id="10"><item><costume name="Untitled" center-x="240" center-y="180" image="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAACtUlEQVR4nO3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+Bo3+AAF/RMkcAAAAAElFTkSuQmCC" id="11"/></item></list></costumes><sounds><list struct="atomic" id="12"></list></sounds><blocks></blocks><variables></variables><scripts><script x="17" y="92"><block s="doSetVar"><l>test list</l><custom-block s="create random list of # %s ABC strings of length %s"><l>10</l><l>1</l></custom-block><comment w="215" collapsed="false">This block creates a list of strings of letters and numbers.  You can set how many items in the list, and how long each item is.  The list is unsorted.  It must be sorted before it can be searched using anything other than sequential search&#xD;&#xD;I made 5 different versions of the list and string creation blocks!&#xD;&#xD;此块创建字母和数字字符串的列表。 您可以设置列表中的项数以及每个项目的时间长。 列表未排序。 必须先对它进行排序，然后才能使用顺序搜索以外的任何内容进行搜索&#xD;&#xD;我做了5个不同的版本的列表和字符串创建块！</comment></block></script><script x="24" y="153"><custom-block s="bubblesort list %s"><block var="test list"/><comment w="241" collapsed="false">This block sorts the list using bubblesort. It can be very slow. &#xD;此块使用气泡排序对列表进行排序。它可以非常缓慢。 </comment></custom-block></script></scripts></sprite><sprite name="Task 1" idx="2" x="196" y="-79" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="0,137.70000000000002,96.39000000000003,1" pen="tip" id="24"><costumes><list struct="atomic" id="25"></list></costumes><sounds><list struct="atomic" id="26"></list></sounds><blocks></blocks><variables></variables><scripts><comment x="43" y="37" w="149" collapsed="false">Let&apos;s do the things that make up bubble sort!</comment><script x="54" y="133"><custom-block s="Variable Switcher"><comment w="90" collapsed="false">Edit this block&#xD;编辑此块</comment></custom-block></script></scripts></sprite><sprite name="Task 3" idx="4" x="201" y="128" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="0,214.2,72.82799999999996,1" pen="tip" id="31"><costumes><list struct="atomic" id="32"></list></costumes><sounds><list struct="atomic" id="33"></list></sounds><blocks></blocks><variables></variables><scripts><script x="108" y="117"><custom-block s="Conditional List Item Switcher"><comment w="90" collapsed="false">Edit this block&#xD;编辑此块</comment></custom-block></script></scripts></sprite><sprite name="Task 4" idx="5" x="190" y="63" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="0,57.120000000000054,142.8,1" pen="tip" id="38"><costumes><list struct="atomic" id="39"></list></costumes><sounds><list struct="atomic" id="40"></list></sounds><blocks></blocks><variables></variables><scripts><script x="95" y="119"><custom-block s="Sort 3 Item List"><comment w="90" collapsed="false">Edit this block&#xD;编辑此块</comment></custom-block></script></scripts></sprite><sprite name="Task 5" idx="6" x="-31" y="34" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="0,206.55,206.55,1" pen="tip" id="45"><costumes><list struct="atomic" id="46"></list></costumes><sounds><list struct="atomic" id="47"></list></sounds><blocks></blocks><variables></variables><scripts><script x="134" y="135"><custom-block s="Complete Sort Block"><comment w="90" collapsed="false">Edit this block&#xD;编辑此块</comment></custom-block></script></scripts></sprite><sprite name="Task 2" idx="3" x="-115" y="33" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="211.64999999999998,139.689,0,1" pen="tip" id="52"><costumes><list struct="atomic" id="53"></list></costumes><sounds><list struct="atomic" id="54"></list></sounds><blocks></blocks><variables></variables><scripts><script x="104" y="113"><custom-block s="List Item Switcher"><comment w="90" collapsed="false">Edit this block&#xD;编辑此块</comment></custom-block></script></scripts></sprite><watcher var="sorted list" style="normal" x="10.062499999999773" y="0" color="243,118,29" hidden="true"/><watcher var="test list" style="normal" x="21" y="44.00000399999999" color="243,118,29" hidden="true"/></sprites></stage><hidden></hidden><headers></headers><code></code><blocks><block-definition s="设置点" type="command" category="motion"><header></header><code></code><translations></translations><inputs></inputs><script><block s="setHeading"><l>90</l></block><block s="clear"></block><block s="gotoXY"><l>190</l><l>-150</l></block><block s="doSwitchToCostume"><l>Untitled(2)</l></block><block s="doStamp"></block><block s="doSwitchToCostume"><l><option>Turtle</option></l></block><block s="gotoXY"><l>0</l><l>0</l></block></script></block-definition><block-definition s="sorted list" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doReport"><block s="reportNewList"><list><block s="reportNewList"><list><l></l><l></l></list></block></list></block></block></script></block-definition><block-definition s="randomstring length %&apos;length&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><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>a</l><block s="reportNewList"><list><l></l></list></block></block><block s="doDeleteFromList"><l><option>all</option></l><block var="a"/></block><block s="doRepeat"><block var="length"/><script><block s="doAddToList"><block s="reportLetter"><block s="reportRandom"><l>1</l><l>95</l></block><l>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPWQRSTUVWXYZ1234567890!@#$%^&amp;*()-=[]\;&apos;./,&lt;&gt;?:"{}|_+`&#126;</l></block><block var="a"/></block></script></block><block s="doSetVar"><l>c</l><l>2</l></block><block s="doSetVar"><l>b</l><block s="reportListItem"><l>1</l><block var="a"/></block></block><block s="doRepeat"><block s="reportDifference"><block var="length"/><l>1</l></block><script><block s="doSetVar"><l>b</l><block s="reportJoinWords"><list><block var="b"/><block s="reportListItem"><block var="c"/><block var="a"/></block></list></block></block><block s="doChangeVar"><l>c</l><l>1</l></block></script></block><block s="doReport"><block var="b"/></block></script></block-definition><block-definition s="randomstring letters only length %&apos;length&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><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>a</l><block s="reportNewList"><list><l></l></list></block></block><block s="doDeleteFromList"><l><option>all</option></l><block var="a"/></block><block s="doRepeat"><block var="length"/><script><block s="doAddToList"><block s="reportLetter"><block s="reportRandom"><l>1</l><l>52</l></block><l>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPWQRSTUVWXYZ</l></block><block var="a"/></block></script></block><block s="doSetVar"><l>c</l><l>2</l></block><block s="doSetVar"><l>b</l><block s="reportListItem"><l>1</l><block var="a"/></block></block><block s="doRepeat"><block s="reportDifference"><block var="length"/><l>1</l></block><script><block s="doSetVar"><l>b</l><block s="reportJoinWords"><list><block var="b"/><block s="reportListItem"><block var="c"/><block var="a"/></block></list></block></block><block s="doChangeVar"><l>c</l><l>1</l></block></script></block><block s="doReport"><block var="b"/></block></script></block-definition><block-definition s="binary search list %&apos;list&apos; term %&apos;term&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>min</l><l>max</l><l>midpoint</l></list></block><block s="doSetVar"><l>min</l><l>0</l></block><block s="doSetVar"><l>max</l><block s="reportListLength"><block var="list"/></block></block><block s="doForever"><script><block s="doSetVar"><l>midpoint</l><block s="reportRound"><block s="reportQuotient"><block s="reportSum"><block var="min"/><block var="max"/></block><l>2</l></block></block></block><block s="doIfElse"><block s="reportEquals"><block var="min"/><block var="max"/></block><script><block s="doIfElse"><block s="reportEquals"><block var="term"/><block s="reportListItem"><block var="midpoint"/><block var="list"/></block></block><script><block s="doReport"><block var="midpoint"/></block></script><script><block s="doReport"><l>0</l></block></script></block></script><script><block s="doIf"><block s="reportEquals"><block var="term"/><block s="reportListItem"><block var="midpoint"/><block var="list"/></block></block><script><block s="doReport"><block var="midpoint"/></block></script></block><block s="doIf"><block s="reportGreaterThan"><block var="term"/><block s="reportListItem"><block var="midpoint"/><block var="list"/></block></block><script><block s="doSetVar"><l>min</l><block s="reportSum"><block var="midpoint"/><l>1</l></block></block></script></block><block s="doIf"><block s="reportLessThan"><block var="term"/><block s="reportListItem"><block var="midpoint"/><block var="list"/></block></block><script><block s="doSetVar"><l>max</l><block s="reportDifference"><block var="midpoint"/><l>1</l></block></block></script></block></script></block></script></block></script><scripts><comment x="387" y="20.200000000000045" w="90" collapsed="false">reports item containign search term</comment></scripts></block-definition><block-definition s="ask answer and add to list list %&apos;list&apos;" type="command" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doAsk"><l>what&apos;s your name?</l></block><block s="doAddToList"><block s="getLastAnswer"></block><block var="list"/></block></script></block-definition><block-definition s="create random string ABCabc length %&apos;length&apos;" type="reporter" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>tempstring</l><l>templist</l><l>counter</l></list></block><block s="doSetVar"><l>templist</l><block s="reportNewList"><list><l></l></list></block></block><block s="doDeleteFromList"><l><option>all</option></l><block var="templist"/></block><block s="doRepeat"><block var="length"/><script><block s="doInsertInList"><block s="reportLetter"><block s="reportRandom"><l>1</l><l>52</l></block><l>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</l></block><l><option>last</option></l><block var="templist"/></block><block s="doSetVar"><l>tempstring</l><block s="reportListItem"><l>1</l><block var="templist"/></block></block><block s="doSetVar"><l>counter</l><l>2</l></block></script></block><block s="doRepeat"><block s="reportDifference"><block s="reportListLength"><block var="templist"/></block><l>1</l></block><script><block s="doSetVar"><l>tempstring</l><block s="reportJoinWords"><list><block var="tempstring"/><block s="reportListItem"><block var="counter"/><block var="templist"/></block></list></block></block><block s="doChangeVar"><l>counter</l><l>1</l></block></script></block><block s="doReport"><block var="tempstring"/></block></script></block-definition><block-definition s="create random string abc length %&apos;length&apos;" type="reporter" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>tempstring</l><l>templist</l><l>counter</l></list></block><block s="doSetVar"><l>templist</l><block s="reportNewList"><list><l></l></list></block></block><block s="doDeleteFromList"><l><option>all</option></l><block var="templist"/></block><block s="doRepeat"><block var="length"/><script><block s="doInsertInList"><block s="reportLetter"><block s="reportRandom"><l>1</l><l>26</l></block><l>abcdefghijklmnopqrstuvwxyz</l></block><l><option>last</option></l><block var="templist"/></block><block s="doSetVar"><l>tempstring</l><block s="reportListItem"><l>1</l><block var="templist"/></block></block><block s="doSetVar"><l>counter</l><l>2</l></block></script></block><block s="doRepeat"><block s="reportDifference"><block s="reportListLength"><block var="templist"/></block><l>1</l></block><script><block s="doSetVar"><l>tempstring</l><block s="reportJoinWords"><list><block var="tempstring"/><block s="reportListItem"><block var="counter"/><block var="templist"/></block></list></block></block><block s="doChangeVar"><l>counter</l><l>1</l></block></script></block><block s="doReport"><block var="tempstring"/></block></script></block-definition><block-definition s="create random string ABC length %&apos;length&apos;" type="reporter" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>tempstring</l><l>templist</l><l>counter</l></list></block><block s="doSetVar"><l>templist</l><block s="reportNewList"><list><l></l></list></block></block><block s="doDeleteFromList"><l><option>all</option></l><block var="templist"/></block><block s="doRepeat"><block var="length"/><script><block s="doInsertInList"><block s="reportLetter"><block s="reportRandom"><l>1</l><l>26</l></block><l>ABCDEFGHIJKLMNOPQRSTUVWXYZ</l></block><l><option>last</option></l><block var="templist"/></block><block s="doSetVar"><l>tempstring</l><block s="reportListItem"><l>1</l><block var="templist"/></block></block><block s="doSetVar"><l>counter</l><l>2</l></block></script></block><block s="doRepeat"><block s="reportDifference"><block s="reportListLength"><block var="templist"/></block><l>1</l></block><script><block s="doSetVar"><l>tempstring</l><block s="reportJoinWords"><list><block var="tempstring"/><block s="reportListItem"><block var="counter"/><block var="templist"/></block></list></block></block><block s="doChangeVar"><l>counter</l><l>1</l></block></script></block><block s="doReport"><block var="tempstring"/></block></script></block-definition><block-definition s="create random string ABCabc123 length %&apos;length&apos;" type="reporter" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>tempstring</l><l>templist</l><l>counter</l></list></block><block s="doSetVar"><l>templist</l><block s="reportNewList"><list><l></l></list></block></block><block s="doDeleteFromList"><l><option>all</option></l><block var="templist"/></block><block s="doRepeat"><block var="length"/><script><block s="doInsertInList"><block s="reportLetter"><block s="reportRandom"><l>1</l><l>62</l></block><l>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890</l></block><l><option>last</option></l><block var="templist"/></block><block s="doSetVar"><l>tempstring</l><block s="reportListItem"><l>1</l><block var="templist"/></block></block><block s="doSetVar"><l>counter</l><l>2</l></block></script></block><block s="doRepeat"><block s="reportDifference"><block s="reportListLength"><block var="templist"/></block><l>1</l></block><script><block s="doSetVar"><l>tempstring</l><block s="reportJoinWords"><list><block var="tempstring"/><block s="reportListItem"><block var="counter"/><block var="templist"/></block></list></block></block><block s="doChangeVar"><l>counter</l><l>1</l></block></script></block><block s="doReport"><block var="tempstring"/></block></script></block-definition><block-definition s="create random string 123 length %&apos;length&apos;" type="reporter" category="variables"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>tempstring</l><l>templist</l><l>counter</l></list></block><block s="doSetVar"><l>templist</l><block s="reportNewList"><list><l></l></list></block></block><block s="doDeleteFromList"><l><option>all</option></l><block var="templist"/></block><block s="doRepeat"><block var="length"/><script><block s="doInsertInList"><block s="reportLetter"><block s="reportRandom"><l>1</l><l>10</l></block><l>1234567890</l></block><l><option>last</option></l><block var="templist"/></block><block s="doSetVar"><l>tempstring</l><block s="reportListItem"><l>1</l><block var="templist"/></block></block><block s="doSetVar"><l>counter</l><l>2</l></block></script></block><block s="doRepeat"><block s="reportDifference"><block s="reportListLength"><block var="templist"/></block><l>1</l></block><script><block s="doSetVar"><l>tempstring</l><block s="reportJoinWords"><list><block var="tempstring"/><block s="reportListItem"><block var="counter"/><block var="templist"/></block></list></block></block><block s="doChangeVar"><l>counter</l><l>1</l></block></script></block><block s="doReport"><block var="tempstring"/></block></script></block-definition><block-definition s="create random list of # %&apos;number&apos; ABCabc strings of length %&apos;length&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>list</l></list></block><block s="doSetVar"><l>list</l><block s="reportNewList"><list><l></l></list></block></block><block s="doDeleteFromList"><l><option>all</option></l><block var="list"/></block><block s="doRepeat"><block var="number"/><script><block s="doInsertInList"><custom-block s="create random string ABCabc length %s"><block var="length"/></custom-block><l>1</l><block var="list"/></block></script></block><block s="doReport"><block var="list"/></block></script></block-definition><block-definition s="create random list of # %&apos;number&apos; ABC strings of length %&apos;length&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>list</l></list></block><block s="doSetVar"><l>list</l><block s="reportNewList"><list><l></l></list></block></block><block s="doDeleteFromList"><l><option>all</option></l><block var="list"/></block><block s="doRepeat"><block var="number"/><script><block s="doInsertInList"><custom-block s="create random string ABC length %s"><block var="length"/></custom-block><l>1</l><block var="list"/></block></script></block><block s="doReport"><block var="list"/></block></script></block-definition><block-definition s="create random list of # %&apos;number&apos; abc strings of length %&apos;length&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>list</l></list></block><block s="doSetVar"><l>list</l><block s="reportNewList"><list><l></l></list></block></block><block s="doDeleteFromList"><l><option>all</option></l><block var="list"/></block><block s="doRepeat"><block var="number"/><script><block s="doInsertInList"><custom-block s="create random string abc length %s"><block var="length"/></custom-block><l>1</l><block var="list"/></block></script></block><block s="doReport"><block var="list"/></block></script></block-definition><block-definition s="create random list of # %&apos;number&apos; 123 strings of length %&apos;length&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>list</l></list></block><block s="doSetVar"><l>list</l><block s="reportNewList"><list><l></l></list></block></block><block s="doDeleteFromList"><l><option>all</option></l><block var="list"/></block><block s="doRepeat"><block var="number"/><script><block s="doInsertInList"><custom-block s="create random string 123 length %s"><block var="length"/></custom-block><l>1</l><block var="list"/></block></script></block><block s="doReport"><block var="list"/></block></script></block-definition><block-definition s="create random list of # %&apos;number&apos; ABCabc123 strings of length %&apos;length&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>list</l></list></block><block s="doSetVar"><l>list</l><block s="reportNewList"><list><l></l></list></block></block><block s="doDeleteFromList"><l><option>all</option></l><block var="list"/></block><block s="doRepeat"><block var="number"/><script><block s="doInsertInList"><custom-block s="create random string ABCabc123 length %s"><block var="length"/></custom-block><l>1</l><block var="list"/></block></script></block><block s="doReport"><block var="list"/></block></script></block-definition><block-definition s="bubblesort list %&apos;list&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>placeholder</l><l>counter</l><l>reportlist</l></list></block><block s="doSetVar"><l>reportlist</l><block var="list"/></block><block s="doRepeat"><block s="reportListLength"><block var="reportlist"/></block><script><block s="doSetVar"><l>counter</l><l>1</l></block><block s="doRepeat"><block s="reportDifference"><block s="reportListLength"><block var="reportlist"/></block><l>1</l></block><script><block s="doIf"><block s="reportGreaterThan"><block s="reportListItem"><block var="counter"/><block var="reportlist"/></block><block s="reportListItem"><block s="reportSum"><block var="counter"/><l>1</l></block><block var="reportlist"/></block></block><script><block s="doSetVar"><l>placeholder</l><block s="reportListItem"><block var="counter"/><block var="reportlist"/></block></block><block s="doReplaceInList"><block var="counter"/><block var="reportlist"/><block s="reportListItem"><block s="reportSum"><block var="counter"/><l>1</l></block><block var="reportlist"/></block></block><block s="doReplaceInList"><block s="reportSum"><block var="counter"/><l>1</l></block><block var="reportlist"/><block var="placeholder"/></block></script></block><block s="doChangeVar"><l>counter</l><l>1</l></block></script></block></script></block><block s="doReport"><block var="reportlist"/></block></script><scripts><comment x="396" y="40.200000000000045" w="175" collapsed="false">Returns a sorted version of the input list.  You can then set that list equal to what this reports, or you can use this in other ways.</comment></scripts></block-definition><block-definition s="sequential search list %&apos;list&apos; term %&apos;term&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>counter</l></list></block><block s="doSetVar"><l>counter</l><l>1</l></block><block s="doForEach"><l>item</l><block var="list"/><script><block s="doIf"><block s="reportEquals"><block var="item"/><block var="term"/></block><script><block s="doReport"><block var="counter"/></block></script></block><block s="doChangeVar"><l>counter</l><l>1</l></block></script></block></script><scripts><comment x="419" y="40.19999999999999" w="175" collapsed="false">Returns a sorted version of the input list.  You can then set that list equal to what this reports, or you can use this in other ways.</comment><script x="403" y="228.99999999999994"><block s="doRepeat"><block s="reportListLength"><block var="reportlist"/></block><script><block s="doSetVar"><l>counter</l><l>1</l></block><block s="doRepeat"><block s="reportDifference"><block s="reportListLength"><block var="reportlist"/></block><l>1</l></block><script><block s="doIf"><block s="reportGreaterThan"><block s="reportListItem"><block var="counter"/><block var="reportlist"/></block><block s="reportListItem"><block s="reportSum"><block var="counter"/><l>1</l></block><block var="reportlist"/></block></block><script><block s="doSetVar"><l>placeholder</l><block s="reportListItem"><block var="counter"/><block var="reportlist"/></block></block><block s="doReplaceInList"><block var="counter"/><block var="reportlist"/><block s="reportListItem"><block s="reportSum"><block var="counter"/><l>1</l></block><block var="reportlist"/></block></block><block s="doReplaceInList"><block s="reportSum"><block var="counter"/><l>1</l></block><block var="reportlist"/><block var="placeholder"/></block></script></block><block s="doChangeVar"><l>counter</l><l>1</l></block></script></block></script></block></script></scripts></block-definition><block-definition s="Variable Switcher" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doDeclareVariables"><list><l>variable A</l><l>variable B</l></list></block><block s="doSetVar"><l>variable A</l><block s="reportRandom"><l>1</l><l>10</l></block></block><block s="doSetVar"><l>variable B</l><block s="reportRandom"><l>1</l><l>10</l></block></block></script><scripts><comment x="311" y="22.200000000000045" w="328" collapsed="false">1.  Your first task is to set variable A to the value of variable B, and variable B to the value of variable A.  &#xD;&#xD;Your code should work regardless of what values the variables have.  (That&apos;s why they&apos;re randomized)&#xD;&#xD;This is a very simple task, but it might actually be simpler than you think!&#xD;&#xD;You may make as many other variables as you need.  &#xD;&#xD;This task can be done with three lines of code (it can also be done with more).&#xD;&#xD;1. 您的第一个任务是将变量 A 设置为变量 B 的值，将变量 B 设置为变量 A 的值。 &#xD;&#xD;无论变量具有什么值，代码都应工作。 （这就是为什么他们被随机化的原因）&#xD;&#xD;这是一个非常简单的任务，但实际上可能比您想象的要简单！&#xD;&#xD;您可以根据需要制作尽可能多的其他变量。 &#xD;&#xD;此任务可以使用三行代码完成（也可以用更多代码完成）。&#xD;&#xD;You can see how I did this in the Bubblesort list block!&#xD;&#xD;你可以看到我是如何这样做的，在泡泡排序列表块！ </comment></scripts></block-definition><block-definition s="List Item Switcher" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doDeclareVariables"><list><l>example list</l></list></block><block s="doSetVar"><l>example list</l><custom-block s="create random list of # %s 123 strings of length %s"><l>2</l><l>4</l></custom-block></block><block s="doSayFor"><block var="example list"/><l>5</l></block></script><scripts><comment x="248" y="115.19999999999999" w="325" collapsed="false">2.  Now you are to do the same thing for the two items in this list. &#xD;&#xD;You can see the items in the list by using the block &quot;say (example list) for (x) secs&quot;&#xD;&#xD;Remember, since this is a list, we can&apos;t use the &quot;set [variable] to (value)&quot; block to change a single item in the list.  There are several ways to do this, but I would recommend the &quot;replace item (x) of [list] with [value]&quot; block!&#xD;&#xD;2. 现在，您将对列表中的两个项目执行相同的操作。&#xD;&#xD;您可以使用块&quot;say (example list) for (x) secs&quot;来查看列表中的项目。&#xD;&#xD;请记住，由于这是一个列表，因此不能使用&quot;set [variable] to (value)&quot; 块来更改列表中的单个项。 有几种方法可以做到这一点，但我建议[列表]的&quot;replace item (x) of [list] with [value]&quot; 块！ </comment></scripts></block-definition><block-definition s="Conditional List Item Switcher" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doDeclareVariables"><list><l>example list</l></list></block><block s="doSetVar"><l>example list</l><custom-block s="create random list of # %s 123 strings of length %s"><l>2</l><l>4</l></custom-block></block><block s="doSayFor"><block var="example list"/><l>5</l></block></script><scripts><comment x="295" y="119.19999999999999" w="217" collapsed="false">3.  Now do the same thing you did in part 2, but have it switch ONLY if the items aren&apos;t already sorted smallest to largest!&#xD;&#xD;You can copy your code over from part 2.  Just edit that block, then drag and drop it here.  Then click cancel on your part 2 block so you don&apos;t lose your code!&#xD;&#xD;You will want to use an &quot;if &lt;condition&gt;&quot; block to do this, plus a one of the green operator blocks!</comment></scripts></block-definition><block-definition s="Sort 3 Item List" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doDeclareVariables"><list><l>example list</l></list></block><block s="doSetVar"><l>example list</l><block s="reportNewList"><list><l></l></list></block></block><block s="doReplaceInList"><l>1</l><block var="example list"/><block s="reportRandom"><l>10</l><l>19</l></block></block><block s="doAddToList"><block s="reportRandom"><l>30</l><l>39</l></block><block var="example list"/></block><block s="doAddToList"><block s="reportRandom"><l>20</l><l>29</l></block><block var="example list"/></block><block s="doSayFor"><block var="example list"/><l>5</l></block></script><scripts><comment x="341" y="157.2" w="201" collapsed="false">4.  This list is guaranteed to need sorting, and will be sorted after just one pass!&#xD; &#xD;You will make code that does the following:&#xD;checks the first two items, swaps them if needed&#xD;checks the last two items, swaps them if needed&#xD;&#xD;You can do this with a program which only works on this task.  Or you can make a complete sorting algorith that will work on a list of any length.  Your choice&#xD;&#xD;After you have sorted the list, include a &quot;say (example list) for (5) secs&quot; block so we can see the result!.&#xD;&#xD;4. 此列表保证需要排序，并且只需一次处理后就进行排序！&#xD; &#xD;您将编写执行以下操作的代码：&#xD;检查前两个项目，根据需要交换它们&#xD;检查最后两个项目，根据需要交换它们&#xD;&#xD;您可以使用仅适用于此任务的程序执行此操作。 或者，您可以进行完整的排序 algorith，该排序将处理任何长度的列表。 您的选择&#xD;&#xD;对列表进行排序后，请包括一个 &quot;say (example list) for (5) secs&quot; 块，以便我们可以看到结果！</comment></scripts></block-definition><block-definition s="Complete Sort Block" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doDeclareVariables"><list><l>example list</l></list></block><block s="doSetVar"><l>example list</l><custom-block s="create random list of # %s 123 strings of length %s"><block s="reportRandom"><l>5</l><l>20</l></block><l>4</l></custom-block></block><block s="doSayFor"><block var="example list"/><l>5</l></block></script><scripts><comment x="361" y="134.2" w="516" collapsed="false">When you swapped items, you were creating the metaphorical &quot;bubbles&quot; of bubblesort.  &#xD;&#xD;What you need to do now is take that bubble and move it along the entire length of the list.  You need to check and swap items 1 and 2, then items 2 and 3, and so on, to the end of the list. &#xD;&#xD;You will want to use repeat blocks.  You will need to use a counter variable to keep track of which list item you are looking at.  You will need to use a variable to store a value while you change list item values.  You are definitely going to need a &quot;length of [list]&quot; block! (or code that does the same thing!)&#xD;&#xD;If you complete this task, you will have a fully-working bubble sort!&#xD; &#xD;Note:Take a look at my completed bubblesort block.  It is possible for you to adapt that code to work here.  But you can&apos;t just drag and drop!  It doesn&apos;t use the same variables!  &#xD;&#xD;You&apos;ll notice that on one of my &quot;repeat&quot; blocks I say &quot;length of list - 1&quot; Why -1?  &#xD;&#xD;If there are 5 items in the list, you can&apos;t compare item 5 to item 6.  When we get to the last item in the list, there is nothing to switch with.  Weird things happen if we try.&#xD;&#xD;交换项目时，您正在创建气泡的隐喻&quot;气泡&quot;。 &#xD;&#xD;你现在需要做的是取这个气泡，然后沿着列表的整个长度移动它。 您需要检查和交换项目 1 和 2，然后项目 2 和 3，等等，到列表的末尾。&#xD;&#xD;您需要使用重复块。 您需要使用计数器变量来跟踪您正在查看的列表项。 更改列表项值时，需要使用变量存储值。 你肯定需要一个&quot;&quot;length of [list]&quot;块！（或执行相同事情的代码！&#xD;&#xD;如果您完成此任务，您将有一个完全工作的气泡排序！&#xD; &#xD;注意：看看我已完成的气泡状块。 您可以调整该代码以在此处工作。 但你不能只是拖拉！ 它不使用相同的变量！ &#xD;&#xD;你会注意到，在我的一个 &quot;repeat&quot; 块，我说&quot;length of list - 1&quot; 为什么-1？ &#xD;&#xD;如果列表中有 5 个项目，则无法将项目 5 与项目 6 进行比较。 当我们到达列表中的最后一个项目时，没有什么可切换的。 如果我们尝试，奇怪的事情就会发生。 </comment></scripts></block-definition></blocks><variables><variable name="sorted list"><list id="1056"><item><list struct="atomic" id="1057">bag,4</list></item><item><list struct="atomic" id="1058">ball,7</list></item><item><list struct="atomic" id="1059">bread,8</list></item><item><list struct="atomic" id="1060">dog,12</list></item><item><list struct="atomic" id="1061">egg,14</list></item><item><list struct="atomic" id="1062">elephant,26</list></item><item><list struct="atomic" id="1063">episode,27</list></item><item><list struct="atomic" id="1064">harpy eagle,29</list></item><item><list struct="atomic" id="1065">helicopter,33</list></item><item><list struct="atomic" id="1066">jaguar,36</list></item><item><list struct="atomic" id="1067">jet,38</list></item><item><list struct="atomic" id="1068">leopard,44</list></item><item><list struct="atomic" id="1069">manatee,45</list></item><item><list struct="atomic" id="1070">monkey,46</list></item><item><list struct="atomic" id="1071">otter,48</list></item><item><list struct="atomic" id="1072">penguin,49</list></item><item><list struct="atomic" id="1073">quagga,55</list></item><item><list struct="atomic" id="1074">rabbit,59</list></item><item><list struct="atomic" id="1075">reptile,60</list></item><item><list struct="atomic" id="1076">robot,62</list></item><item><list struct="atomic" id="1077">rutabaga,67</list></item><item><list struct="atomic" id="1078">vacuum,73</list></item><item><list struct="atomic" id="1079">vicuna,78</list></item><item><list struct="atomic" id="1080">voxel,84</list></item><item><list struct="atomic" id="1081">yellowjacket,90</list></item><item><list struct="atomic" id="1082">yogurt,97</list></item></list></variable><variable name="test list"><list struct="atomic" id="1083">Q,T,T,U,N,N,H,P,R,G</list></variable></variables></project><media name="Bubble Sort Lesson - piece by piece" app="Snap! 5.4, http://snap.berkeley.edu" version="1"></media></snapdata>