<snapdata remixID="9207616"><project name="U3L4- Ians Pie Chart" app="Snap! 5.4, http://snap.berkeley.edu" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAADPUlEQVR4nO3cMWtTURyG8SIVRa0UKp0cipO4q5UOSqWk9gNIIIOjg5UupR+gSLR7CEI/Q1FuFpeWDkK2xpqMhUILceiUT/A63cu1TXSw7XvO6fODckuS4QzPcP6ce++YAKMx9wJwtREgrAgQVgQIKwKEFQHCigBhRYCwIkBYESCsCBBWBAgrAoQVAcKKAGFFgLAiQFgRIKwIEFYECCsChBUBwooAYZVEgLVqXeNjFUnSzP1a8Vkra6uVtYvPEJ5kAjz9f697qFq1rrnZFfW6h6aV4V+SCBDxIkBYESCsog+wVq3/sQdEXJIIsCyfhhGH6ANE3AgQVgQIq+gDzE9B8r1f+Vqr1rW2uln8lv1heKIPsJW1R07BHMGFL/oAETcChBUBwiqJAEcNIZK4HStwSQSYT7qtrH3mO27HClsSASJeBAgrAoRV9AGurW4Wg0b52ZDylROQcCUR4OlBo9nIiu/KR3EIT/QBIm4ECCsChFUSATYb2ZlBIx8+8gGl/Ju52RUGk0BEH2CzkRVDx2m97uHQk5D8rQnwiz5AxI0AYUWAsEoiwPJQkV/Z58UhiQCHyd+OhbAlGyDiQICwIkBYRR3g3261L+8Bh52SSDwvEoKoA5Q08nar/P3Qo05JJJ4XCUH0ASJuBAgrAoRVEgEOu+WqPGiMGkbgl0SAo4aJ/IElhCuJABEvAoRVcAFub+9oa2vLvQxckuACPDk50dPHrzVx66WePXmj5Xdr6nQ67mXhggQXoCT1+780NfmieLDo5viCpqcW9aryVuvrGzo6OnIvEeckyAAlaWOjUQRY/rt+raK7d+Y0P7+k4+Nj9zLxn4IMcG/vhyYnForobt+Y16OHS/r08bN2d79rMBi4l4hzElyA3W5XD2YWNX3vud4vf9DXL9/U7/fdy8IFCS7Ag4MD7e//dC8DlyS4AHG1ECCsCBBWBAgrAoQVAcKKAGFFgLAiQFgRIKwIEFYECCsChBUBwooAYUWAsCJAWBEgrAgQVgQIKwKEFQHCigBhRYCwIkBYESCsCBBWBAgrAoQVAcKKAGFFgLAiQFgRIKwIEFYECCsChBUBwooAYUWAsCJAWBEgrAgQVgQIKwKE1W8QLek2PdH+1QAAAABJRU5ErkJggg==</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,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAIxklEQVR4nO3d3XHiShAG0K5CbDQbh8QLkTgUAnEoDoRAuA/jsVoDEn/XeA3nVG0VaDSyd196ZyT1FwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADPq4th38Vw6GI4rKLfdrHZlT/D4ZK5j/gdAeCpdNF/rKLfjt+HQxebXUTEOvr3n/vNAOBJ/Yn+by22p6yjf1/H8FZXx3+i/1vH6gq5XQHX89fRv+dVdR0vK+xy3OoZgJe0in67juFtbrwU0f4johbr8rk9pz3WxWZXj7fzjovx/H8AAOApXVKAl77PHetis8ur5XxOswI+KMAAvJxLtqCXvs8dWyrAeTV87ucDwNNaR//e3tutq+LvLsBli1sBBuBF5S3hWizbh6y66D+m4+OrS/khrfTQ1sy8r+t+Pai1tA0OAAAAAAAAAAAAAAAAAACvJgcmROT3gcdmGW3byNpgo33/96f+DgDwKy11u8pdskrbyGmxXcfwVhpv6GYFAFe5tAAvzZUbDABXOtfveWmrObeXtA0NAFe4JHChqveKy3nDW832lWoEAFdqC+dyAc4PYZWQhVMPbg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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP+g/ni8sDD9mCaQAAAAASUVORK5CYII=</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="-99.99999999999989" y="-34.99999999999994" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="4,0,71,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="15.600000000000023" y="166.39999999999998"><custom-block s="max of list %l"><block s="reportNewList"><list><l>1</l><l>7</l><l>-3</l><l>4</l></list></block></custom-block></script><script x="11.600000000000023" y="124.59999999999991"><custom-block s="value from data-record: %l"><custom-block s="data-record, label: %txt value: %n"><l>China</l><l>8715</l></custom-block></custom-block></script><comment x="10" y="16" w="261.2" collapsed="true">These blocks are given.  Explore them.</comment><comment x="20.399999999999807" y="211.9999999999999" w="275.6000000000001" collapsed="true">These data sets are also given.  Look inside.</comment><script x="15.600000000000023" y="44.39999999999992"><custom-block s="data-record, label: %txt value: %n"><l>China</l><l>8715</l></custom-block></script><comment x="11.599999999999909" y="296.2" w="302.8" collapsed="true">You will write these blocks below.  Right click and edit.</comment><script x="154" y="247.2"><custom-block s="CO2 Emissions per capita Data"></custom-block></script><script x="384.5999999999999" y="244.60000000000002"><block s="clear"></block></script><script x="398.80000199999995" y="285.800002"><block s="reportListItem"><l>1</l><l/></block></script><script x="43" y="333"><custom-block s="PIE CHART radius %s data %l"><l>100</l><custom-block s="CO2 Emissions Data"></custom-block></custom-block></script><script x="43.799999999999955" y="401"><custom-block s="PIE CHART radius %s data %l"><l>100</l><custom-block s="CO2 Emissions per capita Data"></custom-block></custom-block></script><script x="36" y="462"><custom-block s="PIE CHART SLICES radius %s data %l"><l>100</l><custom-block s="CO2 Emissions Data"></custom-block></custom-block></script><script x="37" y="510"><custom-block s="PIE CHART FILL radius %s data %l"><l>100</l><custom-block s="CO2 Emissions Data"></custom-block></custom-block></script><script x="39" y="567"><custom-block s="PIE CHART LABEL radius %s data %l"><l>100</l><custom-block s="CO2 Emissions Data"></custom-block></custom-block></script><script x="38" y="623"><custom-block s="PIE CHART OUTLINE radius %s data %l"><l>100</l><custom-block s="CO2 Emissions Data"></custom-block></custom-block></script><script x="35" y="690"><custom-block s="PIE CHART LABEL LINES radius %s data %l"><l>100</l><custom-block s="CO2 Emissions Data"></custom-block></custom-block></script><script x="12" y="80"><custom-block s="label from data-record: %l"><custom-block s="data-record, label: %txt value: %n"><l>China</l><l>8715</l></custom-block></custom-block></script><script x="1045" y="227"><custom-block s="data-record, label: %txt value: %n"><l>China</l><l>8715</l></custom-block></script><script x="22" y="253"><custom-block s="CO2 Emissions Data"></custom-block></script><script x="860.000002" y="284.000002"><custom-block s="value from data-record: %l"><l/></custom-block></script><comment x="481.79999999999995" y="454" w="282" collapsed="false">Note:  a pie chart is only appropriate here if the data includes an entry for &quot;rest of world&quot;  This one does not.  This is not a good use of a pie chart.  I just wanted to use one to give you an example of a program that is similar to the one you will make.  The drawing is completely different (the math here is more complex!) but the way we handle data is EXACTLY the same!)&#xD;</comment><script x="568" y="30"><custom-block s="retrieve data from list"><comment w="257" collapsed="false">This is an example of pulling data from a list.  </comment></custom-block></script></scripts></sprite></sprites></stage><hidden></hidden><headers></headers><code></code><blocks><block-definition s="Bar Graph, data: %&apos;data list&apos;" type="command" category="looks"><comment x="0" y="0" w="158.8" collapsed="false">dead simple once the other blocks work.&#xD;</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="clear"></block></script><scripts><comment x="60" y="201.2" w="309" collapsed="false">IF we wanted to customize all the inputs on these functions we could add input variables to the block Bar Graph, and pass those to each of the functions as appropriate.</comment></scripts></block-definition><block-definition s="data-record, label: %&apos;label&apos; value: %&apos;value&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportNewList"><list><block var="label"/><block var="value"/></list></block></block></script></block-definition><block-definition s="label from data-record: %&apos;data-record&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportListItem"><l>1</l><block var="data-record"/></block></block></script></block-definition><block-definition s="value from data-record: %&apos;data-record&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportListItem"><l>2</l><block var="data-record"/></block></block></script></block-definition><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.00000300000002" 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="min of list %&apos;list&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><custom-block s="combine with %repRing items of %l"><block s="reifyReporter"><autolambda><custom-block s="min of %s , %s"><l></l><l></l></custom-block></autolambda><list></list></block><block var="list"/></custom-block></block></script></block-definition><block-definition s="max of list %&apos;list&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><custom-block s="combine with %repRing items of %l"><block s="reifyReporter"><autolambda><custom-block s="max of %s , %s"><l></l><l></l></custom-block></autolambda><list></list></block><block var="list"/></custom-block></block></script></block-definition><block-definition s="min of %&apos;a&apos; , %&apos;b&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doIfElse"><block s="reportLessThan"><block var="a"/><block var="b"/></block><script><block s="doReport"><block var="a"/></block></script><script><block s="doReport"><block var="b"/></block></script></block></script></block-definition><block-definition s="max of %&apos;a&apos; , %&apos;b&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doIfElse"><block s="reportGreaterThan"><block var="a"/><block var="b"/></block><script><block s="doReport"><block var="a"/></block></script><script><block s="doReport"><block var="b"/></block></script></block></script></block-definition><block-definition s="CO2 Emissions Data" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doReport"><block s="reportNewList"><list><custom-block s="data-record, label: %txt value: %n"><l>China</l><l>8715</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>USA</l><l>5491</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>Russia</l><l>1788</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>India</l><l>1726</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>Japan</l><l>1181</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>Germany</l><l>748</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>Iran</l><l>624</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>S. Korea</l><l>611</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>Canada</l><l>553</l></custom-block></list></block></block></script></block-definition><block-definition s="CO2 Emissions per capita Data" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doReport"><block s="reportNewList"><list><custom-block s="data-record, label: %txt value: %n"><l>China</l><l>6.52</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>USA</l><l>17.62</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>Russia</l><l>12.55</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>India</l><l>1.45</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>Japan</l><l>9.26</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>Germany</l><l>9.19</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>Iran</l><l>8.02</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>S. Korea</l><l>12.53</l></custom-block><custom-block s="data-record, label: %txt value: %n"><l>Canada</l><l>16.24</l></custom-block></list></block></block></script></block-definition><block-definition s="label, size: %&apos;size&apos; direction: %&apos;direction&apos;" type="command" category="pen"><comment x="0" y="0" w="90" collapsed="false">direction should be 180 or else it will be hard to position correctly.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doDeclareVariables"><list><l>item count</l></list></block><block s="doSetVar"><l>item count</l><l>0</l></block><block s="setHeading"><block var="direction"/></block><block s="gotoXY"><block s="reportDifference"><block var="x-origin"/><l>10</l></block><block s="reportDifference"><block var="y-origin"/><l>10</l></block></block><block s="doForEach"><l>item</l><custom-block s="CO2 Emissions Data"></custom-block><script><block s="doChangeVar"><l>item count</l><l>1</l></block></script></block><block s="doForEach"><l>item</l><custom-block s="CO2 Emissions Data"></custom-block><script><block s="changeXPosition"><l>40</l></block><block s="setYPosition"><block s="reportDifference"><block var="y-origin"/><l>10</l></block></block><custom-block s="label %txt of size %n"><block s="reportListItem"><l>1</l><l/></block><block var="size"/><comment w="273" collapsed="false">This is the important bit.  It pulls the names from the list</comment></custom-block></script></block></script></block-definition><block-definition s="set origin x: %&apos;x&apos; y: %&apos;y&apos;" type="command" category="motion"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doSetVar"><l>x-origin</l><block var="x"/></block><block s="doSetVar"><l>y-origin</l><block var="y"/></block><block s="gotoXY"><block var="x"/><block var="y"/></block></script></block-definition><block-definition s="Country-GDP-Population Data" 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>China</l><l>13421985588615</l><l>1336718015</l></list></block><block s="reportNewList"><list><l>USA</l><l>15507135407358</l><l>311050977</l></list></block><block s="reportNewList"><list><l>Russia</l><l>3121925049784</l><l>138739892</l></list></block><block s="reportNewList"><list><l>India</l><l>5806731299998</l><l>1189172906</l></list></block><block s="reportNewList"><list><l>Japan</l><l>4367871360438</l><l>127469543</l></list></block><block s="reportNewList"><list><l>Germany</l><l>3338715757320</l><l>81471834</l></list></block><block s="reportNewList"><list><l>Iran</l><l>1243922783400</l><l>77891220</l></list></block><block s="reportNewList"><list><l>S. Korea</l><l>1415591465995</l><l>48754657</l></list></block><block s="reportNewList"><list><l>Canada</l><l>1374291306176</l><l>34030589</l></list></block></list></block></block></script></block-definition><block-definition s="PIE CHART" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs></block-definition><block-definition s="PIE CHART SLICES radius %&apos;radius&apos; data %&apos;data&apos;" type="command" category="pen"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%l"></input></inputs><script><block s="doDeclareVariables"><list><l>total</l><l>count</l></list></block><block s="doSetVar"><l>total</l><l>0</l></block><block s="doSetVar"><l>count</l><l>0</l></block><block s="up"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="setColor"><color>10,62,255,1</color></block><block s="setSize"><l>1</l></block><block s="setHeading"><l>0</l></block><block s="down"></block><block s="forward"><block var="radius"/></block><block s="setHeading"><l>90</l></block><block s="doRepeat"><l>360</l><script><block s="forward"><block s="reportQuotient"><block s="reportProduct"><block s="reportProduct"><block var="radius"/><l>2</l></block><l>3.1415926535</l></block><l>360</l></block></block><block s="turn"><l>1</l></block></script></block><block s="setHeading"><l>0</l></block><block s="forward"><block s="reportProduct"><block var="radius"/><l>-1</l></block></block><block s="doForEach"><l>item</l><block var="data"/><script><block s="doChangeVar"><l>total</l><custom-block s="value from data-record: %l"><l/></custom-block></block><block s="doChangeVar"><l>count</l><l>1</l></block></script><comment w="396" collapsed="false">I need to know the total amount in all slices in order to know how big the slices are relative to the circle!  I also need to know how many slices there are so that I know how many times to repeat the process of drawing them.</comment></block><block s="doForEach"><l>item</l><block var="data"/><script><block s="down"></block><block s="turn"><block s="reportProduct"><block s="reportQuotient"><custom-block s="value from data-record: %l"><l/></custom-block><block var="total"/></block><l>360</l></block><comment w="311" collapsed="false">To draw each slice, I must turn 360 degrees TIMES the portion of the circle represented by the slice (which is a number between 0 and 1).  To get that, I must pull the number value from each item in the list!  This is how you do it. &#xD;&#xD;For each ITEM in the list DATA, I take the VALUE FROM DATA RECORD of that ITEM.  </comment></block><block s="forward"><block var="radius"/></block><block s="up"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="changePenHSVA"><l><option>hue</option></l><l>10</l></block></script></block></script></block-definition><block-definition s="PIE CHART FILL radius %&apos;radius&apos; data %&apos;data&apos;" type="command" category="pen"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%l"></input></inputs><script><block s="doDeclareVariables"><list><l>total</l><l>count</l></list></block><block s="doSetVar"><l>total</l><l>0</l></block><block s="doSetVar"><l>count</l><l>0</l></block><block s="up"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="setColor"><color>10,62,255,1</color></block><block s="setSize"><l>1</l></block><block s="doForEach"><l>item</l><block var="data"/><script><block s="doChangeVar"><l>total</l><custom-block s="value from data-record: %l"><l/></custom-block></block><block s="doChangeVar"><l>count</l><l>1</l></block></script></block><block s="doForEach"><l>item</l><block var="data"/><script><block s="turn"><block s="reportProduct"><block s="reportQuotient"><custom-block s="value from data-record: %l"><l/></custom-block><block var="total"/></block><l>180</l></block></block><block s="forward"><block s="reportQuotient"><block var="radius"/><l>2</l></block></block><block s="down"></block><block s="floodFill"></block><block s="up"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="turn"><block s="reportProduct"><block s="reportQuotient"><custom-block s="value from data-record: %l"><l/></custom-block><block var="total"/></block><l>180</l></block></block><block s="changePenHSVA"><l><option>hue</option></l><l>10</l></block></script></block></script></block-definition><block-definition s="PIE CHART OUTLINE radius %&apos;radius&apos; data %&apos;data&apos;" type="command" category="pen"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%l"></input></inputs><script><block s="doDeclareVariables"><list><l>total</l><l>count</l></list></block><block s="doSetVar"><l>total</l><l>0</l></block><block s="doSetVar"><l>count</l><l>0</l></block><block s="up"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="setColor"><color>0,10,15,1</color></block><block s="setSize"><l>2</l></block><block s="setHeading"><l>0</l></block><block s="down"></block><block s="forward"><block var="radius"/></block><block s="setHeading"><l>90</l></block><block s="doRepeat"><l>360</l><script><block s="forward"><block s="reportQuotient"><block s="reportProduct"><block s="reportProduct"><block var="radius"/><l>2</l></block><l>3.1415926535</l></block><l>360</l></block></block><block s="turn"><l>1</l></block></script></block><block s="setHeading"><l>0</l></block><block s="forward"><block s="reportProduct"><block var="radius"/><l>-1</l></block></block><block s="doForEach"><l>item</l><block var="data"/><script><block s="doChangeVar"><l>total</l><custom-block s="value from data-record: %l"><l/></custom-block></block><block s="doChangeVar"><l>count</l><l>1</l></block></script></block><block s="doForEach"><l>item</l><block var="data"/><script><block s="down"></block><block s="turn"><block s="reportProduct"><block s="reportQuotient"><custom-block s="value from data-record: %l"><l/></custom-block><block var="total"/></block><l>360</l></block></block><block s="forward"><block var="radius"/></block><block s="up"></block><block s="gotoXY"><l>0</l><l>0</l></block></script></block></script></block-definition><block-definition s="PIE CHART radius %&apos;radius&apos; data %&apos;data&apos;" type="command" category="looks"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%l"></input></inputs><script><block s="clear"></block><custom-block s="PIE CHART SLICES radius %s data %l"><block var="radius"/><block var="data"/></custom-block><custom-block s="PIE CHART FILL radius %s data %l"><block var="radius"/><block var="data"/></custom-block><custom-block s="PIE CHART LABEL radius %s data %l"><block var="radius"/><block var="data"/></custom-block><custom-block s="PIE CHART OUTLINE radius %s data %l"><block var="radius"/><block var="data"/></custom-block><custom-block s="PIE CHART LABEL LINES radius %s data %l"><block var="radius"/><block var="data"/></custom-block></script><scripts><comment x="372" y="32.19999999999999" w="178" collapsed="false">Each of these blocks uses the data in the list to complete one step in drawing the pie chart.  &#xD;&#xD;The bar graph is much simpler, but you can pull the data from the list in exactly the same way.  You really only need to look at one of these blocks to learn what you need!</comment></scripts></block-definition><block-definition s="PIE CHART LABEL radius %&apos;radius&apos; data %&apos;data&apos;" type="command" category="pen"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%l"></input></inputs><script><block s="doDeclareVariables"><list><l>total</l><l>count</l></list></block><block s="doSetVar"><l>total</l><l>0</l></block><block s="doSetVar"><l>count</l><l>0</l></block><block s="up"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="setColor"><color>1,0,15,1</color></block><block s="setSize"><l>1</l></block><block s="doForEach"><l>item</l><block var="data"/><script><block s="doChangeVar"><l>total</l><custom-block s="value from data-record: %l"><l/></custom-block></block><block s="doChangeVar"><l>count</l><l>1</l></block></script></block><block s="doForEach"><l>item</l><block var="data"/><script><block s="turn"><block s="reportSum"><block s="reportProduct"><block s="reportQuotient"><custom-block s="value from data-record: %l"><l/></custom-block><block var="total"/></block><l>180</l></block><l>3</l></block></block><block s="forward"><block s="reportSum"><block var="radius"/><l>10</l></block></block><custom-block s="label %txt of size %n"><block s="reportListItem"><l>1</l><block var="item"/></block><l>14</l></custom-block><block s="gotoXY"><l>0</l><l>0</l></block><block s="turn"><block s="reportDifference"><block s="reportProduct"><block s="reportQuotient"><custom-block s="value from data-record: %l"><l/></custom-block><block var="total"/></block><l>180</l></block><l>3</l></block></block></script></block></script></block-definition><block-definition s="PIE CHART LABEL LINES radius %&apos;radius&apos; data %&apos;data&apos;" type="command" category="pen"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%l"></input></inputs><script><block s="doDeclareVariables"><list><l>total</l><l>count</l></list></block><block s="doSetVar"><l>total</l><l>0</l></block><block s="doSetVar"><l>count</l><l>0</l></block><block s="up"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="setColor"><color>1,0,15,1</color></block><block s="setSize"><l>1</l></block><block s="doForEach"><l>item</l><block var="data"/><script><block s="doChangeVar"><l>total</l><custom-block s="value from data-record: %l"><l/></custom-block></block><block s="doChangeVar"><l>count</l><l>1</l></block></script></block><block s="doForEach"><l>item</l><block var="data"/><script><block s="turn"><block s="reportProduct"><block s="reportQuotient"><custom-block s="value from data-record: %l"><l/></custom-block><block var="total"/></block><l>180</l></block></block><block s="forward"><block s="reportSum"><block var="radius"/><l>2</l></block></block><block s="down"></block><block s="forward"><l>6</l></block><block s="up"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="turn"><block s="reportProduct"><block s="reportQuotient"><custom-block s="value from data-record: %l"><l/></custom-block><block var="total"/></block><l>180</l></block></block></script></block></script></block-definition><block-definition s="retrieve data from list" type="command" category="motion"><header></header><code></code><translations></translations><inputs></inputs><script><block s="setColor"><color>4,0,71,1</color></block><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><l>100</l></block><block s="clear"></block><block s="setHeading"><l>90</l></block><block s="gotoXY"><l>-100</l><block var="a"/></block><block s="doForEach"><l>item</l><custom-block s="CO2 Emissions Data"></custom-block><script><block s="write"><custom-block s="label from data-record: %l"><l/></custom-block><l>12</l></block><block s="doChangeVar"><l>a</l><l>-15</l></block><block s="gotoXY"><l>-100</l><block var="a"/></block></script></block></script><scripts><script x="177.00000200000022" y="365.00000199999994"><custom-block s="value from data-record: %l"><l/></custom-block></script></scripts></block-definition></blocks><variables><variable name="x-origin"><l>-175</l></variable><variable name="y-origin"><l>-90</l></variable></variables></project><media name="U3L4- Ians Pie Chart" app="Snap! 5.4, http://snap.berkeley.edu" version="1"></media></snapdata>