Skip to content

Instantly share code, notes, and snippets.

@mirrexagon
Created April 20, 2017 01:08
Show Gist options
  • Save mirrexagon/b3e97e0fe2f6027e8a7f26bbad9fc9fd to your computer and use it in GitHub Desktop.
Save mirrexagon/b3e97e0fe2f6027e8a7f26bbad9fc9fd to your computer and use it in GitHub Desktop.
<project name="node_attr_list_test" app="Snap! 4.0, http://snap.berkeley.edu" version="1" uuid="f17949d0-2562-11e7-91d5-31101a27743e"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAADtUlEQVR4nO3auUvsUBiGcf9DRQvBUkTESrBwKSwUrEVxAS0U3MXewqVQwQUUBJdiCkdBFNwKxd3v8h1ImPHe2a7ceQ33+UGYiSZwioecnGQqDNBJVahHgP8aAUKKACFFgJAiQEgRIKQIEFIECCkChBQBQooAIUWAkCJASBEgpAgQUgQIKQKEFAFCigAhRYCQIkBIESCkCBBSBAgpAoQUAUKKACFFgJAiQEgRIKQIEFIECCkChBQBQooAIUWAkCJASBEgpAgQUgQIKQKEFAFCigAhRYCQIkBIESCkCBBSBAgpAoQUAX7H6+urDQwMWGNjo01MTKiHk0QE+B2Li4tWVVUVb+vr6+ohJQ0BfsfMzExWgEtLS+ohJQ0B/i2ffldWVqypqSnE197ebltbW+phJQ0BlmpwcNAWFhZsdHQ0/pyeng73gENDQ3Z0dGRXV1fqYSYFARby8fFhq6urdn5+HvZnZ2dzHutBurOzM0ulUuH78fGx7ezs2Ofn578fbPIQYD4eTWtra3yP51e5+fn5nMdHAbqnpyfr7++Pz+3u7i7HkJOGAPM5PT3NWmR4jL7wcPf399bS0hKm4Ij/b2NjI95qa2uzzsdvCDCfh4cHq6mpiQMaGxuLr4B+hfOpOTPAubm5rPPb2tric+vr68s69oQgwEIODw+tr68vTKd+H5gZ2draWlaAk5OT4fPt7c12d3ft7u7Oent7bXh42NLpdNnHngAEWCyPzWXeA34N0O8B/eH05eVl2H9/f7e9vb2yjjNhCLBYj4+P4fFKFODz87N1dXWF13A3Nzfhb3513NzcjM85ODgIESInAiyFT6uFVsG++Ij4M0HkRYCl2N7eLhigPzfc398P+7wZKYgAS3FxcRHeeuQSLVCWl5fD95eXl3INLakIsBTNzc3W0NBgPT09YWXrV7zMzV/FjYyMxI9eOjs71UP+6QiwWH5v51FVVlaGraOjI0yxXzcPNDrGj7++vlYP/ScjwGLd3t5adXV1fHWbmpr643H+zDA6pq6ujmk4PwIshS8u/IG0L0Ry/bjAf6Y1Pj4epuOTk5MyjzBxCBBSBAgpAoQUAUKKACFFgJAiQEgRIKQIEFIECCkChBQBQooAIUWAkCJASBEgpAgQUgQIKQKEFAFCigAhRYCQIkBIESCkCBBSBAgpAoQUAUKKACFFgJAiQEgRIKQIEFIECCkChBQBQooAIUWAkCJASBEgpAgQUgQIKQKEFAFCigAhRYCQIkBIESCkCBBSBAgpAoRU6hfLYRHr7zGkCQAAAABJRU5ErkJggg==</thumbnail><stage name="Stage" width="480" height="360" costume="0" tempo="60" threadsafe="false" lines="round" codify="false" inheritance="false" sublistIDs="false" scheduled="false" id="1"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAACtUlEQVR4nO3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+Bo3+AAF/RMkcAAAAAElFTkSuQmCC</pentrails><costumes><list id="2"></list></costumes><sounds><list id="3"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites><sprite name="Graph" idx="1" x="5.089974293059126" y="-0.46272493573257767" heading="90" scale="1" rotation="1" draggable="false" costume="0" color="80,80,80" pen="tip" id="8"><costumes><list id="9"></list></costumes><sounds><list id="10"></list></sounds><variables></variables><blocks></blocks><scripts><script x="27" y="227"><block s="receiveInteraction"><l><option>clicked</option></l><comment w="90" collapsed="false">2. This says the node attribute.</comment></block><block s="doSayFor"><block s="getNodeAttrib"><l>attr</l><l>1</l></block><l>2</l></block></script><script x="34" y="57"><block s="receiveInteraction"><l><option>clicked</option></l><comment w="90" collapsed="false">1. This creates a new graph with a single node with a node attribute containing a list.</comment></block><block s="newGraph"></block><block s="addNode"><list><l>1</l></list></block><block s="setNodeAttrib"><l>attr</l><l>1</l><block s="reportNewList"><list><l>one</l><l>two</l></list></block></block></script><script x="30" y="347"><block s="receiveInteraction"><l><option>clicked</option></l><comment w="90" collapsed="false">3. This iterates through the node attribute and says each item.</comment></block><block s="doForEach"><l>item</l><block s="getNodeAttrib"><l>attr</l><l>1</l></block><script><block s="doSayFor"><block var="item"/><l>1</l></block></script></block></script><comment x="105" y="500" w="186" collapsed="false">Try 1, 2 and 3 in sequence. They should all work fine.&#xD;&#xD;Now save the project, and reopen it.&#xD;&#xD;Try 2 and 3 again.</comment></scripts><graph>{&quot;directed&quot;:false,&quot;multigraph&quot;:false,&quot;layoutAlgorithm&quot;:&quot;downward&quot;,&quot;nodeDisplayAttribute&quot;:&quot;id&quot;,&quot;edgeDisplayAttribute&quot;:&quot;label&quot;,&quot;graph&quot;:[[&quot;__costumes__&quot;,{}],[&quot;__costumes__,[object Object]&quot;,[&quot;__costumes__&quot;,{}]]],&quot;nodes&quot;:[{&quot;id&quot;:1,&quot;attr&quot;:{&quot;contents&quot;:[&quot;one&quot;,&quot;two&quot;],&quot;first&quot;:null,&quot;rest&quot;:null,&quot;isLinked&quot;:false,&quot;lastChanged&quot;:1492650110459}}],&quot;links&quot;:[]}</graph><nodeattrs></nodeattrs><edgeattrs></edgeattrs></sprite><watcher scope="Stage" s="getLastMessage" style="normal" x="6.567751736111063" y="6.567751736111106" color="230,168,34" hidden="true"/></sprites><nodeattrs><attribute name="attr"/></nodeattrs><edgeattrs></edgeattrs></stage><hidden></hidden><headers></headers><code></code><blocks></blocks><variables></variables></project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment