<snapdata remixID="8786146"><project name="U2L3-Predicates" app="Snap! 5.1, http://snap.berkeley.edu" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAD3klEQVR4nO3ZzWscdRzH8d9twUtOOTW99WQtUlAKohex/4B4cQtW04u3ddE8NCRGcvCWa+5CLisRDAHJZjVEsk5iptRtMRP2gcxm00NyEJvUBrz48RAzdkkV1E0+Bd8v+LKPM7N8ebOQbBBgFNwfAP9vBAgrAoQVAcKKAGFFgLAiQFgRIKwIEFYECCsChBUBwooAYUWAsCJAWBEgrAgQVgQIKwKEFQHCigBhRYCwIkBYESCsCBBWBAgrAoQVAcKKAGFFgLAiQFgRIKwIEFZPDXB7e1sLCwvP7DQajfPeE87IqQBLpZKazWbP5/HjXzT37vP64r1/P9+Nvq52u61ms6lqterYF3qsK8Bms6kkSc5kyp+8rZ8/vKCDjwb02jsvq2+wT33v//0MTg0qSRLdvbOh9fHrOhwa0O7ubnbOxcVF197QI10Blkol1Wq1bAqFQtfjJ6fT6SiXy3U9l8vlVCgUsul0Oup0OqrValqayutwaEBvjL2q8FXQlfIVheWg8G1QqAaF1XD8OAoKa0GXvrykVquVTaPR0M7IC0rTNLtepVJx7Q090hXg7Oys4jjOplAoaH9/X9PT00rTVO12W2maKo7j44ND0NHRkXK5nOI4VgghO7ZYLCpNU0lSHMdamsrr+qevKCwdxzZ2Z0yTP0zqRvWG+sv9urV8S+Nr47r6/VWF9aDb39zuCrDVamn1g5fUarWya5TL5XNfGHqrK8D5+XlFUXRqTmKKokiSFEWR8vm8kiRRsVhUkiSKokghhOyYk/ed3C5N5fVw6IKeqx5/443eG1Vxs6j+5X4VN4oa+XFEk7VJXbt7TWE96PLnl08F2Bp+UfV6PbvG3NzcOa8LvdYV4MHBgVZWVv7R7OzsZPfL5fJfvl6ZfEuPhi/+GeH6H7P2xP317udvfnZT9Xpdq6ur+vrjN/Vo+KI2Nzezc29tbbn2hh459VfwzMyMKpVKz+f+/Xv67ejhf5pfD3/KzjcxMeHYF3rsqf8H3Nvb08bGxjM7Dx48OO894YzwSwisCBBWBAgrAoQVAcKKAGFFgLAiQFgRIKwIEFYECCsChBUBwooAYUWAsCJAWBEgrAgQVgQIKwKEFQHCigBhRYCwIkBYESCsCBBWBAgrAoQVAcKKAGFFgLAiQFgRIKwIEFYECCsChBUBwooAYUWAsCJAWBEgrAgQVgQIKwKEFQHCigBhRYCwIkBYESCsCBBWBAgrAoQVAcKKAGFFgLAiQFgRIKwIEFYECCsChBUBwooAYUWAsCJAWBEgrAgQVgQIKwKEFQHCigBhRYCwIkBYESCsCBBWBAgrAoQVAcLqd3GGccAlOmsAAAAAAElFTkSuQmCC</thumbnail><stage name="Stage" width="480" height="360" costume="0" color="255,255,255,1" tempo="60" threadsafe="false" volume="100" pan="0" lines="round" ternary="true" codify="false" inheritance="true" sublistIDs="false" scheduled="false" id="1"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAACtUlEQVR4nO3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+Bo3+AAF/RMkcAAAAAElFTkSuQmCC</pentrails><costumes><list struct="atomic" id="2"></list></costumes><sounds><list struct="atomic" id="3"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites><sprite name="Sprite" idx="1" x="-840" y="-232" heading="0" scale="1" volume="100" pan="0" rotation="1" draggable="false" costume="0" color="255,5,42,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><comment x="10" y="10" w="619" collapsed="false">Name:Ivan Huang&#xD;Partner: Paul Zou&#xD;Duration:30 minutes&#xD;Project Description: This program would make the sprite go to the mouse pointer, and draw colors, however the colors are determined by the y coordinates of it&apos;s current position, so it would change colors if it were to be higher on the screen or lower on the screen, there is also a built in script that allows the user to click on the sprite, and the sprite would either start drawing or stop drawing.&#xD;Honor code: i recieved no help</comment><script x="33" y="329.3333333333333"><custom-block s="Two Color"></custom-block></script><script x="28" y="178.33333333333331"><block s="receiveGo"><comment w="278" collapsed="false">Function: When the green flag is clicked on&#xD;Purpose: tp set pen up to true because it would tell the user that pen is up, then it will run the attached script.</comment></block><block s="up"></block><block s="doSetVar"><l>Pen Up [TF]</l><block s="reportBoolean"><l><bool>true</bool></l></block></block><custom-block s="Three color"></custom-block></script><script x="184" y="299"><block s="receiveInteraction"><l><option>clicked</option></l><comment w="142" collapsed="false">Function: When the sprite is clicked on&#xD;Purpose: To have pen up when the sprite is click, this would change the variable &quot;Penup [value]&quot; to 1 and the change the &quot;Penup [TF]&quot; variable to true and have pen down, if clicked on again, it would do the opposite.</comment></block><block s="doIfElse"><block s="reportEquals"><block var="Pen Up [value]"/><l>1</l></block><script><block s="doSetVar"><l>Pen Up [TF]</l><block s="reportBoolean"><l><bool>true</bool></l></block></block><block s="up"></block><block s="doChangeVar"><l>Pen Up [value]</l><l>-1</l></block></script><script><block s="doSetVar"><l>Pen Up [TF]</l><block s="reportBoolean"><l><bool>false</bool></l></block></block><block s="down"></block><block s="doChangeVar"><l>Pen Up [value]</l><l>1</l></block></script></block></script></scripts></sprite><watcher var="Example list" style="normal" x="10" y="10" color="243,118,29" extX="80" extY="70" hidden="true"/><watcher var="Pen Up [TF]" style="normal" x="10" y="103.000002" color="243,118,29"/><watcher var="Pen Up [value]" style="normal" x="10" y="124.00000399999999" color="243,118,29" hidden="true"/></sprites></stage><hidden></hidden><headers></headers><code></code><blocks><block-definition s="%&apos;Input number&apos; Between? %&apos;Lower Number&apos; and %&apos;Higher Number&apos;" type="predicate" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input><input type="%s"></input></inputs><script><block s="doIf"><block s="reportLessThan"><block var="Lower Number"/><block var="Higher Number"/><comment w="238" collapsed="false">To check is the higher number is larger than the lower number</comment></block><script><block s="doIfElse"><block s="reportAnd"><block s="reportGreaterThan"><block var="Input number"/><block var="Lower Number"/></block><block s="reportLessThan"><block var="Input number"/><block var="Higher Number"/></block></block><script><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block><comment w="226" collapsed="false">It will check if the number is bigger than lower number AND less than the higher number, it would report true if those are both true, and false for any other value.</comment></block></script><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script></block></script></block></script></block-definition><block-definition s="Two Color" type="command" category="motion"><comment w="288" collapsed="false">This script would make the sprite following the mouse and see if the y coordinates of it&apos;s current position is equal to 0 or greater, if it is, then it will make the sprite draw blue, if false, then the sprite will draw red.</comment><header></header><code></code><translations></translations><inputs></inputs><script><block s="setHeading"><l>0</l></block><block s="setSize"><l>3</l></block><block s="clear"></block><block s="doForever"><script><block s="doGotoObject"><l><option>mouse-pointer</option></l></block><block s="doIfElse"><block s="reportOr"><block s="reportGreaterThan"><block s="yPosition"></block><l>0</l></block><block s="reportEquals"><block s="yPosition"></block><l>0</l></block></block><script><block s="setColor"><color>28,0,240,1</color></block></script><script><block s="setColor"><color>255,5,42,1</color></block></script></block></script></block></script></block-definition><block-definition s="Three color" type="command" category="motion"><comment w="324" collapsed="false">Purpose: This script would first reset everything, and make the sprite go to the mouse pointer, then check the coordinate of the sprite, the colors are based on the sprite&apos;s y coordinates or position, red is on the top boundaries, green in middle boundaries, and blue in lower boundaries.</comment><header></header><code></code><translations></translations><inputs></inputs><script><block s="setHeading"><l>0</l></block><block s="setSize"><l>3</l></block><block s="clear"></block><block s="doForever"><script><block s="doGotoObject"><l><option>mouse-pointer</option></l></block><block s="doIfElse"><custom-block s="%s Between? %s and %s"><block s="yPosition"></block><l>60</l><l>190</l></custom-block><script><block s="setColor"><color>168,0,14,1</color></block></script><script><block s="doIf"><block s="reportOr"><custom-block s="%s Between? %s and %s"><block s="yPosition"></block><l>-190</l><l>-60</l></custom-block><custom-block s="%s Between? %s and %s"><block s="yPosition"></block><l>-61</l><l>61</l></custom-block></block><script><block s="doIfElse"><custom-block s="%s Between? %s and %s"><block s="yPosition"></block><l>-190</l><l>-60</l></custom-block><script><block s="setColor"><color>0,122,116,1</color></block></script><script><block s="setColor"><color>81,255,99,1</color></block></script></block></script></block></script></block></script></block></script></block-definition><block-definition s="%&apos;Dividend&apos; Divisible by %&apos;Divisor&apos; ?" type="predicate" category="operators"><comment x="0" y="0" w="176" collapsed="false">The mod block would divide the two numbers and report the remainer, so if the dividend is divisible by the divisor, there should be no remainer, which would report true.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doIfElse"><block s="reportEquals"><block s="reportModulus"><block var="Dividend"/><block var="Divisor"/></block><l>0</l></block><script><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script></block></script></block-definition><block-definition s="Integer? %&apos;Inputted number&apos;" type="predicate" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doIf"><block s="reportIsA"><block var="Inputted number"/><l><option>number</option></l></block><script><block s="doIfElse"><block s="reportOr"><block s="reportLessThan"><block s="reportRound"><block var="Inputted number"/></block><block var="Inputted number"/></block><block s="reportGreaterThan"><block s="reportRound"><block var="Inputted number"/></block><block var="Inputted number"/></block><comment w="233" collapsed="false">Purpose: The script would take the inputted value and confirm if it&apos;s a number, then it will round the number, if the rounded number is bigger or less than the original number, that means its not an interger and would report false.</comment></block><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script><script><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script></block></script></block></script></block-definition><block-definition s="Shading gray color" type="command" category="motion"><header></header><code></code><translations></translations><inputs></inputs><script><block s="setHeading"><l>0</l></block><block s="setSize"><l>3</l></block><block s="clear"></block><block s="doForever"><script><block s="doGotoObject"><l><option>mouse-pointer</option></l></block><block s="doIfElse"><custom-block s="%s Between? %s and %s"><block s="yPosition"></block><l>60</l><l>190</l></custom-block><script><block s="setColor"><color>0,9,15,1</color><comment w="80" collapsed="false">Top</comment></block></script><script><block s="doIf"><block s="reportOr"><custom-block s="%s Between? %s and %s"><block s="yPosition"></block><l>-190</l><l>-100</l></custom-block><custom-block s="%s Between? %s and %s"><block s="yPosition"></block><l>-100</l><l>0</l></custom-block></block><script><block s="doIf"><custom-block s="%s Between? %s and %s"><block s="yPosition"></block><l>-190</l><l>-100</l></custom-block><script><block s="setColor"><color>172,172,172,1</color><comment w="80" collapsed="false">Bottom</comment></block></script></block><block s="doIf"><custom-block s="%s Between? %s and %s"><block s="yPosition"></block><l>-100</l><l>0</l></custom-block><script><block s="setColor"><color>82,82,82,1</color><comment w="80" collapsed="false">Lower Middle</comment></block></script></block><block s="doIf"><custom-block s="%s Between? %s and %s"><block s="yPosition"></block><l>0</l><l>60</l></custom-block><script><block s="setColor"><color>40,40,40,1</color><comment w="80" collapsed="false">Middle</comment></block></script></block></script></block></script></block></script></block></script></block-definition><block-definition s="Is %&apos;Inputted number&apos; even?" type="predicate" category="operators"><comment x="0" y="0" w="273" collapsed="false">Purpose: The block would take the inputted value from the user, and take the last degit of the number, and see if it&apos;s divisiable by 2, if it is, than it is even, and the script will report true.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doIfElse"><block s="reportEquals"><block s="reportModulus"><block s="reportLetter"><l><option>last</option></l><block var="Inputted number"/></block><l>2</l></block><l>0</l></block><script><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script></block></script></block-definition></blocks><variables><variable name="Example list"><list struct="atomic" id="337">0,2,4,6,8</list></variable><variable name="Pen Up [TF]"><bool>true</bool></variable><variable name="Pen Up [value]"><l>0</l></variable></variables></project><media name="U2L3-Predicates" app="Snap! 5.1, http://snap.berkeley.edu" version="1"></media></snapdata>