-
Notifications
You must be signed in to change notification settings - Fork 0
/
_history
1 lines (1 loc) · 55.3 KB
/
_history
1
{"entries":[{"timestamp":1730709676238,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.blocks","patch":[{"diffs":[[0,"http"],[-1,"s"],[0,"://"],[-1,"developers.google.com/blockly/xml\"><variables></variables><block type=\"pxt-on-start\" x=\"0\" y=\"0\"></block><block type=\"device_forever\" x=\"205\" y=\"0\"></block><block type=\"device_pin_event\" x=\"5\" y=\"180\"><field name=\"name\">TouchPin.P2</field></block><block type=\"serial_redirect_to_usb\" disabled-reasons=\"ORPHANED_BLOCK,MANUALLY_DISABLED\" x=\"121\" y=\"350"],[1,"www.w3.org/1999/xhtml\">\n <block type=\"pxt-on-start\"></block>\n <block type=\"device_forever"],[0,"\"></"]],"start1":12,"start2":12,"length1":362,"length2":102},{"diffs":[[0,"</block>"],[1,"\n"],[0,"</xml>"]],"start1":112,"start2":112,"length1":14,"length2":15}]},{"type":"edited","filename":"main.ts","patch":[{"diffs":[[-1,"input.onPinPressed(TouchPin.P2, function () {\n\t\n})\nbasic.forever(function () {\n\t\n})"],[0,"\n"]],"start1":0,"start2":0,"length1":84,"length2":1}]},{"type":"edited","filename":"pxt.json","patch":[{"diffs":[[0," \""],[-1,"preferredEditor\": \"blocksprj\""],[1,"additionalFilePaths\": []"],[0,"\n}\n"]],"start1":228,"start2":228,"length1":36,"length2":31}]}]},{"timestamp":1730710335476,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.blocks","patch":[{"diffs":[[0,"/block><"],[1,"block type=\"serial_redirect_to_usb\" disabled-reasons=\"ORPHANED_BLOCK,MANUALLY_DISABLED\" x=\"121\" y=\"350\"></block><"],[0,"/xml>"]],"start1":260,"start2":260,"length1":13,"length2":126}]}]},{"timestamp":1730710338015,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.blocks","patch":[{"diffs":[[0," x=\""],[-1,"168"],[1,"5"],[0,"\" y=\""],[-1,"268"],[1,"180"],[0,"\"><f"]],"start1":206,"start2":206,"length1":19,"length2":17}]},{"type":"edited","filename":"main.ts","patch":[{"diffs":[[-1,"class LedCordinate {\n constructor(Int x, Int y) {\n Int this.x = x;\n this.y = y;\n }\n}\n\n"],[0,"input.on"],[-1,"Butto"],[1,"Pi"],[0,"nPre"]],"start1":0,"start2":0,"length1":119,"length2":14},{"diffs":[[0,"Pressed("],[-1,"Button.A"],[1,"TouchPin.P2"],[0,", functi"]],"start1":11,"start2":11,"length1":24,"length2":27},{"diffs":[[0,") {\n"],[-1," "],[1,"\t"],[0,"\n})"],[-1,";"],[0,"\nbas"]],"start1":42,"start2":42,"length1":16,"length2":12},{"diffs":[[0,") {\n"],[-1," if (input.buttonIsPressed(Button.A)) {\n led.plot(0, 0)\n }\n"],[0,"\t\n})"]],"start1":75,"start2":75,"length1":80,"length2":8}]},{"type":"edited","filename":"pxt.json","patch":[{"diffs":[[0,"itor\": \""],[-1,"t"],[1,"block"],[0,"sprj\"\n}\n"]],"start1":243,"start2":243,"length1":17,"length2":21}]}]},{"timestamp":1730710943466,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.ts","patch":[{"diffs":[[0,"y) {\n "],[1,"Int "],[0,"this.x = x;\n"]],"start1":47,"start2":47,"length1":24,"length2":28}]}]},{"timestamp":1730710946252,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.ts","patch":[{"diffs":[[0,"\n "],[-1," x: number;\n y: number;\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n}\n\nlet square: Array<LedCordinate> = [\n new LedCordinate(0, 0),\n new LedCordinate(0, 1),\n new LedCordinate(0, 2),\n new LedCordinate(0, 3),\n new LedCordinate(0, 4),\n new LedCordinate(0, 0),\n new LedCordinate(0, 4),\n new LedCordinate(1, 0),\n new LedCordinate(1, 4),\n new LedCordinate(2, 0),\n new LedCordinate(2, 4),\n new LedCordinate(3, 0),\n new LedCordinate(3, 4),\n new LedCordinate(4, 0),\n new LedCordinate(4, 4),\n];\n\nfunction paintLed(): void {}\n\n"],[1,"constructor(Int x, Int y) {\n this.x = x;\n this.y = y;\n }\n}"],[0,"\n\nin"]],"start1":20,"start2":20,"length1":610,"length2":80}]}]},{"timestamp":1730711543045,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.blocks","patch":[{"diffs":[[0,"es><"],[-1,"variable id=\"+C_+SBD.p6%`!CUPIhfg\">i</variable><variable id=\"kex|k}[3owo:$L,!02]|\">list</variable><variable id=\"S;j(sHIkgDP9nGWBTPaU\">square</variable><"],[0,"/var"]],"start1":63,"start2":63,"length1":160,"length2":8},{"diffs":[[0," x=\""],[-1,"2"],[0,"0\" y=\""],[-1,"2"],[0,"0\"><"],[-1,"statement name=\"HANDLER\"><block type=\"typescript_statement\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" line0=\"class LedCordinate {\" line1=\" x: number;\" line2=\" y: number;\" line3=\" constructor(x: number, y: number) {\" line4=\" this.x = x;\" line5=\" this.y = y;\" line6=\" }\" line7=\"}\" numlines=\"8\"></mutation><next><block type=\"variables_set\"><field name=\"VAR\" id=\"S;j(sHIkgDP9nGWBTPaU\">square</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"lists_create_with\" inline=\"false\"><mutation items=\"16\" horizontalafter=\"3\"></mutation><value name=\"ADD0\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 0)</field></block></value><value name=\"ADD1\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(1, 0)</field></block></value><value name=\"ADD2\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(2, 0)</field></block></value><value name=\"ADD3\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(3, 0)</field></block></value><value name=\"ADD4\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 0)</field></block></value><value name=\"ADD5\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 1)</field></block></value><value name=\"ADD6\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 1)</field></block></value><value name=\"ADD7\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 2)</field></block></value><value name=\"ADD8\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 2)</field></block></value><value name=\"ADD9\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 3)</field></block></value><value name=\"ADD10\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 3)</field></block></value><value name=\"ADD11\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 4)</field></block></value><value name=\"ADD12\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(1, 4)</field></block></value><value name=\"ADD13\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(2, 4)</field></block></value><value name=\"ADD14\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(3, 4)</field></block></value><value name=\"ADD15\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 4)</field></block></value></block></value></block></next></block></statement></block><block type=\"device_button_event\" x=\"553\" y=\"20\"><field name=\"NAME\">Button.A</field><statement name=\"HANDLER\"><block type=\"function_call\"><mutation name=\"paintLed\" functionid=\"*tRmWjdBaPWbo(5:lgbA\"><arg name=\"image\" id=\"lkb7309eg5yaj5y7jwgn\" type=\"Array\"></arg></mutation><value name=\"lkb7309eg5yaj5y7jwgn\"><block type=\"variables_get\"><field name=\"VAR\" id=\"S;j(sHIkgDP9nGWBTPaU\">square</field></block></value></block></statement></block><block type=\"device_forever\" x=\"849\" y=\"20\"></block><block type=\"function_definition\" x=\"1054\" y=\"20\"><mutation name=\"paintLed\" functionid=\"*tRmWjdBaPWbo(5:lgbA\"><arg name=\"image\" id=\"lkb7309eg5yaj5y7jwgn\" type=\"Array\"></arg></mutation><field name=\"function_name\">paintLed</field><value name=\"lkb7309eg5yaj5y7jwgn\"><block type=\"argument_reporter_array\"><mutation duplicateondrag=\"true\"></mutation><field name=\"VALUE\">image</field></block></value><statement name=\"STACK\"><block type=\"pxt_controls_for\"><value name=\"VAR\"><block type=\"variables_get_reporter\"><mutation duplicateondrag=\"true\"></mutation><field name=\"VAR\" id=\"+C_+SBD.p6%`!CUPIhfg\">i</field></block></value><value name=\"TO\"><shadow type=\"math_whole_number\"><field name=\"NUM\">0</field></shadow><block type=\"math_arithmetic\"><field name=\"OP\">MINUS</field><value name=\"A\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"lists_length\"><value name=\"VALUE\"><block type=\"argument_reporter_array\"><field name=\"VALUE\">image</field></block></value></block></value><value name=\"B\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow></value></block></value><statement name=\"DO\"><block type=\"device_plot\"><value name=\"x\"><shadow type=\"math_number_minmax\"><mutation min=\"0\" max=\"4\" precision=\"0\"></mutation><field name=\"SLIDER\">0</field></shadow><block type=\"typescript_expression\"><field name=\"EXPRESSION\">image[i].x</field></block></value><value name=\"y\"><shadow type=\"math_number_minmax\"><mutation min=\"0\" max=\"4\" precision=\"0\"></mutation><field name=\"SLIDER\">0</field></shadow><block type=\"typescript_expression\"><field name=\"EXPRESSION\">image[i].y</field></block></value></block></statement></block></statement"],[1,"/block><block type=\"device_forever\" x=\"205\" y=\"0\"></block><block type=\"device_pin_event\" x=\"168\" y=\"268\"><field name=\"name\">TouchPin.P2</field"],[0,"></b"]],"start1":104,"start2":104,"length1":4845,"length2":160}]},{"type":"edited","filename":"main.ts","patch":[{"diffs":[[-1,"input.onButtonPressed(Button.A, function () {\n paintLed(square)\n})\nfunction paintLed (image: any[]) {\n for (let i = 0; i <= image.length - 1; i++) {\n led.plot(image[i].x, image[i].y)\n }\n}\nlet square: LedCordinate[] = [];\n"],[0,"clas"]],"start1":0,"start2":0,"length1":241,"length2":4},{"diffs":[[0,"}\n}\n"],[1,"\nlet "],[0,"square"],[1,": Array<LedCordinate>"],[0," = [\n"],[1," "],[0,"new "]],"start1":131,"start2":131,"length1":19,"length2":49},{"diffs":[[0,"nate(0, 0),\n"],[1," "],[0,"new LedCordi"]],"start1":188,"start2":188,"length1":24,"length2":28},{"diffs":[[0,"ate("],[-1,"1, 0"],[1,"0, 1"],[0,"),\n"],[1," "],[0,"new "]],"start1":217,"start2":217,"length1":15,"length2":19},{"diffs":[[0,"ate("],[-1,"2, 0"],[1,"0, 2"],[0,"),\n"],[1," "],[0,"new "]],"start1":245,"start2":245,"length1":15,"length2":19},{"diffs":[[0,"ate("],[-1,"3, 0"],[1,"0, 3"],[0,"),\n"],[1," "],[0,"new "]],"start1":273,"start2":273,"length1":15,"length2":19},{"diffs":[[0,"ate("],[-1,"4, 0"],[1,"0, 4"],[0,"),\n"],[1," "],[0,"new "]],"start1":301,"start2":301,"length1":15,"length2":19},{"diffs":[[0,"nate(0, "],[-1,"1"],[1,"0"],[0,"),\n"],[1," "],[0,"new LedC"]],"start1":328,"start2":328,"length1":20,"length2":24},{"diffs":[[0,"ate("],[-1,"4, 1"],[1,"0, 4"],[0,"),\n"],[1," "],[0,"new "]],"start1":357,"start2":357,"length1":15,"length2":19},{"diffs":[[0,"rdinate("],[-1,"0, 2"],[1,"1, 0"],[0,"),\n"],[1," "],[0,"new LedC"]],"start1":381,"start2":381,"length1":23,"length2":27},{"diffs":[[0,"ate("],[-1,"4, 2"],[1,"1, 4"],[0,"),\n"],[1," "],[0,"new "]],"start1":413,"start2":413,"length1":15,"length2":19},{"diffs":[[0,"rdinate("],[-1,"0, 3"],[1,"2, 0"],[0,"),\n"],[1," "],[0,"new LedC"]],"start1":437,"start2":437,"length1":23,"length2":27},{"diffs":[[0,"ate("],[-1,"4, 3"],[1,"2, 4"],[0,"),\n"],[1," "],[0,"new "]],"start1":469,"start2":469,"length1":15,"length2":19},{"diffs":[[0,"rdinate("],[-1,"0, 4"],[1,"3, 0"],[0,"),\n"],[1," "],[0,"new LedC"]],"start1":493,"start2":493,"length1":23,"length2":27},{"diffs":[[0,"rdinate("],[-1,"1"],[1,"3"],[0,", 4),\n"],[1," "],[0,"new LedC"]],"start1":521,"start2":521,"length1":23,"length2":27},{"diffs":[[0,"rdinate("],[-1,"2, 4"],[1,"4, 0"],[0,"),\n"],[1," "],[0,"new LedC"]],"start1":549,"start2":549,"length1":23,"length2":27},{"diffs":[[0,"ate("],[-1,"3"],[1,"4"],[0,", 4),\n"],[-1,"new LedCordinate(4, 4)\n];\nbasic.forever(function () {"],[1,"];\n\nfunction paintLed(): void {}\n\n\n\ninput.onButtonPressed(Button.A, function () {\n \n});\nbasic.forever(function () {\n if (input.buttonIsPressed(Button.A)) {\n led.plot(0, 0)\n }"],[0,"\n\t\n}"]],"start1":581,"start2":581,"length1":68,"length2":205}]}]},{"timestamp":1730712095876,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.ts","patch":[{"diffs":[[0," }\n}\n"],[1,"let square: LedCordinate[] = [];\n"],[0,"class Le"]],"start1":196,"start2":196,"length1":16,"length2":49},{"diffs":[[0,"ber;\n "],[-1," "],[0,"construc"]],"start1":283,"start2":283,"length1":17,"length2":16},{"diffs":[[0,"r) {\n "],[-1," "],[0,"this.x = x;\n"]],"start1":322,"start2":322,"length1":25,"length2":24},{"diffs":[[0,".x = x;\n"],[-1," "],[0," t"]],"start1":338,"start2":338,"length1":17,"length2":16},{"diffs":[[0,"\n "],[-1," "],[0,"}\n}\n"],[-1,"\nclass LedDisplay {\n image: Array<Tuple<number, number>>;\n}\nlet square: LedCordinate[]"],[1,"square"],[0," = [\n"],[-1," "],[0,"new "]],"start1":364,"start2":364,"length1":111,"length2":23},{"diffs":[[0,"nate(0, 0),\n"],[-1," "],[0,"new LedCordi"]],"start1":395,"start2":395,"length1":28,"length2":24},{"diffs":[[0,"nate(1, 0),\n"],[-1," "],[0,"new LedCordi"]],"start1":419,"start2":419,"length1":28,"length2":24},{"diffs":[[0,"nate(2, 0),\n"],[-1," "],[0,"new LedCordi"]],"start1":443,"start2":443,"length1":28,"length2":24},{"diffs":[[0,"nate(3, 0),\n"],[-1," "],[0,"new LedCordi"]],"start1":467,"start2":467,"length1":28,"length2":24},{"diffs":[[0,"(4, 0),\n"],[-1," "],[0,"new LedC"]],"start1":495,"start2":495,"length1":20,"length2":16},{"diffs":[[0,"nate(0, 1),\n"],[-1," "],[0,"new LedCordi"]],"start1":515,"start2":515,"length1":28,"length2":24},{"diffs":[[0,"(4, 1),\n"],[-1," "],[0,"new LedC"]],"start1":543,"start2":543,"length1":20,"length2":16},{"diffs":[[0,"nate(0, 2),\n"],[-1," "],[0,"new LedCordi"]],"start1":563,"start2":563,"length1":28,"length2":24},{"diffs":[[0,"(4, 2),\n"],[-1," "],[0,"new LedC"]],"start1":591,"start2":591,"length1":20,"length2":16},{"diffs":[[0,"nate(0, 3),\n"],[-1," "],[0,"new LedCordi"]],"start1":611,"start2":611,"length1":28,"length2":24},{"diffs":[[0,"(4, 3),\n"],[-1," "],[0,"new LedC"]],"start1":639,"start2":639,"length1":20,"length2":16},{"diffs":[[0,"nate(0, 4),\n"],[-1," "],[0,"new LedCordi"]],"start1":659,"start2":659,"length1":28,"length2":24},{"diffs":[[0,"nate(1, 4),\n"],[-1," "],[0,"new LedCordi"]],"start1":683,"start2":683,"length1":28,"length2":24},{"diffs":[[0,"nate(2, 4),\n"],[-1," "],[0,"new LedCordi"]],"start1":707,"start2":707,"length1":28,"length2":24},{"diffs":[[0,"(3, 4),\n"],[-1," "],[0,"new LedC"]],"start1":735,"start2":735,"length1":20,"length2":16},{"diffs":[[0,", 4)"],[-1,","],[0,"\n];\n"],[-1,"\n"],[0,"basi"]],"start1":761,"start2":761,"length1":14,"length2":12}]}]},{"timestamp":1730712693574,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.ts","patch":[{"diffs":[[0," "],[-1,"static const allLeds: Array<{ x: number, y: number }> = [\n { x: 0, y: 0 },\n { x: 0, y: 0 },\n { x: 0, y: 0 },\n { x: 0, y: 0 },\n { x: 0, y: 0 },\n { x: 1, y: 0 },\n { x: 1, y: 0 },\n { x: 1, y: 0 },\n { x: 1, y: 0 },\n { x: 1, y: 0 },\n { x: 2, y: 0 },\n { x: 2, y: 0 },\n { x: 2, y: 0 },\n { x: 2, y: 0 },\n { x: 2, y: 0 },\n { x: 0, y: 0 },\n { x: 0, y: 0 },\n { x: 0, y: 0 },\n { x: 0, y: 0 },\n { x: 0, y: 0 },\n { x: 0, y: 0 },\n { x: 0, y: 0 },\n { x: 0, y: 0 },\n { x: 0, y: 0 },\n { x: 0, y: 0 },\n ];\n \n image: Array<{x: number, y: number}>;\n constructor(image: Array<{ x: "],[1,"image: Array<Tuple<"],[0,"number,"],[-1," y:"],[0," number"],[-1," }>) {\n this.image = image;\n }\n\n activate(): void {\n for (i = 0; i < led.)\n }"],[1,">>;"],[0,"\n}\nl"]],"start1":363,"start2":363,"length1":875,"length2":44}]}]},{"timestamp":1730713291490,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.ts","patch":[{"diffs":[[0," "],[-1,"private "],[0,"static"],[1," const"],[0," all"]],"start1":363,"start2":363,"length1":22,"length2":20},{"diffs":[[0," { x: 0, y: "],[-1,"1"],[1,"0"],[0," },\n "]],"start1":456,"start2":456,"length1":25,"length2":25},{"diffs":[[0," { x: 0, y: "],[-1,"2"],[1,"0"],[0," },\n "]],"start1":480,"start2":480,"length1":25,"length2":25},{"diffs":[[0," { x: 0, y: "],[-1,"3"],[1,"0"],[0," },\n "]],"start1":504,"start2":504,"length1":25,"length2":25},{"diffs":[[0," { x: 0, y: "],[-1,"4"],[1,"0"],[0," },\n "]],"start1":528,"start2":528,"length1":25,"length2":25},{"diffs":[[0," { x: 1, y: "],[-1,"1"],[1,"0"],[0," },\n "]],"start1":576,"start2":576,"length1":25,"length2":25},{"diffs":[[0," { x: 1, y: "],[-1,"2"],[1,"0"],[0," },\n "]],"start1":600,"start2":600,"length1":25,"length2":25},{"diffs":[[0," { x: 1, y: "],[-1,"3"],[1,"0"],[0," },\n "]],"start1":624,"start2":624,"length1":25,"length2":25},{"diffs":[[0," { x: 1, y: "],[-1,"4"],[1,"0 },\n { x: 2, y: 0"],[0," },\n "]],"start1":648,"start2":648,"length1":25,"length2":49},{"diffs":[[0," y: "],[-1,"1 },\n { x: 2, y: 2"],[1,"0"],[0," },\n"]],"start1":728,"start2":728,"length1":33,"length2":9},{"diffs":[[0," { x: 2, y: "],[-1,"3"],[1,"0"],[0," },\n "]],"start1":744,"start2":744,"length1":25,"length2":25},{"diffs":[[0," { x: 2, y: "],[-1,"4"],[1,"0"],[0," },\n "]],"start1":768,"start2":768,"length1":25,"length2":25},{"diffs":[[0," { x: "],[-1,"3"],[1,"0"],[0,", y: 0 },\n "]],"start1":786,"start2":786,"length1":25,"length2":25},{"diffs":[[0," x: "],[-1,"3"],[1,"0"],[0,", y: "],[-1,"1"],[1,"0"],[0," },\n"]],"start1":818,"start2":818,"length1":15,"length2":15},{"diffs":[[0," x: "],[-1,"3"],[1,"0"],[0,", y: "],[-1,"2"],[1,"0"],[0," },\n"]],"start1":842,"start2":842,"length1":15,"length2":15},{"diffs":[[0," x: "],[-1,"3"],[1,"0"],[0,", y: "],[-1,"3"],[1,"0"],[0," },\n"]],"start1":866,"start2":866,"length1":15,"length2":15},{"diffs":[[0," x: "],[-1,"3"],[1,"0"],[0,", y: "],[-1,"4"],[1,"0"],[0," },\n"]],"start1":890,"start2":890,"length1":15,"length2":15},{"diffs":[[0," { x: "],[-1,"4"],[1,"0"],[0,", y: 0 },\n "]],"start1":906,"start2":906,"length1":25,"length2":25},{"diffs":[[0," x: "],[-1,"4"],[1,"0"],[0,", y: "],[-1,"1"],[1,"0"],[0," },\n"]],"start1":938,"start2":938,"length1":15,"length2":15},{"diffs":[[0," x: "],[-1,"4"],[1,"0"],[0,", y: "],[-1,"2"],[1,"0"],[0," },\n"]],"start1":962,"start2":962,"length1":15,"length2":15},{"diffs":[[0," x: "],[-1,"4"],[1,"0"],[0,", y: "],[-1,"3"],[1,"0"],[0," },\n"]],"start1":986,"start2":986,"length1":15,"length2":15},{"diffs":[[0," x: "],[-1,"4"],[1,"0"],[0,", y: "],[-1,"4"],[1,"0"],[0," },\n"]],"start1":1010,"start2":1010,"length1":15,"length2":15},{"diffs":[[0," {\n for ("],[-1,"let "],[0,"i = 0; i < LedDi"]],"start1":1196,"start2":1196,"length1":36,"length2":32},{"diffs":[[0,"i < "],[-1,"LedDisplay.allLeds.length; i++) {\n if (this.image.some(function (e) {\n\n }))\n }"],[1,"led.)"],[0,"\n "]],"start1":1219,"start2":1219,"length1":115,"length2":13}]}]},{"timestamp":1730713858164,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.ts","patch":[{"diffs":[[1,"input.onButtonPressed(Button.A, function () {\n paintLed(square)\n})\nfunction paintLed (image: any[]) {\n for (let i = 0; i <= image.length - 1; i++) {\n led.plot(image[i].x, image[i].y)\n }\n}\nclass LedCordinate {\n x: number;\n y: number;\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n}\n\n"],[0,"class Le"]],"start1":0,"start2":0,"length1":8,"length2":352},{"diffs":[[0," "],[-1,"];\n"],[1," ];\n "],[0,"\n "]],"start1":1027,"start2":1027,"length1":11,"length2":19},{"diffs":[[0," image: Array<{"],[-1," "],[0,"x: number, y: nu"]],"start1":1045,"start2":1045,"length1":33,"length2":32},{"diffs":[[0,": number"],[-1," "],[0,"}>;\n "]],"start1":1073,"start2":1073,"length1":17,"length2":16},{"diffs":[[0,"e) {"],[-1,"\n return LedDisplay.allLeds[i] == e;"],[0,"\n\n "]],"start1":1305,"start2":1305,"length1":59,"length2":8},{"diffs":[[0," }))"],[-1," {"],[0,"\n "]],"start1":1318,"start2":1318,"length1":18,"length2":16},{"diffs":[[0," "],[-1," led.plot(LedDisplay.allLeds[i].x, LedDisplay.allLeds[i].y);\n } else {\n led.unplot(LedDisplay.allLeds[i].x, LedDisplay.allLeds[i].y);\n }\n }\n }\n}\nlet square: LedDisplay = new LedDisplay([\n { x: 0, y: 0 },\n { x: 1, y: 0 },\n { x: 2, y: 0 },\n { x: 3, y: 0 },\n { x: 4, y: 0 },\n { x: 0, y: 1 },\n { x: 4, y: 1 },\n { x: 0, y: 2 },\n { x: 4, y: 2 },\n { x: 0, y: 3 },\n { x: 4, y: 3 },\n { x: 0, y: 4 },\n { x: 1, y: 4 },\n { x: 2, y: 4 },\n { x: 3, y: 4 },\n { x: 4, y: 4 },\n]);\n\ninput.onButtonPressed(Button.A, function () {\n square.activate();\n})"],[1,"}\n }\n}\nlet square: LedCordinate[] = [\n new LedCordinate(0, 0),\n new LedCordinate(1, 0),\n new LedCordinate(2, 0),\n new LedCordinate(3, 0),\n new LedCordinate(4, 0),\n new LedCordinate(0, 1),\n new LedCordinate(4, 1),\n new LedCordinate(0, 2),\n new LedCordinate(4, 2),\n new LedCordinate(0, 3),\n new LedCordinate(4, 3),\n new LedCordinate(0, 4),\n new LedCordinate(1, 4),\n new LedCordinate(2, 4),\n new LedCordinate(3, 4),\n new LedCordinate(4, 4),\n];"],[0,"\n\nba"]],"start1":1331,"start2":1331,"length1":645,"length2":499},{"diffs":[[0,"on () {\n"],[1,"\t"],[0,"\n})\n"]],"start1":1848,"start2":1848,"length1":12,"length2":13}]}]},{"timestamp":1730714444185,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.ts","patch":[{"diffs":[[0,"ome("],[-1,"(element) => LedDisplay.allLeds[i] === element))"],[1,"function (e) {\n return LedDisplay.allLeds[i] == e;\n\n })) {\n led.plot(LedDisplay.allLeds[i].x, LedDisplay.allLeds[i].y);\n } else {\n led.unplot(LedDisplay.allLeds[i].x, LedDisplay.allLeds[i].y);\n }"],[0,"\n "]],"start1":941,"start2":941,"length1":56,"length2":281}]}]},{"timestamp":1730715036892,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.ts","patch":[{"diffs":[[0,"ent) => "],[-1,"Object.keys("],[0,"LedDispl"]],"start1":950,"start2":950,"length1":28,"length2":16},{"diffs":[[0,"s[i]"],[-1,")"],[0," "],[1,"="],[0,"== "],[-1,"Object.keys("],[0,"elem"]],"start1":975,"start2":975,"length1":25,"length2":13},{"diffs":[[0,"lement))"],[-1,") {"],[0,"\n "]],"start1":985,"start2":985,"length1":19,"length2":16},{"diffs":[[0," "],[-1," led.plot(LedDisplay.allLeds[i].x, LedDisplay.allLeds[i].y);\n } else {\n led.unplot(LedDisplay.allLeds[i].x, LedDisplay.allLeds[i].y);\n }\n }\n }\n}\ncons"],[1,"}\n }\n}\nle"],[0,"t sq"]],"start1":998,"start2":998,"length1":211,"length2":20}]}]},{"timestamp":1730715538466,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.ts","patch":[{"diffs":[[0," "],[-1,"let currentLed: { x: number, y: number } = LedDisplay.allLeds[i];\n if (this.image.some((element) => shallowEqual(currentLed, "],[1,"if (this.image.some((element) => Object.keys(LedDisplay.allLeds[i]) == Object.keys("],[0,"elem"]],"start1":921,"start2":921,"length1":144,"length2":91},{"diffs":[[0,";\n }\n"],[1,""],[0," }\n }\n"]],"start1":1194,"start2":1194,"length1":32,"length2":32},{"diffs":[[0," }"],[-1,"\n\n shallowEqual: b(object1: { x: number, y: number }, object2: { x: number, y: number }) {\n if (object1[\"x\"] !== object2[\"x\"]) {\n return false;\n }\n if (object1[\"y\"] !== object2[\"y\"]) {\n return false;\n }\n return true;\n }"],[0,"\n}\nc"]],"start1":1221,"start2":1221,"length1":290,"length2":8}]}]},{"timestamp":1730716138108,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.ts","patch":[{"diffs":[[0,"ent) => "],[-1,"this."],[0,"shallowE"]],"start1":1028,"start2":1028,"length1":21,"length2":16},{"diffs":[[0,"lement))) {\n"],[1,""],[0," "]],"start1":1062,"start2":1062,"length1":24,"length2":24},{"diffs":[[0," }\n"],[-1," \n"],[0," "]],"start1":1259,"start2":1259,"length1":21,"length2":8},{"diffs":[[0," }\n\n "],[-1,"private "],[0,"shallowE"]],"start1":1276,"start2":1276,"length1":24,"length2":16},{"diffs":[[0,"lowEqual"],[1,": b"],[0,"(object1"]],"start1":1288,"start2":1288,"length1":16,"length2":19},{"diffs":[[0,"r })"],[-1,": boolean"],[0," {\n "]],"start1":1365,"start2":1365,"length1":17,"length2":8},{"diffs":[[0,"}\n}\n"],[-1,"const line: LedDisplay = new LedDisplay([\n { x: 0, y: 1 },\n { x: 1, y: 1 },\n { x: 2, y: 1 },\n { x: 3, y: 1 },\n { x: 4, y: 1 },\n])\n"],[0,"cons"]],"start1":1559,"start2":1559,"length1":153,"length2":8},{"diffs":[[0,"nction () {\n"],[1,""],[0," square.a"]],"start1":1966,"start2":1966,"length1":24,"length2":24},{"diffs":[[0,";\n})"],[-1,"\ninput.onButtonPressed(Button.B, function () {\n line.activate();\n})"],[0,"\n\nba"]],"start1":1999,"start2":1999,"length1":78,"length2":8}]}]},{"timestamp":1730716590223,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.ts","patch":[{"diffs":[[0,"();\n})\n\n"],[-1,"\n\n"],[0,"basic.fo"]],"start1":2244,"start2":2244,"length1":18,"length2":16}]}]},{"timestamp":1730788296053,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.ts","patch":[{"diffs":[[0,"();\n})\n\n"],[-1,"inp"],[0,"\n\nbasic."]],"start1":2244,"start2":2244,"length1":19,"length2":16}]}]},{"timestamp":1730788297198,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.ts","patch":[{"diffs":[[0,"();\n})\n\n"],[1,"inp"],[0,"\n\nbasic."]],"start1":2244,"start2":2244,"length1":16,"length2":19}]}]},{"timestamp":1730788527175,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"main.blocks","patch":[{"diffs":[[0,"iables><"],[1,"block type=\"pxt-on-start\" x=\"20\" y=\"20\"><statement name=\"HANDLER\"><block type=\"typescript_statement\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" line0=\"class LedCordinate {\" line1=\" x: number;\" line2=\" y: number;\" line3=\" constructor(x: number, y: number) {\" line4=\" this.x = x;\" line5=\" this.y = y;\" line6=\" }\" line7=\"}\" numlines=\"8\"></mutation><next><block type=\"variables_set\"><field name=\"VAR\" id=\"S;j(sHIkgDP9nGWBTPaU\">square</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"lists_create_with\" inline=\"false\"><mutation items=\"16\" horizontalafter=\"3\"></mutation><value name=\"ADD0\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 0)</field></block></value><value name=\"ADD1\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(1, 0)</field></block></value><value name=\"ADD2\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(2, 0)</field></block></value><value name=\"ADD3\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(3, 0)</field></block></value><value name=\"ADD4\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 0)</field></block></value><value name=\"ADD5\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 1)</field></block></value><value name=\"ADD6\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 1)</field></block></value><value name=\"ADD7\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 2)</field></block></value><value name=\"ADD8\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 2)</field></block></value><value name=\"ADD9\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 3)</field></block></value><value name=\"ADD10\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 3)</field></block></value><value name=\"ADD11\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 4)</field></block></value><value name=\"ADD12\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(1, 4)</field></block></value><value name=\"ADD13\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(2, 4)</field></block></value><value name=\"ADD14\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(3, 4)</field></block></value><value name=\"ADD15\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 4)</field></block></value></block></value></block></next></block></statement></block><block type=\"device_button_event\" x=\"553\" y=\"20\"><field name=\"NAME\">Button.A</field><statement name=\"HANDLER\"><block type=\"function_call\"><mutation name=\"paintLed\" functionid=\"*tRmWjdBaPWbo(5:lgbA\"><arg name=\"image\" id=\"lkb7309eg5yaj5y7jwgn\" type=\"Array\"></arg></mutation><value name=\"lkb7309eg5yaj5y7jwgn\"><block type=\"variables_get\"><field name=\"VAR\" id=\"S;j(sHIkgDP9nGWBTPaU\">square</field></block></value></block></statement></block><block type=\"device_forever\" x=\"849\" y=\"20\"></block><block type=\"function_definition\" x=\"1054\" y=\"20\"><mutation name=\"paintLed\" functionid=\"*tRmWjdBaPWbo(5:lgbA\"><arg name=\"image\" id=\"lkb7309eg5yaj5y7jwgn\" type=\"Array\"></arg></mutation><field name=\"function_name\">paintLed</field><value name=\"lkb7309eg5yaj5y7jwgn\"><block type=\"argument_reporter_array\"><mutation duplicateondrag=\"true\"></mutation><field name=\"VALUE\">image</field></block></value><statement name=\"STACK\"><block type=\"pxt_controls_for\"><value name=\"VAR\"><block type=\"variables_get_reporter\"><mutation duplicateondrag=\"true\"></mutation><field name=\"VAR\" id=\"+C_+SBD.p6%`!CUPIhfg\">i</field></block></value><value name=\"TO\"><shadow type=\"math_whole_number\"><field name=\"NUM\">0</field></shadow><block type=\"math_arithmetic\"><field name=\"OP\">MINUS</field><value name=\"A\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"lists_length\"><value name=\"VALUE\"><block type=\"argument_reporter_array\"><field name=\"VALUE\">image</field></block></value></block></value><value name=\"B\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow></value></block></value><statement name=\"DO\"><block type=\"device_plot\"><value name=\"x\"><shadow type=\"math_number_minmax\"><mutation min=\"0\" max=\"4\" precision=\"0\"></mutation><field name=\"SLIDER\">0</field></shadow><block type=\"typescript_expression\"><field name=\"EXPRESSION\">image[i].x</field></block></value><value name=\"y\"><shadow type=\"math_number_minmax\"><mutation min=\"0\" max=\"4\" precision=\"0\"></mutation><field name=\"SLIDER\">0</field></shadow><block type=\"typescript_expression\"><field name=\"EXPRESSION\">image[i].y</field></block></value></block></statement></block></statement></block><"],[0,"/xml>"]],"start1":223,"start2":223,"length1":13,"length2":4889}]}]},{"timestamp":1733486172687,"editorVersion":"7.0.51","changes":[{"type":"edited","filename":"pxt.json","patch":[{"diffs":[[0," ],\n"],[-1," \"testFiles\": [\n \"test.ts\"\n ],\n"],[0," "]],"start1":223,"start2":223,"length1":52,"length2":8}]},{"type":"added","filename":"test.ts","value":"// här hamnar tester och detta kompileras inte när det här paketet används som ett tillägg.\n"}]}],"snapshots":[{"timestamp":1730709676237,"editorVersion":"7.0.51","text":{"main.blocks":"<xml xmlns=\"http://www.w3.org/1999/xhtml\">\n <block type=\"pxt-on-start\"></block>\n <block type=\"device_forever\"></block>\n</xml>","main.ts":"\n","README.md":"","pxt.json":"{\n \"name\": \"test\",\n \"description\": \"\",\n \"dependencies\": {\n \"core\": \"*\",\n \"radio\": \"*\",\n \"microphone\": \"*\"\n },\n \"files\": [\n \"main.blocks\",\n \"main.ts\",\n \"README.md\"\n ],\n \"additionalFilePaths\": []\n}\n"}},{"timestamp":1730715085331,"editorVersion":"7.0.51","text":{"main.blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable id=\"+C_+SBD.p6%`!CUPIhfg\">i</variable><variable id=\"kex|k}[3owo:$L,!02]|\">list</variable><variable id=\"S;j(sHIkgDP9nGWBTPaU\">square</variable></variables><block type=\"pxt-on-start\" x=\"20\" y=\"20\"><statement name=\"HANDLER\"><block type=\"typescript_statement\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" line0=\"class LedCordinate {\" line1=\" x: number;\" line2=\" y: number;\" line3=\" constructor(x: number, y: number) {\" line4=\" this.x = x;\" line5=\" this.y = y;\" line6=\" }\" line7=\"}\" numlines=\"8\"></mutation><next><block type=\"variables_set\"><field name=\"VAR\" id=\"S;j(sHIkgDP9nGWBTPaU\">square</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"lists_create_with\" inline=\"false\"><mutation items=\"16\" horizontalafter=\"3\"></mutation><value name=\"ADD0\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 0)</field></block></value><value name=\"ADD1\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(1, 0)</field></block></value><value name=\"ADD2\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(2, 0)</field></block></value><value name=\"ADD3\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(3, 0)</field></block></value><value name=\"ADD4\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 0)</field></block></value><value name=\"ADD5\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 1)</field></block></value><value name=\"ADD6\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 1)</field></block></value><value name=\"ADD7\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 2)</field></block></value><value name=\"ADD8\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 2)</field></block></value><value name=\"ADD9\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 3)</field></block></value><value name=\"ADD10\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 3)</field></block></value><value name=\"ADD11\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 4)</field></block></value><value name=\"ADD12\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(1, 4)</field></block></value><value name=\"ADD13\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(2, 4)</field></block></value><value name=\"ADD14\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(3, 4)</field></block></value><value name=\"ADD15\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 4)</field></block></value></block></value></block></next></block></statement></block><block type=\"device_button_event\" x=\"553\" y=\"20\"><field name=\"NAME\">Button.A</field><statement name=\"HANDLER\"><block type=\"function_call\"><mutation name=\"paintLed\" functionid=\"*tRmWjdBaPWbo(5:lgbA\"><arg name=\"image\" id=\"lkb7309eg5yaj5y7jwgn\" type=\"Array\"></arg></mutation><value name=\"lkb7309eg5yaj5y7jwgn\"><block type=\"variables_get\"><field name=\"VAR\" id=\"S;j(sHIkgDP9nGWBTPaU\">square</field></block></value></block></statement></block><block type=\"device_forever\" x=\"849\" y=\"20\"></block><block type=\"function_definition\" x=\"1054\" y=\"20\"><mutation name=\"paintLed\" functionid=\"*tRmWjdBaPWbo(5:lgbA\"><arg name=\"image\" id=\"lkb7309eg5yaj5y7jwgn\" type=\"Array\"></arg></mutation><field name=\"function_name\">paintLed</field><value name=\"lkb7309eg5yaj5y7jwgn\"><block type=\"argument_reporter_array\"><mutation duplicateondrag=\"true\"></mutation><field name=\"VALUE\">image</field></block></value><statement name=\"STACK\"><block type=\"pxt_controls_for\"><value name=\"VAR\"><block type=\"variables_get_reporter\"><mutation duplicateondrag=\"true\"></mutation><field name=\"VAR\" id=\"+C_+SBD.p6%`!CUPIhfg\">i</field></block></value><value name=\"TO\"><shadow type=\"math_whole_number\"><field name=\"NUM\">0</field></shadow><block type=\"math_arithmetic\"><field name=\"OP\">MINUS</field><value name=\"A\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"lists_length\"><value name=\"VALUE\"><block type=\"argument_reporter_array\"><field name=\"VALUE\">image</field></block></value></block></value><value name=\"B\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow></value></block></value><statement name=\"DO\"><block type=\"device_plot\"><value name=\"x\"><shadow type=\"math_number_minmax\"><mutation min=\"0\" max=\"4\" precision=\"0\"></mutation><field name=\"SLIDER\">0</field></shadow><block type=\"typescript_expression\"><field name=\"EXPRESSION\">image[i].x</field></block></value><value name=\"y\"><shadow type=\"math_number_minmax\"><mutation min=\"0\" max=\"4\" precision=\"0\"></mutation><field name=\"SLIDER\">0</field></shadow><block type=\"typescript_expression\"><field name=\"EXPRESSION\">image[i].y</field></block></value></block></statement></block></statement></block></xml>","main.ts":"class LedDisplay {\n private static allLeds: Array<{ x: number, y: number }> = [\n { x: 0, y: 0 },\n { x: 0, y: 1 },\n { x: 0, y: 2 },\n { x: 0, y: 3 },\n { x: 0, y: 4 },\n { x: 1, y: 0 },\n { x: 1, y: 1 },\n { x: 1, y: 2 },\n { x: 1, y: 3 },\n { x: 1, y: 4 },\n { x: 2, y: 0 },\n { x: 2, y: 1 },\n { x: 2, y: 2 },\n { x: 2, y: 3 },\n { x: 2, y: 4 },\n { x: 3, y: 0 },\n { x: 3, y: 1 },\n { x: 3, y: 2 },\n { x: 3, y: 3 },\n { x: 3, y: 4 },\n { x: 4, y: 0 },\n { x: 4, y: 1 },\n { x: 4, y: 2 },\n { x: 4, y: 3 },\n { x: 4, y: 4 },\n ];\n\n image: Array<{ x: number, y: number }>;\n constructor(image: Array<{ x: number, y: number }>) {\n this.image = image;\n }\n\n activate(): void {\n for (let i = 0; i < LedDisplay.allLeds.length; i++) {\n if (this.image.some((element) => LedDisplay.allLeds[i] === element)) {\n led.plot(LedDisplay.allLeds)\n }\n }\n }\n}\nlet square: LedDisplay = new LedDisplay([\n { x: 0, y: 0 },\n { x: 1, y: 0 },\n { x: 2, y: 0 },\n { x: 3, y: 0 },\n { x: 4, y: 0 },\n { x: 0, y: 1 },\n { x: 4, y: 1 },\n { x: 0, y: 2 },\n { x: 4, y: 2 },\n { x: 0, y: 3 },\n { x: 4, y: 3 },\n { x: 0, y: 4 },\n { x: 1, y: 4 },\n { x: 2, y: 4 },\n { x: 3, y: 4 },\n { x: 4, y: 4 },\n]);\n\ninput.onButtonPressed(Button.A, function () {\n square.activate();\n})\n\nbasic.forever(function () {\n\n})\n","README.md":"","pxt.json":"{\n \"name\": \"test\",\n \"description\": \"\",\n \"dependencies\": {\n \"core\": \"*\",\n \"radio\": \"*\",\n \"microphone\": \"*\"\n },\n \"files\": [\n \"main.blocks\",\n \"main.ts\",\n \"README.md\"\n ],\n \"preferredEditor\": \"tsprj\"\n}\n"}},{"timestamp":1730788296053,"editorVersion":"7.0.51","text":{"main.blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable id=\"+C_+SBD.p6%`!CUPIhfg\">i</variable><variable id=\"kex|k}[3owo:$L,!02]|\">list</variable><variable id=\"S;j(sHIkgDP9nGWBTPaU\">square</variable></variables><block type=\"pxt-on-start\" x=\"20\" y=\"20\"><statement name=\"HANDLER\"><block type=\"typescript_statement\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" line0=\"class LedCordinate {\" line1=\" x: number;\" line2=\" y: number;\" line3=\" constructor(x: number, y: number) {\" line4=\" this.x = x;\" line5=\" this.y = y;\" line6=\" }\" line7=\"}\" numlines=\"8\"></mutation><next><block type=\"variables_set\"><field name=\"VAR\" id=\"S;j(sHIkgDP9nGWBTPaU\">square</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"lists_create_with\" inline=\"false\"><mutation items=\"16\" horizontalafter=\"3\"></mutation><value name=\"ADD0\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 0)</field></block></value><value name=\"ADD1\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(1, 0)</field></block></value><value name=\"ADD2\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(2, 0)</field></block></value><value name=\"ADD3\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(3, 0)</field></block></value><value name=\"ADD4\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 0)</field></block></value><value name=\"ADD5\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 1)</field></block></value><value name=\"ADD6\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 1)</field></block></value><value name=\"ADD7\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 2)</field></block></value><value name=\"ADD8\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 2)</field></block></value><value name=\"ADD9\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 3)</field></block></value><value name=\"ADD10\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 3)</field></block></value><value name=\"ADD11\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 4)</field></block></value><value name=\"ADD12\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(1, 4)</field></block></value><value name=\"ADD13\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(2, 4)</field></block></value><value name=\"ADD14\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(3, 4)</field></block></value><value name=\"ADD15\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 4)</field></block></value></block></value></block></next></block></statement></block><block type=\"device_button_event\" x=\"553\" y=\"20\"><field name=\"NAME\">Button.A</field><statement name=\"HANDLER\"><block type=\"function_call\"><mutation name=\"paintLed\" functionid=\"*tRmWjdBaPWbo(5:lgbA\"><arg name=\"image\" id=\"lkb7309eg5yaj5y7jwgn\" type=\"Array\"></arg></mutation><value name=\"lkb7309eg5yaj5y7jwgn\"><block type=\"variables_get\"><field name=\"VAR\" id=\"S;j(sHIkgDP9nGWBTPaU\">square</field></block></value></block></statement></block><block type=\"device_forever\" x=\"849\" y=\"20\"></block><block type=\"function_definition\" x=\"1054\" y=\"20\"><mutation name=\"paintLed\" functionid=\"*tRmWjdBaPWbo(5:lgbA\"><arg name=\"image\" id=\"lkb7309eg5yaj5y7jwgn\" type=\"Array\"></arg></mutation><field name=\"function_name\">paintLed</field><value name=\"lkb7309eg5yaj5y7jwgn\"><block type=\"argument_reporter_array\"><mutation duplicateondrag=\"true\"></mutation><field name=\"VALUE\">image</field></block></value><statement name=\"STACK\"><block type=\"pxt_controls_for\"><value name=\"VAR\"><block type=\"variables_get_reporter\"><mutation duplicateondrag=\"true\"></mutation><field name=\"VAR\" id=\"+C_+SBD.p6%`!CUPIhfg\">i</field></block></value><value name=\"TO\"><shadow type=\"math_whole_number\"><field name=\"NUM\">0</field></shadow><block type=\"math_arithmetic\"><field name=\"OP\">MINUS</field><value name=\"A\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"lists_length\"><value name=\"VALUE\"><block type=\"argument_reporter_array\"><field name=\"VALUE\">image</field></block></value></block></value><value name=\"B\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow></value></block></value><statement name=\"DO\"><block type=\"device_plot\"><value name=\"x\"><shadow type=\"math_number_minmax\"><mutation min=\"0\" max=\"4\" precision=\"0\"></mutation><field name=\"SLIDER\">0</field></shadow><block type=\"typescript_expression\"><field name=\"EXPRESSION\">image[i].x</field></block></value><value name=\"y\"><shadow type=\"math_number_minmax\"><mutation min=\"0\" max=\"4\" precision=\"0\"></mutation><field name=\"SLIDER\">0</field></shadow><block type=\"typescript_expression\"><field name=\"EXPRESSION\">image[i].y</field></block></value></block></statement></block></statement></block></xml>","main.ts":"class LedDisplay {\n private static allLeds: Array<{ x: number, y: number }> = [\n { x: 0, y: 0 },\n { x: 0, y: 1 },\n { x: 0, y: 2 },\n { x: 0, y: 3 },\n { x: 0, y: 4 },\n { x: 1, y: 0 },\n { x: 1, y: 1 },\n { x: 1, y: 2 },\n { x: 1, y: 3 },\n { x: 1, y: 4 },\n { x: 2, y: 0 },\n { x: 2, y: 1 },\n { x: 2, y: 2 },\n { x: 2, y: 3 },\n { x: 2, y: 4 },\n { x: 3, y: 0 },\n { x: 3, y: 1 },\n { x: 3, y: 2 },\n { x: 3, y: 3 },\n { x: 3, y: 4 },\n { x: 4, y: 0 },\n { x: 4, y: 1 },\n { x: 4, y: 2 },\n { x: 4, y: 3 },\n { x: 4, y: 4 },\n ];\n\n image: Array<{ x: number, y: number }>;\n constructor(image: Array<{ x: number, y: number }>) {\n this.image = image;\n }\n\n activate(): void {\n for (let i = 0; i < LedDisplay.allLeds.length; i++) {\n let currentLed: { x: number, y: number } = LedDisplay.allLeds[i];\n if (this.image.some((element) => this.shallowEqual(currentLed, element))) {\n led.plot(LedDisplay.allLeds[i].x, LedDisplay.allLeds[i].y);\n } else {\n led.unplot(LedDisplay.allLeds[i].x, LedDisplay.allLeds[i].y);\n }\n \n }\n }\n\n private shallowEqual(object1: { x: number, y: number }, object2: { x: number, y: number }): boolean {\n if (object1[\"x\"] !== object2[\"x\"]) {\n return false;\n }\n if (object1[\"y\"] !== object2[\"y\"]) {\n return false;\n }\n return true;\n }\n}\nconst line: LedDisplay = new LedDisplay([\n { x: 0, y: 1 },\n { x: 1, y: 1 },\n { x: 2, y: 1 },\n { x: 3, y: 1 },\n { x: 4, y: 1 },\n])\nconst square: LedDisplay = new LedDisplay([\n { x: 0, y: 0 },\n { x: 1, y: 0 },\n { x: 2, y: 0 },\n { x: 3, y: 0 },\n { x: 4, y: 0 },\n { x: 0, y: 1 },\n { x: 4, y: 1 },\n { x: 0, y: 2 },\n { x: 4, y: 2 },\n { x: 0, y: 3 },\n { x: 4, y: 3 },\n { x: 0, y: 4 },\n { x: 1, y: 4 },\n { x: 2, y: 4 },\n { x: 3, y: 4 },\n { x: 4, y: 4 },\n]);\n\ninput.onButtonPressed(Button.A, function () {\n square.activate();\n})\ninput.onButtonPressed(Button.B, function () {\n line.activate();\n})\n\nbasic.forever(function () {\n\n})\n","README.md":"","pxt.json":"{\n \"name\": \"test\",\n \"description\": \"\",\n \"dependencies\": {\n \"core\": \"*\",\n \"radio\": \"*\",\n \"microphone\": \"*\"\n },\n \"files\": [\n \"main.blocks\",\n \"main.ts\",\n \"README.md\"\n ],\n \"preferredEditor\": \"tsprj\"\n}\n"}},{"timestamp":1733486172687,"editorVersion":"7.0.51","text":{"main.blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable id=\"+C_+SBD.p6%`!CUPIhfg\">i</variable><variable id=\"kex|k}[3owo:$L,!02]|\">list</variable><variable id=\"S;j(sHIkgDP9nGWBTPaU\">square</variable></variables><block type=\"pxt-on-start\" x=\"20\" y=\"20\"><statement name=\"HANDLER\"><block type=\"typescript_statement\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" line0=\"class LedCordinate {\" line1=\" x: number;\" line2=\" y: number;\" line3=\" constructor(x: number, y: number) {\" line4=\" this.x = x;\" line5=\" this.y = y;\" line6=\" }\" line7=\"}\" numlines=\"8\"></mutation><next><block type=\"variables_set\"><field name=\"VAR\" id=\"S;j(sHIkgDP9nGWBTPaU\">square</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"lists_create_with\" inline=\"false\"><mutation items=\"16\" horizontalafter=\"3\"></mutation><value name=\"ADD0\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 0)</field></block></value><value name=\"ADD1\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(1, 0)</field></block></value><value name=\"ADD2\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(2, 0)</field></block></value><value name=\"ADD3\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(3, 0)</field></block></value><value name=\"ADD4\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 0)</field></block></value><value name=\"ADD5\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 1)</field></block></value><value name=\"ADD6\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 1)</field></block></value><value name=\"ADD7\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 2)</field></block></value><value name=\"ADD8\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 2)</field></block></value><value name=\"ADD9\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 3)</field></block></value><value name=\"ADD10\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 3)</field></block></value><value name=\"ADD11\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(0, 4)</field></block></value><value name=\"ADD12\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(1, 4)</field></block></value><value name=\"ADD13\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(2, 4)</field></block></value><value name=\"ADD14\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(3, 4)</field></block></value><value name=\"ADD15\"><block type=\"typescript_expression\"><field name=\"EXPRESSION\">new LedCordinate(4, 4)</field></block></value></block></value></block></next></block></statement></block><block type=\"device_button_event\" x=\"553\" y=\"20\"><field name=\"NAME\">Button.A</field><statement name=\"HANDLER\"><block type=\"function_call\"><mutation name=\"paintLed\" functionid=\"*tRmWjdBaPWbo(5:lgbA\"><arg name=\"image\" id=\"lkb7309eg5yaj5y7jwgn\" type=\"Array\"></arg></mutation><value name=\"lkb7309eg5yaj5y7jwgn\"><block type=\"variables_get\"><field name=\"VAR\" id=\"S;j(sHIkgDP9nGWBTPaU\">square</field></block></value></block></statement></block><block type=\"device_forever\" x=\"849\" y=\"20\"></block><block type=\"function_definition\" x=\"1054\" y=\"20\"><mutation name=\"paintLed\" functionid=\"*tRmWjdBaPWbo(5:lgbA\"><arg name=\"image\" id=\"lkb7309eg5yaj5y7jwgn\" type=\"Array\"></arg></mutation><field name=\"function_name\">paintLed</field><value name=\"lkb7309eg5yaj5y7jwgn\"><block type=\"argument_reporter_array\"><mutation duplicateondrag=\"true\"></mutation><field name=\"VALUE\">image</field></block></value><statement name=\"STACK\"><block type=\"pxt_controls_for\"><value name=\"VAR\"><block type=\"variables_get_reporter\"><mutation duplicateondrag=\"true\"></mutation><field name=\"VAR\" id=\"+C_+SBD.p6%`!CUPIhfg\">i</field></block></value><value name=\"TO\"><shadow type=\"math_whole_number\"><field name=\"NUM\">0</field></shadow><block type=\"math_arithmetic\"><field name=\"OP\">MINUS</field><value name=\"A\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"lists_length\"><value name=\"VALUE\"><block type=\"argument_reporter_array\"><field name=\"VALUE\">image</field></block></value></block></value><value name=\"B\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow></value></block></value><statement name=\"DO\"><block type=\"device_plot\"><value name=\"x\"><shadow type=\"math_number_minmax\"><mutation min=\"0\" max=\"4\" precision=\"0\"></mutation><field name=\"SLIDER\">0</field></shadow><block type=\"typescript_expression\"><field name=\"EXPRESSION\">image[i].x</field></block></value><value name=\"y\"><shadow type=\"math_number_minmax\"><mutation min=\"0\" max=\"4\" precision=\"0\"></mutation><field name=\"SLIDER\">0</field></shadow><block type=\"typescript_expression\"><field name=\"EXPRESSION\">image[i].y</field></block></value></block></statement></block></statement></block></xml>","main.ts":"class LedDisplay {\n private static allLeds: Array<{ x: number, y: number }> = [\n { x: 0, y: 0 },\n { x: 0, y: 1 },\n { x: 0, y: 2 },\n { x: 0, y: 3 },\n { x: 0, y: 4 },\n { x: 1, y: 0 },\n { x: 1, y: 1 },\n { x: 1, y: 2 },\n { x: 1, y: 3 },\n { x: 1, y: 4 },\n { x: 2, y: 0 },\n { x: 2, y: 1 },\n { x: 2, y: 2 },\n { x: 2, y: 3 },\n { x: 2, y: 4 },\n { x: 3, y: 0 },\n { x: 3, y: 1 },\n { x: 3, y: 2 },\n { x: 3, y: 3 },\n { x: 3, y: 4 },\n { x: 4, y: 0 },\n { x: 4, y: 1 },\n { x: 4, y: 2 },\n { x: 4, y: 3 },\n { x: 4, y: 4 },\n ];\n\n image: Array<{ x: number, y: number }>;\n constructor(image: Array<{ x: number, y: number }>) {\n this.image = image;\n }\n\n activate(): void {\n for (let i = 0; i < LedDisplay.allLeds.length; i++) {\n let currentLed: { x: number, y: number } = LedDisplay.allLeds[i];\n if (this.image.some((element) => this.shallowEqual(currentLed, element))) {\n led.plot(LedDisplay.allLeds[i].x, LedDisplay.allLeds[i].y);\n } else {\n led.unplot(LedDisplay.allLeds[i].x, LedDisplay.allLeds[i].y);\n }\n \n }\n }\n\n private shallowEqual(object1: { x: number, y: number }, object2: { x: number, y: number }): boolean {\n if (object1[\"x\"] !== object2[\"x\"]) {\n return false;\n }\n if (object1[\"y\"] !== object2[\"y\"]) {\n return false;\n }\n return true;\n }\n}\nconst line: LedDisplay = new LedDisplay([\n { x: 0, y: 1 },\n { x: 1, y: 1 },\n { x: 2, y: 1 },\n { x: 3, y: 1 },\n { x: 4, y: 1 },\n])\nconst square: LedDisplay = new LedDisplay([\n { x: 0, y: 0 },\n { x: 1, y: 0 },\n { x: 2, y: 0 },\n { x: 3, y: 0 },\n { x: 4, y: 0 },\n { x: 0, y: 1 },\n { x: 4, y: 1 },\n { x: 0, y: 2 },\n { x: 4, y: 2 },\n { x: 0, y: 3 },\n { x: 4, y: 3 },\n { x: 0, y: 4 },\n { x: 1, y: 4 },\n { x: 2, y: 4 },\n { x: 3, y: 4 },\n { x: 4, y: 4 },\n]);\n\ninput.onButtonPressed(Button.A, function () {\n square.activate();\n})\ninput.onButtonPressed(Button.B, function () {\n line.activate();\n})\n\n\n\nbasic.forever(function () {\n\n})\n","README.md":"","pxt.json":"{\n \"name\": \"test\",\n \"description\": \"\",\n \"dependencies\": {\n \"core\": \"*\",\n \"radio\": \"*\",\n \"microphone\": \"*\"\n },\n \"files\": [\n \"main.blocks\",\n \"main.ts\",\n \"README.md\"\n ],\n \"preferredEditor\": \"tsprj\"\n}\n"}}],"shares":[],"lastSaveTime":1733486172705}