<snapdata remixID="9342721"><project name="U6L1-TranslatingBinary" app="Snap! 5.4, http://snap.berkeley.edu" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAFJklEQVR4Xu2dT0ikdRjHv++MjC2OEY2HRVmThGhBBQMpvFYIyeIidNJz1MFbF+lUXeuyEQZBXkMqhFiwzUMhiBBIedDFQWH7Q5thJEqirTPxvjnDrunBdneeh30+c1F2fN/n+3w/n/nNjheTarVaFQ8aMGogqQk4Ozurvr6+c8dobW1VXhXd2iyf+9qTFyRJorb2p3R4eKi1tTUNDw/f9z25ge8GMgG3t7e1tbWlVID0QDzP19Xrn+jF258qn3swizaPvKuNJ5/PciwvL2tsbOzB3Ji7uGwgE3BqakqDg4OZeLVHTcSDgwP19PRofX391Oc3vnhPI6+/pcofP6qyVVbl9k099ur72p8aVeHK20qaW6Qkp6OfvtfR6g3lL7+kpKmgyp+/KCmWpL8PpVxO+Uv9+uvaK2oeeUdrxefqL4T/cyq7bJpQpzaQCTg5OanR0dHsB+bm5jQ+Pq5yuaxSqaSOjg4VCgUVi0Vtbm6qvb1dKysramtr0+7urn6+/oFe3v8mu7ap/6pyF59V/ukXtP/hVV1443MlF56QqhUdfPamkscvKtfZn8l2Z+VLNfUO62j9W91Z/VqV3zeye6QC/lDoyQRMHwMDA6B7hBvIBFxYWFAul6u/9aan4eLiYnYq7uzsZAKmp2P6f7OWlhbl8/lMkKWlJf1246O6gEpP0Eyc9CStfa2fqcffHD9X+9n6Nf8+nQr4nZ7J7r+3t6ehoaFHuH5Wq38ImZ6eVldX17kbuXyppOLHV46FO/fl916QJNp97SvdvPVr9u/d3d3q7Oy8z5tyuecG6gKmIefn5zUzM2Oet7e3VxMTE+Y5CPDwG7hHwIc/jgk0cOJNj19Eo4RlA5yAlu0zWwiIBKYNIKBp/QxHQBwwbQABTetnOALigGkDCGhaP8MREAdMG0BA0/oZjoA4YNoAAprWz3AExAHTBhDQtH6GIyAOmDaAgKb1MxwBccC0AQQ0rZ/hCIgDpg0goGn9DEdAHDBtAAFN62c4AuKAaQMIaFo/wxEQB0wbQEDT+hmOgDhg2gACmtbPcATEAdMGENC0foYjIA6YNoCApvUzHAFxwLQBBDStn+EIiAOmDSCgaf0MR0AcMG0AAU3rZzgC4oBpAwhoWj/DERAHTBswE/DuPw17soFG/RF3DxnS3c/K0ageLA1EwDPabyR8BDR4CXg4fTxk4ARs5Ev9LtE9wPeQAQER8NTzv5G18BbMW/B/GkDAxkjBhxA+hDTGtDOmmAloujXD3TSAgG5QxAyCgDG5u9kaAd2giBkEAWNyd7M1ArpBETMIAsbk7mZrBHSDImYQBIzJ3c3WCOgGRcwgCBiTu5utEdANiphBEDAmdzdbI6AbFDGDIGBM7m62RkA3KGIGQcCY3N1sjYBuUMQMgoAxubvZGgHdoIgZBAFjcnezNQK6QREzCALG5O5mawR0gyJmEASMyd3N1gjoBkXMIAgYk7ubrRHQDYqYQRAwJnc3WyOgGxQxgyBgTO5utkZANyhiBkHAmNzdbI2AblDEDIKAMbm72RoB3aCIGQQBY3J3szUCukERMwgCxuTuZmsEdIMiZhAEjMndzdYI6AZFzCAIGJO7m60R0A2KmEEQMCZ3N1sjoBsUMYMgYEzubrZGQDcoYgZBwJjc3WyNgG5QxAyCgDG5u9kaAd2giBkEAWNyd7M1ArpBETMIAsbk7mZrBHSDImYQBIzJ3c3WCOgGRcwgCBiTu5utEdANiphBEDAmdzdbI6AbFDGDIGBM7m62/gcaRue3/6yF1wAAAABJRU5ErkJggg==</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" codify="false" inheritance="false" sublistIDs="false" scheduled="false" id="1"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAQqElEQVR4Xu3XUY5cNxAEQe39D70+AhfgAxNGhb9n1OpoYlL++ec/AgQIECBA4Ln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54AAQIEKgEBruTNJUCAAIFpAQGePr/lCRAgQKASEOBK3lwCBAgQmBYQ4OnzW54AAQIEKgEBruTNJUCAAIFpAQGePr/lCRAgQKASEOBK3lwCBAgQmBYQ4OnzW54AAQIEKgEBruTNJUCAAIFpAQGePr/lCRAgQKAS+A92j8lp2Lc5VgAAAABJRU5ErkJggg==</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="-140" y="-10" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" hidden="true" costume="0" color="255,255,255,255" 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="16.666666666666657" y="10" w="235" collapsed="true">In this project file, you will explore 3 blocks:</comment><script x="16.666666666666657" y="39.166666666666686"><custom-block s="translate text %txt to binary sequence"><l></l><comment w="547.5" collapsed="true">This reporter accepts a string of text as input and translates that text into a binary sequence of ones and zeros.</comment></custom-block></script><script x="16.666666666666657" y="71.33333333333331"><custom-block s="translate binary sequence %txt to text"><l></l><comment w="531.6666666666667" collapsed="true">This reporter accepts a string of ones and zeros (a binary sequence) as input and translates it into text.</comment></custom-block></script><script x="16.666666666666657" y="103.5"><custom-block s="translate binary sequence %txt to B&amp;W image that is %n pixels wide and scaled by factor of %n"><l></l><l></l><l></l><comment w="362.5" collapsed="false">This command block accepts a binary sequence as input and draws a black and white image on the stage. Each 0 becomes a white &quot;pixel&quot; and each 1 becomes a black &quot;pixel.&quot; You can use the other inputs to control where the block breaks the sequence to start a new line and also how large the image is drawn.</comment></custom-block></script><comment x="16.666666666666657" y="193.99999999999994" w="794.1666666666667" collapsed="false">Use this SET script to store the text translated into a binary sequence in the variable OUTPUT. You can access the output by right-clicking (or control-clicking) on the OUTPUT watcher on the stage at right and choosing &quot;export.&quot; The binary sequence will download as a text file. Copy only the binary sequence out of the file—not the quotes.</comment><script x="16.666666666666657" y="257.3333333333333"><block s="doSetVar"><l>output</l><custom-block s="translate text %txt to binary sequence"><l>h</l></custom-block></block></script><comment x="16.666666666666657" y="298.16666666666663" w="464.1666666666667" collapsed="true">Paste the outputted binary sequence here to see how it appears when translated into text:</comment><script x="16.666666666666657" y="327.3333333333333"><custom-block s="translate binary sequence %txt to text"><l></l></custom-block></script><comment x="16.666666666666657" y="358.16666666666663" w="507.5" collapsed="true">Paste the same outputted binary sequence here to see how it appears when translated into an image:</comment><script x="16.666666666666657" y="387.3333333333333"><custom-block s="translate binary sequence %txt to B&amp;W image that is %n pixels wide and scaled by factor of %n"><l>1000 1000 1000</l><l>14</l><l>20</l></custom-block></script></scripts></sprite><watcher var="output(2)" style="normal" x="0" y="31.000001999999995" color="243,118,29" hidden="true"/><watcher var="output" style="normal" x="4" y="2" color="243,118,29"/></sprites></stage><hidden></hidden><headers></headers><code></code><blocks><block-definition s="label %&apos;text&apos; of size %&apos;size&apos;" type="command" category="pen"><comment x="0" y="0" w="90" collapsed="false">LABEL will stamp text on the stage at the given font size. The direction of the text is the direction the sprite is facing, and color will match the pen color.</comment><header></header><code></code><translations></translations><inputs><input type="%txt">Hello!</input><input type="%n">12</input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>text</l><l>size</l></list><l>var stage = this.parentThatIsA(StageMorph),&#xD;    context = stage.penTrails().getContext(&apos;2d&apos;),&#xD;    rotation = radians(this.direction() - 90),&#xD;    trans = new Point(&#xD;      this.center().x - stage.left(),&#xD;      this.center().y - stage.top()&#xD;    ),&#xD;    isWarped = this.Warped,&#xD;    len,&#xD;    pos;&#xD;&#xD;if (isWarped) {endWarp(); }&#xD;context.save();&#xD;context.font = size + &apos;px monospace&apos;;&#xD;context.textAlign = &apos;left&apos;;&#xD;context.textBaseline = &apos;alphabetic&apos;;&#xD;context.fillStyle = this.color.toString();&#xD;len = context.measureText(text).width;&#xD;trans = trans.multiplyBy(1 / stage.scale);&#xD;context.translate(trans.x, trans.y);&#xD;context.rotate(rotation);&#xD;context.fillText(text, 0, 0);&#xD;context.translate(-trans.x, -trans.y);&#xD;context.restore();&#xD;pos = new Point(&#xD;  len * Math.sin(radians(this.direction())),&#xD;  len * Math.cos(radians(this.direction())));&#xD;pos = pos.add(new Point(this.xPosition(), this.yPosition()));&#xD;this.gotoXY(pos.x, pos.y, false);&#xD;this.changed();&#xD;if (isWarped) {this.startWarp(); }&#xD;stage.changed();</l></block><list><block var="text"/><block var="size"/></list></block></script></block-definition><block-definition s="map %&apos;function&apos; over %&apos;lists&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%mult%l"></input></inputs><script><block s="doWarp"><script><block s="doDeclareVariables"><list><l>mapone</l><l>mapmany</l></list></block><block s="doSetVar"><l>mapone</l><block s="reifyScript"><script><block s="doIf"><custom-block s="empty? %l"><block var="data"/></custom-block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doReport"><block s="reportCONS"><block s="evaluate"><block var="function"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><block s="evaluate"><block var="mapone"/><list><block s="reportCDR"><block var="data"/></block></list></block></block></block></script><list><l>data</l></list></block></block><block s="doSetVar"><l>mapmany</l><block s="reifyScript"><script><block s="doIf"><custom-block s="empty? %l"><block s="reportListItem"><l>1</l><block var="data lists"/></block></custom-block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doReport"><block s="reportCONS"><block s="evaluate"><block var="function"/><custom-block s="map %repRing over %mult%l"><block s="reifyReporter"><autolambda><block s="reportListItem"><l>1</l><l/></block></autolambda><list></list></block><list><block var="data lists"/></list></custom-block></block><block s="evaluate"><block var="mapmany"/><list><custom-block s="map %repRing over %mult%l"><block s="reifyReporter"><autolambda><block s="reportCDR"><l/></block></autolambda><list></list></block><list><block var="data lists"/></list></custom-block></list></block></block></block></script><list><l>data lists</l></list></block></block><block s="doIfElse"><custom-block s="empty? %l"><block s="reportCDR"><block var="lists"/></block></custom-block><script><block s="doReport"><block s="evaluate"><block var="mapone"/><list><block s="reportListItem"><l>1</l><block var="lists"/></block></list></block></block></script><script><block s="doReport"><block s="evaluate"><block var="mapmany"/><list><block var="lists"/></list></block></block></script></block></script></block></script></block-definition><block-definition s="empty? %&apos;data&apos;" type="predicate" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportEquals"><block var="data"/><block s="reportNewList"><list></list></block></block></block></script></block-definition><block-definition s="keep items such that %&apos;pred&apos; from %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%predRing"></input><input type="%l"></input></inputs><script><block s="doWarp"><script><block s="doIf"><custom-block s="empty? %l"><block var="data"/></custom-block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doIfElse"><block s="evaluate"><block var="pred"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><script><block s="doReport"><block s="reportCONS"><block s="reportListItem"><l>1</l><block var="data"/></block><custom-block s="keep items such that %predRing from %l"><block var="pred"/><block s="reportCDR"><block var="data"/></block></custom-block></block></block></script><script><block s="doReport"><custom-block s="keep items such that %predRing from %l"><block var="pred"/><block s="reportCDR"><block var="data"/></block></custom-block></block></script></block></script></block></script></block-definition><block-definition s="combine with %&apos;function&apos; items of %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doWarp"><script><block s="doIf"><custom-block s="empty? %l"><block s="reportCDR"><block var="data"/></block></custom-block><script><block s="doReport"><block s="reportListItem"><l>1</l><block var="data"/></block></block></script></block><block s="doReport"><block s="evaluate"><block var="function"/><list><block s="reportListItem"><l>1</l><block var="data"/></block><custom-block s="combine with %repRing items of %l"><block var="function"/><block s="reportCDR"><block var="data"/></block></custom-block></list></block></block></script></block></script></block-definition><block-definition s="if %&apos;test&apos; then %&apos;true&apos; else %&apos;false&apos;" type="reporter" category="control"><header></header><code></code><translations></translations><inputs><input type="%b"></input><input type="%anyUE"></input><input type="%anyUE"></input></inputs><script><block s="doIfElse"><block var="test"/><script><block s="doReport"><block s="evaluate"><block var="true"/><list></list></block></block></script><script><block s="doReport"><block s="evaluate"><block var="false"/><list></list></block></block></script></block></script></block-definition><block-definition s="for %&apos;i&apos; = %&apos;start&apos; to %&apos;end&apos; %&apos;action&apos;" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%n">1</input><input type="%n">10</input><input type="%cs"></input></inputs><script><block s="doDeclareVariables"><list><l>step</l><l>tester</l></list></block><block s="doIfElse"><block s="reportGreaterThan"><block var="start"/><block var="end"/></block><script><block s="doSetVar"><l>step</l><l>-1</l></block><block s="doSetVar"><l>tester</l><block s="reifyReporter"><autolambda><block s="reportLessThan"><block var="i"/><block var="end"/></block></autolambda><list></list></block></block></script><script><block s="doSetVar"><l>step</l><l>1</l></block><block s="doSetVar"><l>tester</l><block s="reifyReporter"><autolambda><block s="reportGreaterThan"><block var="i"/><block var="end"/></block></autolambda><list></list></block></block></script></block><block s="doSetVar"><l>i</l><block var="start"/></block><block s="doUntil"><block s="evaluate"><block var="tester"/><list></list></block><script><block s="doRun"><block var="action"/><list></list></block><block s="doChangeVar"><l>i</l><block var="step"/></block></script></block></script></block-definition><block-definition s="join words %&apos;words&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doWarp"><script><block s="doIf"><custom-block s="empty? %l"><block s="reportCDR"><block var="words"/></block></custom-block><script><block s="doReport"><block s="reportListItem"><l>1</l><block var="words"/></block></block></script></block><block s="doIf"><block s="reportEquals"><l></l><block s="reportListItem"><l>1</l><block var="words"/></block></block><script><block s="doReport"><custom-block s="join words %mult%txt"><block s="reportCDR"><block var="words"/></block></custom-block></block></script></block><block s="doIf"><block s="reportEquals"><l></l><block s="reportListItem"><l>2</l><block var="words"/></block></block><script><block s="doReport"><custom-block s="join words %mult%txt"><block s="reportCONS"><block s="reportListItem"><l>1</l><block var="words"/></block><block s="reportCDR"><block s="reportCDR"><block var="words"/></block></block></block></custom-block></block></script></block><block s="doReport"><block s="reportJoinWords"><list><block s="reportListItem"><l>1</l><block var="words"/></block><l> </l><custom-block s="join words %mult%txt"><block s="reportCDR"><block var="words"/></block></custom-block></list></block></block></script></block></script><scripts><script x="229.000003" y="196.77778077777774"><block s="reportJoinWords"><list><l></l><l></l></list></block></script></scripts></block-definition><block-definition s="list $arrowRight sentence %&apos;data&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doWarp"><script><block s="doReport"><custom-block s="join words %mult%txt"><block var="data"/></custom-block></block></script></block></script></block-definition><block-definition s="sentence $arrowRight list %&apos;text&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doWarp"><script><block s="doReport"><block s="reportTextSplit"><block var="text"/><l><option>whitespace</option></l></block></block></script></block></script></block-definition><block-definition s="catch %&apos;tag&apos; %&apos;action&apos;" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="doCallCC"><block s="reifyScript"><script><block s="doSetVar"><l>tag</l><block var="cont"/></block><block s="doRun"><block var="action"/><list></list></block></script><list><l>cont</l></list></block></block><custom-block s="ignore %s"><l>3</l></custom-block></script></block-definition><block-definition s="throw %&apos;cont&apos;" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%s">catchtag</input></inputs><script><block s="doRun"><block var="cont"/><list></list></block></script></block-definition><block-definition s="catch %&apos;tag&apos; %&apos;value&apos;" type="reporter" category="control"><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%anyUE"></input></inputs><script><block s="doCallCC"><block s="reifyScript"><script><block s="doSetVar"><l>tag</l><block var="cont"/></block><block s="doReport"><block s="evaluate"><block var="value"/><list></list></block></block></script><list><l>cont</l></list></block></block></script></block-definition><block-definition s="throw %&apos;tag&apos; %&apos;value&apos;" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%s">catchtag</input><input type="%s"></input></inputs><script><block s="doRun"><block var="tag"/><list><block var="value"/></list></block></script></block-definition><block-definition s="for each %&apos;item&apos; of %&apos;data&apos; %&apos;action&apos;" type="command" category="lists"><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%l"></input><input type="%cs"></input></inputs><script><block s="doUntil"><custom-block s="empty? %l"><block var="data"/></custom-block><script><block s="doSetVar"><l>item</l><block s="reportListItem"><l>1</l><block var="data"/></block></block><block s="doRun"><block var="action"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><block s="doSetVar"><l>data</l><block s="reportCDR"><block var="data"/></block></block></script></block></script></block-definition><block-definition s="if %&apos;test&apos; do %&apos;action&apos; and pause all $pause-1-255-220-0" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%boolUE"></input><input type="%cs"></input></inputs><script><block s="doDeclareVariables"><list><l>breakpoint</l></list></block><block s="doIf"><block s="evaluate"><block var="test"/><list></list></block><script><block s="doSetVar"><l>breakpoint</l><block var="test"/></block><block s="doShowVar"><l>breakpoint</l></block><block s="doRun"><block var="action"/><list></list></block><block s="doPauseAll"></block><block s="doHideVar"><l></l></block></script></block></script></block-definition><block-definition s="word $arrowRight list %&apos;word&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doWarp"><script><block s="doReport"><block s="reportTextSplit"><block var="word"/><l><option>letter</option></l></block></block></script></block></script></block-definition><block-definition s="ignore %&apos;x&apos;" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs></block-definition><block-definition s="tell %&apos;sprite&apos; to %&apos;action&apos;" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%s">Sprite</input><input type="%cs"></input></inputs><script><block s="doRun"><block s="reportAttributeOf"><block var="action"/><block var="sprite"/></block><list></list></block></script></block-definition><block-definition s="ask %&apos;sprite&apos; for %&apos;expression&apos;" type="reporter" category="control"><header></header><code></code><translations></translations><inputs><input type="%s">Sprite</input><input type="%repRing"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportAttributeOf"><block var="expression"/><block var="sprite"/></block><list></list></block></block></script></block-definition><block-definition s="list $arrowRight word %&apos;list&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doWarp"><script><block s="doReport"><block s="reportJoinWords"><block var="list"/></block></block></script></block></script></block-definition><block-definition s="translate text %&apos;text&apos; to binary sequence" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"</l><custom-block s="list $arrowRight word %l"><custom-block s="map %repRing over %mult%l"><block s="reifyReporter"><autolambda><custom-block s="pack 8-bit byte %txt"><l></l></custom-block></autolambda><list></list></block><list><custom-block s="map %repRing over %mult%l"><block s="reifyReporter"><autolambda><custom-block s="translate decimal %n to binary"><l></l></custom-block></autolambda><list></list></block><list><custom-block s="translate text %txt to Unicode list"><block var="text"/></custom-block></list></custom-block></list></custom-block></custom-block><l>"</l></list></block></block></script></block-definition><block-definition s="pack 8-bit byte %&apos;input&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doIf"><block s="reportGreaterThan"><block s="reportStringSize"><block var="input"/></block><l>7</l></block><script><block s="doReport"><block var="input"/></block></script></block><block s="doReport"><custom-block s="pack 8-bit byte %txt"><block s="reportJoinWords"><list><l>0</l><block var="input"/></list></block></custom-block></block></script></block-definition><block-definition s="translate decimal %&apos;value&apos; to binary" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doIf"><block s="reportLessThan"><block var="value"/><l>2</l></block><script><block s="doReport"><block var="value"/></block></script></block><block s="doReport"><block s="reportJoinWords"><list><custom-block s="translate decimal %n to binary"><block s="reportMonadic"><l><option>floor</option></l><block s="reportQuotient"><block var="value"/><l>2</l></block></block></custom-block><block s="reportModulus"><block var="value"/><l>2</l></block></list></block></block></script></block-definition><block-definition s="translate text %&apos;text&apos; to Unicode list" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doIf"><block s="reportEquals"><block s="reportStringSize"><block var="text"/></block><l>0</l></block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doDeclareVariables"><list><l>result list</l></list></block><block s="doSetVar"><l>result list</l><block s="reportNewList"><list></list></block></block><block s="doWarp"><script><custom-block s="for %upvar = %n to %n %cs"><l>i</l><l>1</l><block s="reportStringSize"><block var="text"/></block><script><block s="doAddToList"><block s="reportUnicode"><block s="reportLetter"><block var="i"/><block var="text"/></block></block><block var="result list"/></block></script></custom-block></script></block><block s="doReport"><block var="result list"/></block></script></block-definition><block-definition s="translate binary sequence %&apos;sequence&apos; to text" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doReport"><custom-block s="list $arrowRight word %l"><custom-block s="map %repRing over %mult%l"><block s="reifyReporter"><autolambda><block s="reportUnicodeAsLetter"><l></l></block></autolambda><list></list></block><list><custom-block s="map %repRing over %mult%l"><block s="reifyReporter"><autolambda><custom-block s="translate binary %n to decimal"><l></l></custom-block></autolambda><list></list></block><list><custom-block s="split binary sequence %txt into list of bytes"><block var="sequence"/></custom-block></list></custom-block></list></custom-block></custom-block></block></script></block-definition><block-definition s="translate binary %&apos;numeral&apos; to decimal" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doDeclareVariables"><list><l>result</l></list></block><block s="doSetVar"><l>result</l><l>0</l></block><custom-block s="for %upvar = %n to %n %cs"><l>i</l><l>1</l><block s="reportStringSize"><block var="numeral"/></block><script><block s="doIf"><block s="reportEquals"><block s="reportLetter"><block var="i"/><block var="numeral"/></block><l>1</l></block><script><block s="doSetVar"><l>result</l><block s="reportSum"><block var="result"/><custom-block s="2 ^ %n"><block s="reportDifference"><block s="reportStringSize"><block var="numeral"/></block><block var="i"/></block></custom-block></block></block></script></block></script></custom-block><block s="doReport"><block var="result"/></block></script></block-definition><block-definition s="2 ^ %&apos;power&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doIf"><block s="reportEquals"><block var="power"/><l>0</l></block><script><block s="doReport"><l>1</l></block></script></block><block s="doReport"><block s="reportProduct"><l>2</l><custom-block s="2 ^ %n"><block s="reportDifference"><block var="power"/><l>1</l></block></custom-block></block></block></script></block-definition><block-definition s="split binary sequence %&apos;sequence&apos; into list of bytes" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doIf"><block s="reportEquals"><block s="reportStringSize"><block var="sequence"/></block><l>0</l></block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doIf"><block s="reportLessThan"><block s="reportStringSize"><block var="sequence"/></block><l>8</l></block><script><block s="doReport"><block s="reportNewList"><list><custom-block s="pack 8-bit byte %txt"><block var="sequence"/></custom-block></list></block></block></script></block><block s="doReport"><block s="reportCONS"><custom-block s="first byte of %s"><block var="sequence"/></custom-block><custom-block s="split binary sequence %txt into list of bytes"><custom-block s="all but first byte of %s"><block var="sequence"/></custom-block></custom-block></block></block></script></block-definition><block-definition s="first byte of %&apos;sequence&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>byte</l></list></block><block s="doSetVar"><l>byte</l><l></l></block><custom-block s="for %upvar = %n to %n %cs"><l>i</l><l>1</l><l>8</l><script><block s="doSetVar"><l>byte</l><block s="reportJoinWords"><list><block var="byte"/><block s="reportLetter"><block var="i"/><block var="sequence"/></block></list></block></block></script></custom-block><block s="doReport"><block var="byte"/></block></script></block-definition><block-definition s="all but first byte of %&apos;sequence&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>all but first byte</l></list></block><block s="doSetVar"><l>all but first byte</l><custom-block s="word $arrowRight list %txt"><block var="sequence"/></custom-block></block><block s="doRepeat"><l>8</l><script><block s="doDeleteFromList"><l>1</l><block var="all but first byte"/></block></script></block><block s="doReport"><custom-block s="list $arrowRight word %l"><block var="all but first byte"/></custom-block></block></script></block-definition><block-definition s="translate binary sequence %&apos;sequence&apos; to B&amp;W image that is %&apos;width pixel count&apos; pixels wide and scaled by factor of %&apos;scale factor&apos;" type="command" category="operators"><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%n"></input><input type="%n">5</input></inputs><script><block s="hide"></block><block s="clear"></block><block s="up"></block><block s="setSize"><block var="scale factor"/></block><block s="doDeclareVariables"><list><l>pixels in sequence</l><l>height pixel count</l><l>width actual</l><l>height actual</l><l>x start</l><l>y start</l><l>remainder of sequence</l></list></block><block s="doSetVar"><l>pixels in sequence</l><block s="reportStringSize"><block var="sequence"/></block><comment w="250" collapsed="true">count number of pixels that will be in image</comment></block><block s="doSetVar"><l>height pixel count</l><block s="reportMonadic"><l><option>ceiling</option></l><block s="reportQuotient"><block var="pixels in sequence"/><block var="width pixel count"/></block></block><comment w="268" collapsed="true">determine number of pixels high that image will be</comment></block><block s="doSetVar"><l>width actual</l><block s="reportProduct"><block var="width pixel count"/><block var="scale factor"/></block><comment w="339" collapsed="true">determine actual width and height of image based on scale factor</comment></block><block s="doSetVar"><l>height actual</l><block s="reportProduct"><block var="height pixel count"/><block var="scale factor"/></block></block><block s="doSetVar"><l>x start</l><block s="reportProduct"><l>-1</l><block s="reportRound"><block s="reportQuotient"><block var="width actual"/><l>2</l></block></block></block><comment w="246" collapsed="true">determine x and y values to start drawing</comment></block><block s="doSetVar"><l>y start</l><block s="reportRound"><block s="reportQuotient"><block var="height actual"/><l>2</l></block></block></block><block s="doSetVar"><l>remainder of sequence</l><block var="sequence"/><comment w="453.33333333333337" collapsed="true">initialize variables to keep track of the part of the sequence that hasn&apos;t been used yet</comment></block><block s="gotoXY"><block var="x start"/><block var="y start"/><comment w="178" collapsed="true">go to the starting position</comment></block><block s="doRepeat"><block var="height pixel count"/><script><block s="doRepeat"><block var="width pixel count"/><script><block s="doWarp"><script><block s="doIfElse"><block s="reportEquals"><block s="reportLetter"><l>1</l><block var="remainder of sequence"/></block><l>1</l></block><script><block s="setColor"><color>0,0,0,255</color></block></script><script><block s="setColor"><color>255,255,255,255</color></block></script></block><block s="doSetVar"><l>remainder of sequence</l><custom-block s="all but first letter of %s"><block var="remainder of sequence"/></custom-block></block><block s="down"></block><block s="changeYPosition"><block var="scale factor"/><comment w="90" collapsed="true">draw the pixel</comment></block><block s="up"></block><block s="changeYPosition"><block s="reportProduct"><l>-1</l><block var="scale factor"/></block><comment w="169" collapsed="true">return the sprite where it was</comment></block><block s="changeXPosition"><block var="scale factor"/><comment w="178" collapsed="true">move to the next pixel in the row</comment></block></script></block></script></block><block s="setXPosition"><block var="x start"/></block><block s="changeYPosition"><block s="reportProduct"><l>-1</l><block var="scale factor"/></block><comment w="322" collapsed="true">move back to the start of the row and then move down one row</comment></block></script><comment w="368.9999979999998" collapsed="false">The outer REPEAT goes through all the rows, and the inner REPEAT goes through all the pixels in that row. So, all the pixels in the first row are drawn first (inside the inner REPEAT loop), and then second row is drawn, and so on.</comment></block></script></block-definition><block-definition s="all but first letter of %&apos;word&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>remainder of word</l></list></block><block s="doSetVar"><l>remainder of word</l><l></l></block><custom-block s="for %upvar = %n to %n %cs"><l>letter</l><l>2</l><block s="reportStringSize"><block var="word"/></block><script><block s="doSetVar"><l>remainder of word</l><block s="reportJoinWords"><list><block var="remainder of word"/><block s="reportLetter"><block var="letter"/><block var="word"/></block></list></block></block></script></custom-block><block s="doReport"><block var="remainder of word"/></block></script></block-definition></blocks><variables><variable name="output"><l>"01101000"</l></variable><variable name="output(2)"><l>"01010111011001010110110001100011011011110110110101100101001000000111010001101111001000000110001001101001011011100110000101110010011110010010111000100000"</l></variable></variables></project><media name="U6L1-TranslatingBinary" app="Snap! 5.4, http://snap.berkeley.edu" version="1"></media></snapdata>