{"id":0,"registry":{"0":{"submorphs":[],"scripts":[],"id":"84F5D44A-F3E6-4D62-846E-1D6C120A2F94","shape":{"__isSmartRef__":true,"id":1},"droppingEnabled":true,"halosEnabled":true,"eventHandler":{"__isSmartRef__":true,"id":6},"showsHalos":false,"controlPoints":[{"__isSmartRef__":true,"id":7},{"__isSmartRef__":true,"id":8},{"__isSmartRef__":true,"id":9},{"__isSmartRef__":true,"id":10}],"layout":{"__isSmartRef__":true,"id":11},"name":"Pen","partsBinMetaInfo":{"__isSmartRef__":true,"id":12},"derivationIds":[147,"1C3C008B-8212-44B2-AD73-60A48F06CD6A","EE3B27B8-84C6-4C19-A73C-534A6C1746E9","7E928C44-55BD-4F0B-BD4D-E973373DE6D4"],"_ClipMode":"visible","moved":true,"isBeingDragged":false,"__serializedExpressions__":["endPoints.0","endPoints.1","endPoints.2","endPoints.3","endPoints.4","endPoints.5","endPoints.6","endPoints.7","endPoints.8","endPoints.9","endPoints.10","endPoints.11","endPoints.12","endPoints.13","endPoints.14","endPoints.15","endPoints.16","endPoints.17","endPoints.18","endPoints.19","endPoints.20","endPoints.21","endPoints.22","endPoints.23","endPoints.24","endPoints.25","endPoints.26","endPoints.27","endPoints.28","endPoints.29","endPoints.30","endPoints.31","endPoints.32","endPoints.33","endPoints.34","endPoints.35","endPoints.36","endPoints.37","endPoints.38","endPoints.39","endPoints.40","endPoints.41","endPoints.42","endPoints.43","endPoints.44","endPoints.45","endPoints.46","endPoints.47","endPoints.48","endPoints.49","endPoints.50","endPoints.51","endPoints.52","endPoints.53","endPoints.54","endPoints.55","_Position","location","startingLocation","penColor","hitPoint"],"endPoints":["lively.pt(481.0,401.0)","lively.pt(466.0,401.0)","lively.pt(448.0,401.0)","lively.pt(422.0,401.0)","lively.pt(388.0,401.0)","lively.pt(356.0,401.0)","lively.pt(329.0,401.0)","lively.pt(316.0,401.0)","lively.pt(300.0,401.0)","lively.pt(292.0,401.0)","lively.pt(288.0,401.0)","lively.pt(285.0,401.0)","lively.pt(283.0,401.0)","lively.pt(282.0,401.0)","lively.pt(281.0,401.0)","lively.pt(277.0,401.0)","lively.pt(273.0,401.0)","lively.pt(270.0,401.0)","lively.pt(267.0,403.0)","lively.pt(265.0,404.0)","lively.pt(265.0,405.0)","lively.pt(264.0,405.0)","lively.pt(263.0,406.0)","lively.pt(262.0,406.0)","lively.pt(261.0,408.0)","lively.pt(261.0,409.0)","lively.pt(260.0,414.0)","lively.pt(255.0,423.0)","lively.pt(251.0,430.0)","lively.pt(245.0,437.0)","lively.pt(241.0,442.0)","lively.pt(239.0,446.0)","lively.pt(237.0,447.0)","lively.pt(237.0,448.0)","lively.pt(234.0,452.0)","lively.pt(228.0,462.0)","lively.pt(220.0,477.0)","lively.pt(215.0,485.0)","lively.pt(210.0,494.0)","lively.pt(208.0,496.0)","lively.pt(207.0,498.0)","lively.pt(207.0,497.0)","lively.pt(207.0,496.0)","lively.pt(206.0,496.0)","lively.pt(206.0,495.0)","lively.pt(205.0,495.0)","lively.pt(205.0,494.0)","lively.pt(203.0,494.0)","lively.pt(202.0,493.0)","lively.pt(201.0,493.0)","lively.pt(201.0,491.0)","lively.pt(199.0,490.0)","lively.pt(198.0,489.0)","lively.pt(197.0,487.0)","lively.pt(196.0,487.0)","lively.pt(194.0,487.0)"],"showingAllMoves":true,"lineInProgress":null,"penWidth":2,"worldPts":null,"fillColor":null,"heading":0,"_Rotation":0,"_Scale":0.9992916708551148,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18},"__LivelyClassName__":"lively.morphic.Path","__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","_Position":"lively.pt(0.0,0.0)","location":"lively.pt(194.0,487.0)","startingLocation":"lively.pt(481.0,401.0)","penColor":"Color.rgb(204,0,0)","hitPoint":"lively.pt(250.0,362.0)"},"1":{"dontChangeShape":false,"cachedVertices":null,"_PathElements":[{"__isSmartRef__":true,"id":2},{"__isSmartRef__":true,"id":3},{"__isSmartRef__":true,"id":4},{"__isSmartRef__":true,"id":5}],"_BorderWidth":1,"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","_AppearanceStylingMode":false,"_BorderStylingMode":false,"__serializedExpressions__":["_Position","_Extent","_BorderColor","_Padding","_Fill"],"__LivelyClassName__":"lively.morphic.Shapes.Path","__SourceModuleName__":"Global.lively.morphic.PathShapes","_Position":"lively.pt(-21.0,-6.0)","_Extent":"lively.pt(21.0,11.0)","_BorderColor":"Color.rgb(66,66,66)","_Padding":"lively.rect(0,0,0,0)","_Fill":"Color.rgb(204,0,0)"},"2":{"isAbsolute":true,"x":0,"y":0,"__LivelyClassName__":"lively.morphic.Shapes.MoveTo","__SourceModuleName__":"Global.lively.morphic.PathShapes"},"3":{"isAbsolute":true,"x":-20,"y":5,"__LivelyClassName__":"lively.morphic.Shapes.LineTo","__SourceModuleName__":"Global.lively.morphic.PathShapes"},"4":{"isAbsolute":true,"x":-20,"y":-5,"__LivelyClassName__":"lively.morphic.Shapes.LineTo","__SourceModuleName__":"Global.lively.morphic.PathShapes"},"5":{"isAbsolute":true,"x":0,"y":0,"__LivelyClassName__":"lively.morphic.Shapes.LineTo","__SourceModuleName__":"Global.lively.morphic.PathShapes"},"6":{"morph":{"__isSmartRef__":true,"id":0},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"7":{"morph":{"__isSmartRef__":true,"id":0},"index":0,"__LivelyClassName__":"lively.morphic.ControlPoint","__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs"},"8":{"morph":{"__isSmartRef__":true,"id":0},"index":1,"__LivelyClassName__":"lively.morphic.ControlPoint","__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs"},"9":{"morph":{"__isSmartRef__":true,"id":0},"index":2,"__LivelyClassName__":"lively.morphic.ControlPoint","__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs"},"10":{"morph":{"__isSmartRef__":true,"id":0},"index":3,"__LivelyClassName__":"lively.morphic.ControlPoint","__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs"},"11":{},"12":{"partName":"Pen","requiredModules":[],"migrationLevel":9,"partsSpaceName":"PartsBin/Basic/","comment":"This is a classic implementation of turtle graphics in HTML.  As it draws lines using go() and turn() it makes a list of lines,  drawLines() will them make the drawing visible. \n\nYou can use a Pen to produce any polyline or filled polygon using the message makePoly.\nA number of examples are in /testing/\nYou can also simply drag a pen to make a squiggle drawing","changes":[{"__isSmartRef__":true,"id":13},{"__isSmartRef__":true,"id":14},{"__isSmartRef__":true,"id":15},{"__isSmartRef__":true,"id":16},{"__isSmartRef__":true,"id":17}],"__serializedExpressions__":["lastModifiedDate"],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin","lastModifiedDate":"new Date(\"Sat Feb 08 2014 16:06:40 GMT-0800 (PST)\")"},"13":{"author":"Dan","message":"no comment","id":"758F1776-7F0E-4FBD-921A-051F1A8066D5","__serializedExpressions__":["date"],"date":"new Date(\"Sat Feb 08 2014 16:06:37 GMT-0800 (PST)\")"},"14":{"author":"Dan","message":"no comment","id":"E1CBE899-6925-4B31-86C4-99BE3C465F2A","__serializedExpressions__":["date"],"date":"new Date(\"Sat Feb 08 2014 16:05:39 GMT-0800 (PST)\")"},"15":{"author":"Dan","message":"added makeWorldTracks for embedding on windmills ;-)","id":"03D53DD9-5719-4205-94B6-856ABF4F4626","__serializedExpressions__":["date"],"date":"new Date(\"Tue Apr 16 2013 16:02:49 GMT-0700 (PDT)\")"},"16":{"author":"Dan","message":"no comment","id":"A507117B-A57C-4CE1-966A-403BE34D176A","__serializedExpressions__":["date"],"date":"new Date(\"Tue Apr 16 2013 14:34:31 GMT-0700 (PDT)\")"},"17":{"__serializedExpressions__":["date"],"author":"unknown_user","message":"no comment","id":"E6DE2BEB-B73A-4EBC-B2AE-F577563ED9D8","date":"new Date(\"Wed Dec 17 2014 16:18:12 GMT-0800 (PST)\")"},"18":{"aboutMe":{"__isSmartRef__":true,"id":19},"drawLines":{"__isSmartRef__":true,"id":22},"filbert":{"__isSmartRef__":true,"id":25},"filberts":{"__isSmartRef__":true,"id":28},"fillLines":{"__isSmartRef__":true,"id":31},"go":{"__isSmartRef__":true,"id":34},"hilbert":{"__isSmartRef__":true,"id":37},"newLine":{"__isSmartRef__":true,"id":40},"reset":{"__isSmartRef__":true,"id":43},"setPenColor":{"__isSmartRef__":true,"id":46},"setPenWidth":{"__isSmartRef__":true,"id":49},"spiral":{"__isSmartRef__":true,"id":52},"testing":{"__isSmartRef__":true,"id":55},"turn":{"__isSmartRef__":true,"id":58},"yetToDo":{"__isSmartRef__":true,"id":61},"showAllMoves":{"__isSmartRef__":true,"id":64},"showState":{"__isSmartRef__":true,"id":67},"drawLineSoFar":{"__isSmartRef__":true,"id":70},"dragon":{"__isSmartRef__":true,"id":73},"goto":{"__isSmartRef__":true,"id":76},"onDrag":{"__isSmartRef__":true,"id":79},"onDragStart":{"__isSmartRef__":true,"id":86},"onDragEnd":{"__isSmartRef__":true,"id":93},"makeTracks":{"__isSmartRef__":true,"id":100},"makeWorldTracks":{"__isSmartRef__":true,"id":103},"makePoly":{"__isSmartRef__":true,"id":106}},"19":{"varMapping":{"__isSmartRef__":true,"id":20},"source":"function aboutMe() {\n    // This is a classic implementation of turtle graphics in HTML\n    // As it draws lines using go() and turn() it makes a list of lines\n    // drawLines() will them make the drawing visible\n    // I haven't implemented penuUp/penDown\n    // A number of examples are in /testing/\n    // Note you can drag a pen to make a squiggle drawing\n}","funcProperties":{"__isSmartRef__":true,"id":21},"__LivelyClassName__":"lively.Closure"},"20":{"this":{"__isSmartRef__":true,"id":0}},"21":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Tue Apr 16 2013 14:31:01 GMT-0700 (PDT)\")"},"22":{"varMapping":{"__isSmartRef__":true,"id":23},"source":"function drawLines() {\n    if (this.lineInProgress) this.lineInProgress.remove();\n    this.lineInProgress = null;\n    if (this.fillColor) \n        var morph = lively.morphic.Morph.makePolygon(this.endPoints, this.penWidth, this.penColor, this.fillColor);\n    else \n        var morph = lively.morphic.Morph.makeLine(this.endPoints, this.penWidth, this.penColor);\n\n    if (this.owner) this.owner.addMorph(morph);\n    else $world.addMorph(morph);\n    this.showState();\n    return morph;\n}","funcProperties":{"__isSmartRef__":true,"id":24},"__LivelyClassName__":"lively.Closure"},"23":{"this":{"__isSmartRef__":true,"id":0}},"24":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Mar 21 2013 12:00:57 GMT-0700 (PDT)\")"},"25":{"varMapping":{"__isSmartRef__":true,"id":26},"source":"function filbert(n, s, color) {\n    // Two Hilbert curves form a Hilbert tile\n    this.newLine();  \n    this.setPenColor(Color.black); \n    this.setPenWidth(1);\n    this.hilbert(n, s); \n    this.go(s);\n    this.hilbert(n, s); \n    this.go(s);\n    if (color) this.fillLines(color);\n        else this.drawLines()\n    return this\n}","funcProperties":{"__isSmartRef__":true,"id":27},"__LivelyClassName__":"lively.Closure"},"26":{"this":{"__isSmartRef__":true,"id":0}},"27":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sat Feb 08 2014 15:57:26 GMT-0800 (PST)\")"},"28":{"varMapping":{"__isSmartRef__":true,"id":29},"source":"function filberts(n, s) {\n    // Four interlocking filberts\n    var n2 = Math.pow(2,n-1);\n    var morphs = [ ];\n\n    for (var i = 0; i < 4; i++) {\n        morphs.push(this.filbert(n, s, Color.wheel(4)[i]));\n        this.go((n2 - 1)*s); \n        this.turn(-90); \n        this.go(n2 * s); \n        this.turn(180);\n    }\n    return morphs; \n}","funcProperties":{"__isSmartRef__":true,"id":30},"__LivelyClassName__":"lively.Closure"},"29":{"this":{"__isSmartRef__":true,"id":0}},"30":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Mar 13 2013 15:07:43 GMT-0700 (PDT)\")"},"31":{"varMapping":{"__isSmartRef__":true,"id":32},"source":"function fillLines(color) {\n    this.fillColor = color; \n    return this.drawLines();\n}","funcProperties":{"__isSmartRef__":true,"id":33},"__LivelyClassName__":"lively.Closure"},"32":{"this":{"__isSmartRef__":true,"id":0}},"33":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Mar 13 2013 15:07:43 GMT-0700 (PDT)\")"},"34":{"varMapping":{"__isSmartRef__":true,"id":35},"source":"function go(dist) {\n    var newPoint = this.location.addPt(Point.polar(dist, this.heading.toRadians()));\n    return this.goto(newPoint)\n}","funcProperties":{"__isSmartRef__":true,"id":36},"__LivelyClassName__":"lively.Closure"},"35":{"this":{"__isSmartRef__":true,"id":0}},"36":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Mar 21 2013 11:17:43 GMT-0700 (PDT)\")"},"37":{"varMapping":{"__isSmartRef__":true,"id":38},"source":"function hilbert(n, s) {\n      // Draw an nth level Hilbert curve with side length s.\n    if (n == 0) \n        return this.turn(180);\n\n    if (n > 0) { \n        var a = 90;  \n        var m = n - 1; \n    } else { \n        var a = -90;  \n        var m = n + 1; \n    }\n    \n    this.turn(a); \n    this.hilbert(0 - m, s);\n    this.turn(a); \n    this.go(s); \n    this.hilbert(m, s);\n    this.turn(0 - a); \n    this.go(s); \n    this.turn(0 - a); \n    this.hilbert(m, s);\n    this.go(s); \n    this.turn(a); \n    this.hilbert(0 - m, s);\n    this.turn(a);\n    return this;\n}","funcProperties":{"__isSmartRef__":true,"id":39},"__LivelyClassName__":"lively.Closure"},"38":{"this":{"__isSmartRef__":true,"id":0}},"39":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sat Feb 08 2014 15:59:30 GMT-0800 (PST)\")"},"40":{"varMapping":{"__isSmartRef__":true,"id":41},"source":"function newLine(loc) {\n    this.startingLocation = loc ? loc : this.location;\n    this.endPoints = [ this.startingLocation ];\n}","funcProperties":{"__isSmartRef__":true,"id":42},"__LivelyClassName__":"lively.Closure"},"41":{"this":{"__isSmartRef__":true,"id":0}},"42":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Mar 13 2013 22:16:29 GMT-0700 (PDT)\")"},"43":{"varMapping":{"__isSmartRef__":true,"id":44},"source":"function reset(loc) {  // this.reset()\n    this.location = (loc !== undefined) ? loc\n            : pt(500, 400);\n    this.penWidth = 2;\n    this.penColor = Color.red;\n    this.fillColor = null;\n    this.heading = 0;\n    this.showingAllMoves = false;\n    this.newLine(this.location);\n    this.showState();\n    return this \n }","funcProperties":{"__isSmartRef__":true,"id":45},"__LivelyClassName__":"lively.Closure"},"44":{"this":{"__isSmartRef__":true,"id":0}},"45":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Mar 21 2013 11:19:20 GMT-0700 (PDT)\")"},"46":{"varMapping":{"__isSmartRef__":true,"id":47},"source":"function setPenColor(color) {\n    this.penColor = color;\n    if (this.showingAllMoves) this.setFill(color);\n}","funcProperties":{"__isSmartRef__":true,"id":48},"__LivelyClassName__":"lively.Closure"},"47":{"this":{"__isSmartRef__":true,"id":0}},"48":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Mar 13 2013 21:21:31 GMT-0700 (PDT)\")"},"49":{"varMapping":{"__isSmartRef__":true,"id":50},"source":"function setPenWidth(size) {\n    this.penWidth = size;\n}","funcProperties":{"__isSmartRef__":true,"id":51},"__LivelyClassName__":"lively.Closure"},"50":{"this":{"__isSmartRef__":true,"id":0}},"51":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Mar 13 2013 15:07:43 GMT-0700 (PDT)\")"},"52":{"varMapping":{"__isSmartRef__":true,"id":53},"source":"function spiral(n, angle, color, d) { // this.copy().reset().spiral(50, 91)\n    if (!n) n = 100;\n    if (!angle) angle = 89;\n    if (!color) color = Color.red;\n    if (!d) d = 2;\n    this.reset();\n    this.setPenColor(color);\n    for (var i=1; i<=n; i++) {\n        this.go(d*i); this.turn(angle); };\n    return this.drawLines();\n}","funcProperties":{"__isSmartRef__":true,"id":54},"__LivelyClassName__":"lively.Closure"},"53":{"this":{"__isSmartRef__":true,"id":0}},"54":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Mar 13 2013 15:07:43 GMT-0700 (PDT)\")"},"55":{"varMapping":{"__isSmartRef__":true,"id":56},"source":"function testing() {\n    // this.show();\n    // this.copy().reset().spiral(50, 91)\n    // this.copy().reset().openInWorld().showAllMoves(true).go(50).turn(45).go(50)\n    // this.copy().reset().hilbert(2,10).drawLines();\n    // this.copy().reset().filbert(2,10);\n    // this.copy().reset().filbert(2,10, Color.yellow);\n    // this.copy().reset().filberts(2,10);\n    // this.copy().reset().dragon(8,10).drawLines()\n    // Make a polygon from your own code...\n    // $world.addMorph(this.makePoly(function(turt) { for (var i=1; i<200; i++) turt.go(i).turn(89) }))\n}","funcProperties":{"__isSmartRef__":true,"id":57},"__LivelyClassName__":"lively.Closure"},"56":{"this":{"__isSmartRef__":true,"id":0}},"57":{"__serializedExpressions__":["timestamp"],"user":"unknown_user","timestamp":"new Date(\"Wed Dec 17 2014 16:15:44 GMT-0800 (PST)\")"},"58":{"varMapping":{"__isSmartRef__":true,"id":59},"source":"function turn(degrees) {\n    this.heading += degrees; \n    if (this.showingAllMoves) this.setRotation(this.heading.toRadians());\n    return this;\n}","funcProperties":{"__isSmartRef__":true,"id":60},"__LivelyClassName__":"lively.Closure"},"59":{"this":{"__isSmartRef__":true,"id":0}},"60":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Mar 13 2013 21:54:19 GMT-0700 (PDT)\")"},"61":{"varMapping":{"__isSmartRef__":true,"id":62},"source":"function yetToDo() {\n    // [X] Make a triangle morph shape showing heading\n    // [X] Add .showAllMoves for visible actions\n    // [X] Cause the morph to show itself after every drawLines or reset\n    // [X] Make setLocation, heading and fillColor into methods that\n    //        update the morph - show morph color as border or fill\n    // [ ] Implement penUp, penDown by use of drawLines, setPosition\n    // [ ] Write a squiggle program\n    // [ ] Make a kaleidoscopic squiggle using makeCommander\n}","funcProperties":{"__isSmartRef__":true,"id":63},"__LivelyClassName__":"lively.Closure"},"62":{"this":{"__isSmartRef__":true,"id":0}},"63":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Mar 21 2013 11:10:19 GMT-0700 (PDT)\")"},"64":{"varMapping":{"__isSmartRef__":true,"id":65},"source":"function showAllMoves(whetherOrNot) {\n    // Cause the Pen to be shown during line drawing.\n    // Sadly this doesn't work well for, eg, designs, \n    // but you can do things like\n    // this.copy().reset().openInWorld().showAllMoves(true).go(50).turn(45).go(50)\n    // and if you do, eg, go(120) in an inspector of that pen, \n    // you will see the line drawn and the pen move\n    this.showingAllMoves = whetherOrNot;\n    if(whetherOrNot) this.showState();\n    return this;\n}","funcProperties":{"__isSmartRef__":true,"id":66},"__LivelyClassName__":"lively.Closure"},"65":{"this":{"__isSmartRef__":true,"id":0}},"66":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Mar 21 2013 10:54:43 GMT-0700 (PDT)\")"},"67":{"varMapping":{"__isSmartRef__":true,"id":68},"source":"function showState() {\n    this.setRotation((this.heading || 0).toRadians());\n    this.setFill(this.penColor);\n    this.setPosition(this.location)\n}","funcProperties":{"__isSmartRef__":true,"id":69},"__LivelyClassName__":"lively.Closure"},"68":{"this":{"__isSmartRef__":true,"id":0}},"69":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Mar 21 2013 11:42:28 GMT-0700 (PDT)\")"},"70":{"varMapping":{"__isSmartRef__":true,"id":71},"source":"function drawLineSoFar() {\n    if (this.lineInProgress) this.lineInProgress.remove();\n    this.lineInProgress = lively.morphic.Morph.makeLine(this.endPoints, this.penWidth, this.penColor);\ndebugger;\n    if (this.owner) this.owner.addMorph(this.lineInProgress);\n    else $world.addMorph(this.lineInProgress);\n    this.setPosition(this.location)\n}","funcProperties":{"__isSmartRef__":true,"id":72},"__LivelyClassName__":"lively.Closure"},"71":{"this":{"__isSmartRef__":true,"id":0}},"72":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Mar 21 2013 11:58:45 GMT-0700 (PDT)\")"},"73":{"varMapping":{"__isSmartRef__":true,"id":74},"source":"function dragon(n, d) { // this.copy().reset().dragon(8,10).drawLines()\n    if (n==0) {return this.go(d); return this}\n    if (n>0) return this.dragon(n-1, d).turn(90).dragon(-(n-1), d);\n        else return this.dragon(-(n+1), d).turn(-90).dragon(n+1, d);\n}","funcProperties":{"__isSmartRef__":true,"id":75},"__LivelyClassName__":"lively.Closure"},"74":{"this":{"__isSmartRef__":true,"id":0}},"75":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Mar 20 2013 15:30:20 GMT-0700 (PDT)\")"},"76":{"varMapping":{"__isSmartRef__":true,"id":77},"source":"function goto(newPoint) {\n    this.location = newPoint;\n    this.endPoints.push(this.location);\n    if (this.showingAllMoves) this.drawLineSoFar();\n    return this;\n}","funcProperties":{"__isSmartRef__":true,"id":78},"__LivelyClassName__":"lively.Closure"},"77":{"this":{"__isSmartRef__":true,"id":0}},"78":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Mar 21 2013 11:15:33 GMT-0700 (PDT)\")"},"79":{"varMapping":{"__isSmartRef__":true,"id":80},"source":"function onDrag(evt) {\n    this.goto(evt.getPosition());\n}","funcProperties":{"__isSmartRef__":true,"id":85},"__LivelyClassName__":"lively.Closure"},"80":{"this":{"__isSmartRef__":true,"id":0},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":81}},"81":{"$super":{"__isSmartRef__":true,"id":82}},"82":{"varMapping":{"__isSmartRef__":true,"id":83},"source":"function () {\n                    try {\n                        return obj.constructor.prototype[name].apply(obj, arguments)\n                    } catch (e) {\n                        if ($world)\n                            $world.logError(e, 'Error in $super call')\n                        else\n                            alert('Error in $super call: ' + e + '\\n' + e.stack);\n                        return null;\n                    }\n                }","funcProperties":{"__isSmartRef__":true,"id":84},"__LivelyClassName__":"lively.Closure"},"83":{"obj":{"__isSmartRef__":true,"id":0},"name":"onDrag"},"84":{},"85":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Mar 21 2013 12:33:03 GMT-0700 (PDT)\")"},"86":{"varMapping":{"__isSmartRef__":true,"id":87},"source":"function onDragStart(evt) {\n    this.location = evt.getPosition();\n    this.newLine();\n    this.showAllMoves(true);\n}","funcProperties":{"__isSmartRef__":true,"id":92},"__LivelyClassName__":"lively.Closure"},"87":{"this":{"__isSmartRef__":true,"id":0},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":88}},"88":{"$super":{"__isSmartRef__":true,"id":89}},"89":{"varMapping":{"__isSmartRef__":true,"id":90},"source":"function () {\n                    try {\n                        return obj.constructor.prototype[name].apply(obj, arguments)\n                    } catch (e) {\n                        if ($world)\n                            $world.logError(e, 'Error in $super call')\n                        else\n                            alert('Error in $super call: ' + e + '\\n' + e.stack);\n                        return null;\n                    }\n                }","funcProperties":{"__isSmartRef__":true,"id":91},"__LivelyClassName__":"lively.Closure"},"90":{"obj":{"__isSmartRef__":true,"id":0},"name":"onDragStart"},"91":{},"92":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Mar 21 2013 12:52:35 GMT-0700 (PDT)\")"},"93":{"varMapping":{"__isSmartRef__":true,"id":94},"source":"function onDragEnd(evt) {\n    this.drawLines();\n    this.owner.addMorph(this); // put me on top for grabbing again\n}","funcProperties":{"__isSmartRef__":true,"id":99},"__LivelyClassName__":"lively.Closure"},"94":{"this":{"__isSmartRef__":true,"id":0},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":95}},"95":{"$super":{"__isSmartRef__":true,"id":96}},"96":{"varMapping":{"__isSmartRef__":true,"id":97},"source":"function () {\n                    try {\n                        return obj.constructor.prototype[name].apply(obj, arguments)\n                    } catch (e) {\n                        if ($world)\n                            $world.logError(e, 'Error in $super call')\n                        else\n                            alert('Error in $super call: ' + e + '\\n' + e.stack);\n                        return null;\n                    }\n                }","funcProperties":{"__isSmartRef__":true,"id":98},"__LivelyClassName__":"lively.Closure"},"97":{"obj":{"__isSmartRef__":true,"id":0},"name":"onDragEnd"},"98":{},"99":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Mar 21 2013 12:59:07 GMT-0700 (PDT)\")"},"100":{"varMapping":{"__isSmartRef__":true,"id":101},"source":"function makeTracks() {\n    // this.showAllMoves()\n    // This method allows drawing tracks in the world\n    // It resets the polyline at the end of every 100 segments\n}","funcProperties":{"__isSmartRef__":true,"id":102},"__LivelyClassName__":"lively.Closure"},"101":{"this":{"__isSmartRef__":true,"id":0}},"102":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Tue Apr 16 2013 14:54:07 GMT-0700 (PDT)\")"},"103":{"varMapping":{"__isSmartRef__":true,"id":104},"source":"function makeWorldTracks() {\n    // this.startStepping(300, \"makeWorldTracks\")\n    // this.stopStepping()\n    // this.worldPts = [this.worldPoint(pt(0, 0))];  // trim line\n\n    // This method allows drawing tracks in the world\n    // It trims the polyline at the end to 200 segments\n    if (!this.worldPts || this.worldPts.length > 200) this.worldPts.shift();\n    if (this.lineInProgress) this.lineInProgress.remove();\n    this.worldPts.push(this.worldPoint(pt(0, 0)));\n    this.lineInProgress = lively.morphic.Morph.makeLine(this.worldPts, this.penWidth, this.penColor);\n    if (this.world()) this.world().addMorph(this.lineInProgress);\n    else $world.addMorph(this.lineInProgress);\n}","funcProperties":{"__isSmartRef__":true,"id":105},"__LivelyClassName__":"lively.Closure"},"104":{"this":{"__isSmartRef__":true,"id":0}},"105":{"user":"Dan","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Tue Apr 16 2013 15:54:21 GMT-0700 (PDT)\")"},"106":{"varMapping":{"__isSmartRef__":true,"id":107},"source":"function makePoly(turtleFn) {\n    var pen = this.copy().reset();\n    turtleFn(pen);  // draws a bunch of line segments using turtle commands\n    return pen.drawLines();  // Returns a polyLine which can be a polygon if filled\n}","funcProperties":{"__isSmartRef__":true,"id":108},"__LivelyClassName__":"lively.Closure"},"107":{"this":{"__isSmartRef__":true,"id":0}},"108":{"__serializedExpressions__":["timestamp"],"user":"unknown_user","timestamp":"new Date(\"Wed Dec 17 2014 16:11:07 GMT-0800 (PST)\")"},"isSimplifiedRegistry":true}}