<snapdata remixID="10101923"><project name="U3L1p4-brickwall" app="Snap! 6, https://snap.berkeley.edu" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAH4SURBVHhe7dgxihNhAIbhPyHgDWxkCz2AjU0uIATZU6S2EMFOPIPY5AS2WmYRQawtg4UWXkJQIixxhSlURFyz8DbP08z833TDCwMzO1wYEJlPV0gIkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAI9wOBzGsxt3x+nt5djv99PKZcwuXuJhuuc/7Ha78Wb1cDqNcb6Yj4/3bo3NZjMt/I0Ar8Cj+w/Gycv30+lXH659HXcer8d6vZ4WfibAK/DjM/y719e/jBfv3o7FYjEt/IkAj/T05mrMv52Ps8+fxpNXz8dyuZye8C8EeITtdjtWq9WYzWbTwmUJkJTfMKQESEqApARISoCkBEhKgKQESEqApARISoCkBEhKgKQESEqApARISoCkBEhKgKQESEqApARIaIzvmctDWvUfCMUAAAAASUVORK5CYII=</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="flat" ternary="true" hyperops="true" codify="false" inheritance="false" sublistIDs="false" scheduled="false" id="1"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAK1SURBVHhe7cExAQAAAMKg9U9tDB8gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgIsajf4AAXBXLv8AAAAASUVORK5CYII=</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="28" y="-101" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="145,26,68,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="13.333333333333342" y="13.333333333333328"><custom-block s="draw brick, length: %n width: %n"><l>30</l><l>10</l></custom-block></script><comment x="13.333333333333342" y="47.33333333333334" w="284" collapsed="false">It&apos;s somewhat artificial that we start with shape inputs for DRAW BRICK but have fixed values in ROWA and ROWB.  Acknowledge that if students bring it up.  The main reason we did this is that ROWB is easier if they can do the arithmetic instead of building algebraic expressions for the general case.</comment><script x="13.333333333333342" y="144.66666666666666"><custom-block s="rowA"><comment w="55.333333333333336" collapsed="true">3.1.4.2</comment></custom-block></script><script x="13.333333333333342" y="175.33333333333334"><custom-block s="rowB"><comment w="55.333333333333336" collapsed="true">3.1.4.2</comment></custom-block></script><comment x="13.333333333333342" y="206.00000000000003" w="374.6666666666667" collapsed="false">3.  The reason that the obvious attempt (with exactly half-size bricks at the ends) fails is that a rowB has an extra cement gap -- six of them instead of five.  Since we&apos;re using a length of 4 for a cement gap, the two end bricks must be reduced by 4/2 = 2 steps each, to 13 instead of 30/2 = 15.</comment><script x="13.333333333333342" y="291.33333333333325"><custom-block s="draw Brick Wall with %n rows"><l>9</l><comment w="62" collapsed="true">3.1.4.4</comment></custom-block></script><script x="13.333333333333342" y="325.33333333333325"><custom-block s="draw Brick Wall with %n rows, bricks per row: %n brick length: %n width: %n gap thickness: %n"><l>21</l><l>11</l><l>30</l><l>10</l><l>5</l><comment w="62" collapsed="true">3.1.4.6</comment></custom-block></script><script x="451" y="135.00000000000003"><block s="gotoXY"><l>0</l><l>0</l></block></script></scripts></sprite></sprites></stage><hidden></hidden><headers></headers><code></code><blocks><block-definition s="draw brick, length: %&apos;length&apos; width: %&apos;width&apos;" type="command" category="pen"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="setColor"><color>145,26,68,1</color></block><block s="doSetGlobalFlag"><l><option>flat line ends</option></l><l><bool>true</bool></l></block><block s="setSize"><block var="width"/></block><block s="down"></block><block s="forward"><block var="length"/></block><block s="up"></block></script></block-definition><block-definition s="rowA" type="command" category="pen"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doRepeat"><l>5</l><script><custom-block s="draw brick, length: %n width: %n"><l>30</l><l>10</l></custom-block><custom-block s="draw cement"></custom-block></script></block><custom-block s="draw brick, length: %n width: %n"><l>30</l><l>10</l></custom-block></script></block-definition><block-definition s="draw cement" type="command" category="pen"><header></header><code></code><translations></translations><inputs></inputs><script><block s="forward"><l>4</l></block></script></block-definition><block-definition s="rowB" type="command" category="pen"><header></header><code></code><translations></translations><inputs></inputs><script><custom-block s="draw brick, length: %n width: %n"><l>13</l><l>10</l></custom-block><custom-block s="draw cement"></custom-block><block s="doRepeat"><l>5</l><script><custom-block s="draw brick, length: %n width: %n"><l>30</l><l>10</l></custom-block><custom-block s="draw cement"></custom-block></script></block><custom-block s="draw brick, length: %n width: %n"><l>13</l><l>10</l></custom-block></script></block-definition><block-definition s="draw Brick Wall with %&apos;rows&apos; rows" type="command" category="pen"><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doRepeat"><block s="reportMonadic"><l><option>floor</option></l><block s="reportQuotient"><block var="rows"/><l>2</l></block></block><script><custom-block s="rowA"></custom-block><block s="forward"><l>-200</l></block><block s="changeYPosition"><l>14</l></block><custom-block s="rowB"></custom-block><block s="forward"><l>-200</l></block><block s="changeYPosition"><l>14</l></block></script></block><block s="doIf"><custom-block s="odd? %n"><block var="rows"/></custom-block><script><custom-block s="rowA"></custom-block></script></block></script><scripts><comment x="218.66666666666666" y="112.66666666666667" w="118.66666666666667" collapsed="false">These magic numbers will have to be computed instead when we add more inputs later.</comment></scripts></block-definition><block-definition s="odd? %&apos;number&apos;" type="predicate" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportEquals"><block s="reportModulus"><block var="number"/><l>2</l></block><l>1</l></block></block></script></block-definition><block-definition s="draw Brick Wall with %&apos;rows&apos; rows, bricks per row: %&apos;bricks&apos; brick length: %&apos;length&apos; width: %&apos;width&apos; gap thickness: %&apos;gap&apos;" type="command" category="pen"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input><input type="%n"></input><input type="%n"></input><input type="%n"></input></inputs><script><block s="doRepeat"><block s="reportMonadic"><l><option>floor</option></l><block s="reportQuotient"><block var="rows"/><l>2</l></block></block><script><custom-block s="rowA, bricks: %n length: %n width: %n gap: %n"><block var="bricks"/><block var="length"/><block var="width"/><block var="gap"/></custom-block><block s="forward"><block s="reportDifference"><block var="gap"/><block s="reportProduct"><block var="bricks"/><block s="reportSum"><block var="length"/><block var="gap"/></block></block></block></block><block s="changeYPosition"><block s="reportSum"><block var="width"/><block var="gap"/></block></block><custom-block s="rowB, bricks: %n length: %n width: %n gap: %n"><block var="bricks"/><block var="length"/><block var="width"/><block var="gap"/></custom-block><block s="forward"><block s="reportDifference"><block var="gap"/><block s="reportProduct"><block var="bricks"/><block s="reportSum"><block var="length"/><block var="gap"/></block></block></block></block><block s="changeYPosition"><block s="reportSum"><block var="width"/><block var="gap"/></block></block></script></block><block s="doIf"><custom-block s="odd? %n"><block var="rows"/></custom-block><script><custom-block s="rowA, bricks: %n length: %n width: %n gap: %n"><block var="bricks"/><block var="length"/><block var="width"/><block var="gap"/></custom-block></script></block></script></block-definition><block-definition s="rowA, bricks: %&apos;bricks&apos; length: %&apos;length&apos; width: %&apos;width&apos; gap: %&apos;gap&apos;" type="command" category="pen"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input><input type="%n"></input><input type="%n"></input></inputs><script><block s="doRepeat"><block s="reportDifference"><block var="bricks"/><l>1</l></block><script><custom-block s="draw brick, length: %n width: %n"><block var="length"/><block var="width"/></custom-block><custom-block s="draw cement, gap: %n"><block var="gap"/></custom-block></script></block><custom-block s="draw brick, length: %n width: %n"><block var="length"/><block var="width"/></custom-block></script></block-definition><block-definition s="draw cement, gap: %&apos;gap&apos;" type="command" category="pen"><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="forward"><block var="gap"/></block></script></block-definition><block-definition s="rowB, bricks: %&apos;bricks&apos; length: %&apos;length&apos; width: %&apos;width&apos; gap: %&apos;gap&apos;" type="command" category="pen"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input><input type="%n"></input><input type="%n"></input></inputs><script><custom-block s="draw brick, length: %n width: %n"><block s="reportQuotient"><block s="reportDifference"><block var="length"/><block var="gap"/></block><l>2</l></block><block var="width"/></custom-block><custom-block s="draw cement, gap: %n"><block var="gap"/></custom-block><block s="doRepeat"><block s="reportDifference"><block var="bricks"/><l>1</l></block><script><custom-block s="draw brick, length: %n width: %n"><block var="length"/><block var="width"/></custom-block><custom-block s="draw cement, gap: %n"><block var="gap"/></custom-block></script></block><custom-block s="draw brick, length: %n width: %n"><block s="reportQuotient"><block s="reportDifference"><block var="length"/><block var="gap"/></block><l>2</l></block><block var="width"/></custom-block></script></block-definition><block-definition s="rowa" type="command" category="pen"><header></header><code></code><translations></translations><inputs></inputs></block-definition></blocks><variables></variables></project><media name="U3L1p4-brickwall" app="Snap! 6, https://snap.berkeley.edu" version="1"></media></snapdata>