diff --git a/dist/entry.js b/dist/entry.js index 58842b875e..f628ba0972 100644 --- a/dist/entry.js +++ b/dist/entry.js @@ -965,8 +965,8 @@ Blockly.Blocks.arduino_toggle_led = {init:function() { this.setNextStatement(!0); }}; Entry.block.arduino_toggle_led = function(b, a) { - var d = a.getNumberValue("VALUE"), c = a.getField("OPERATOR"); - Entry.hw.setDigitalPortValue(d, "on" == c ? 255 : 0); + var d = a.getNumberValue("VALUE"), c = "on" == a.getField("OPERATOR") ? 255 : 0; + Entry.hw.setDigitalPortValue(d, c); return a.callReturn(); }; Blockly.Blocks.arduino_toggle_pwm = {init:function() { @@ -1170,8 +1170,8 @@ Blockly.Blocks.dplay_select_led = {init:function() { Entry.block.dplay_select_led = function(b, a) { var d = a.getField("PORT"), c = 7; "7" == d ? c = 7 : "8" == d ? c = 8 : "9" == d ? c = 9 : "10" == d && (c = 10); - d = a.getField("OPERATOR"); - Entry.hw.setDigitalPortValue(c, "on" == d ? 255 : 0); + d = "on" == a.getField("OPERATOR") ? 255 : 0; + Entry.hw.setDigitalPortValue(c, d); return a.callReturn(); }; Blockly.Blocks.dplay_get_switch_status = {init:function() { @@ -2604,10 +2604,10 @@ Entry.block.wait_second = function(b, a) { } a.isStart = !0; a.timeFlag = 1; - var d = a.getNumberValue("SECOND", a); + var d = a.getNumberValue("SECOND", a), d = 60 / (Entry.FPS || 60) * d * 1E3; setTimeout(function() { a.timeFlag = 0; - }, 60 / (Entry.FPS || 60) * d * 1E3); + }, d); return a; }; Blockly.Blocks.repeat_basic = {init:function() { @@ -5057,8 +5057,8 @@ Blockly.Blocks.roduino_set_digital = {init:function() { this.setNextStatement(!0); }}; Entry.block.roduino_set_digital = function(b, a) { - var d = a.getNumberValue("VALUE"), c = a.getField("OPERATOR"); - Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_WRITE, d, "on" == c ? 1 : 0]); + var d = a.getNumberValue("VALUE"), c = "on" == a.getField("OPERATOR") ? 1 : 0; + Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_WRITE, d, c]); return a.callReturn(); }; Blockly.Blocks.roduino_motor = {init:function() { @@ -5134,8 +5134,8 @@ Blockly.Blocks.schoolkit_set_output = {init:function() { this.setNextStatement(!0); }}; Entry.block.schoolkit_set_output = function(b, a) { - var d = a.getNumberValue("VALUE"), c = a.getField("OPERATOR"); - Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_WRITE, d, "on" == c ? 1 : 0]); + var d = a.getNumberValue("VALUE"), c = "on" == a.getField("OPERATOR") ? 1 : 0; + Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_WRITE, d, c]); return a.callReturn(); }; Blockly.Blocks.schoolkit_get_in_port_number = {init:function() { @@ -5171,9 +5171,9 @@ Blockly.Blocks.schoolkit_motor = {init:function() { this.setNextStatement(!0); }}; Entry.block.schoolkit_motor = function(b, a) { - var d = 0, d = a.getField("MODE"), c = a.getField("OPERATOR"), e = a.getNumberValue("VALUE"), d = "motor1" == d ? 7 : 8; - 255 < e ? e = 255 : 0 > e && (e = 0); - "cw" == c ? Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, 1, d, e]) : "ccw" == c ? Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, 2, d, e]) : "stop" == c && Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, 0, d, e]); + var d = 0, c = 0, d = a.getField("MODE"), e = a.getField("OPERATOR"), f = a.getNumberValue("VALUE"), d = "motor1" == d ? 7 : 8; + 255 < f ? f = 255 : 0 > f && (f = 0); + "cw" == e ? Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, 1, d, f]) : "ccw" == e ? Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, 2, d, f]) : "stop" == e && Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, c, d, f]); return a.callReturn(); }; Blockly.Blocks.schoolkit_set_servo_value = {init:function() { @@ -7005,7 +7005,8 @@ Entry.Container.prototype.removeObject = function(b) { this.objects_.splice(a, 1); this.setCurrentObjects(); Entry.stage.sortZorder(); - this.objects_.length && 0 !== a ? 0 < this.getCurrentObjects().length ? Entry.container.selectObject(this.getCurrentObjects()[0].id) : Entry.container.selectObject() : this.objects_.length && 0 === a ? Entry.container.selectObject(this.getCurrentObjects()[0].id) : (Entry.container.selectObject(), Entry.playground.flushPlayground()); + a = this.getCurrentObjects(); + a.length ? this.selectObject(a[0].id) : (this.selectObject(), Entry.playground.flushPlayground()); Entry.toast.success(Lang.Workspace.remove_object, b.name + " " + Lang.Workspace.remove_object_msg); Entry.variableContainer.removeLocalVariables(b.id); Entry.playground.reloadPlayground(); @@ -10668,6 +10669,7 @@ Entry.Painter.prototype.selectToolbox = function(b) { }; Entry.Painter2 = function(b) { this.view = b; + this.baseUrl = Entry.painterBaseUrl || "/lib/literallycanvas/lib/img"; this.file = {id:Entry.generateHash(), name:"\uc0c8\uadf8\ub9bc", modified:!1, mode:"new"}; Entry.addEventListener("pictureImport", function(a) { this.addPicture(a); @@ -10677,10 +10679,10 @@ Entry.Painter2 = function(b) { (function(b) { b.initialize = function() { if (!this.lc) { - var a = new Image; - a.src = "/lib/literallycanvas/lib/img/transparent-pattern.png"; - this.lc = LC.init(this.view, {imageURLPrefix:"/lib/literallycanvas/lib/img", zoomMax:3, zoomMin:.5, toolbarPosition:"bottom", imageSize:{width:960, height:540}, backgroundShapes:[LC.createShape("Rectangle", {x:0, y:0, width:960, height:540, strokeWidth:0, strokeColor:"transparent"})]}); - a.onload = function() { + var a = this.baseUrl, b = new Image; + b.src = a + "/transparent-pattern.png"; + this.lc = LC.init(this.view, {imageURLPrefix:a, zoomMax:3, zoomMin:.5, toolbarPosition:"bottom", imageSize:{width:960, height:540}, backgroundShapes:[LC.createShape("Rectangle", {x:0, y:0, width:960, height:540, strokeWidth:0, strokeColor:"transparent"})]}); + b.onload = function() { this.lc.repaintLayer("background"); }.bind(this); a = function(a) { @@ -12382,7 +12384,10 @@ Entry.TextCodingUtil = function() { return a.join("\n"); }; b.eventBlockSyntaxFilter = function(a) { - return "entry_event_start" == a || "entry_event_key" == a || "entry_event_mouse_down" == a || "entry_event_mouse_up" == a || "entry_event_object_down" == a || "entry_event_signal" == a || "entry_event_scene_start" == a || "entry_event_clone_create" == a ? "def " + a : a; + if ("entry_event_start" == a || "entry_event_key" == a || "entry_event_mouse_down" == a || "entry_event_mouse_up" == a || "entry_event_object_down" == a || "entry_event_signal" == a || "entry_event_scene_start" == a || "entry_event_clone_create" == a) { + a = "def " + a; + } + return a; }; b.isEntryEventFunc = function(a) { return "def entry_event_start" == a || "def entry_event_key" == a || "def entry_event_mouse_down" == a || "def entry_event_mouse_up" == a || "def entry_event_object_down" == a || "def entry_event_signal" == a || "def entry_event_scene_start" == a || "def entry_event_clone_create" == a ? !0 : !1; @@ -13349,7 +13354,7 @@ Entry.PyToBlockParser = function(b) { console.log("ExpressionStatement component", a); var b = {}; a = a.expression; - a.type && (a = this[a.type](a), console.log("ExpressionStatement expressionData", a), a.type && a.params ? (b.type = a.type, b.params = a.params, result = b) : a.type ? (b.type = a.type, result = b) : result = a); + a.type && (a = this[a.type](a), console.log("ExpressionStatement expressionData", a), a.type && a.params ? (b.type = a.type, b.params = a.params) : a.type ? b.type = a.type : b = a, result = b); console.log("ExpressionStatement result", result); return result; }; @@ -13609,13 +13614,14 @@ Entry.PyToBlockParser = function(b) { console.log("Literal value", e); b || (b = {type:"Block"}, c || (c = "number" == typeof e ? {type:"number"} : {type:"text"})); if ("Indicator" == b.type) { + var f; return null; } if ("Text" == b.type) { return ""; } console.log("Literal paramMeta", b, "paramDefMeta", c); - null != a.value ? (b = this["Param" + b.type](e, b, c), console.log("Literal param", void 0)) : (b = [], c = this[a.left.type](a.left), b.push(c), b.push(a.operator), a = this[a.right.type](a.right), b.push(a)); + null != a.value ? (b = this["Param" + b.type](e, b, c), console.log("Literal param", f)) : (b = [], f = this[a.left.type](a.left), b.push(f), b.push(a.operator), a = this[a.right.type](a.right), b.push(a)); a = b; console.log("Literal result", a); return a; @@ -13642,8 +13648,9 @@ Entry.PyToBlockParser = function(b) { f.push(e); b.type = c.type; b.params = f; - console.log("ParamBlock result", b); - return b; + a = b; + console.log("ParamBlock result", a); + return a; }; b.ParamAngle = function(a, b, c) { console.log("ParamAngle value, paramMeta, paramDefMeta", a, b, c); @@ -13947,8 +13954,9 @@ Entry.PyToBlockParser = function(b) { }; b.ForInStatement = function(a) { console.log("ForInStatement component", a); - console.log("ForInStatement result", null); - return null; + a = null; + console.log("ForInStatement result", a); + return a; }; b.BreakStatement = function(a) { console.log("BreakStatement component", a); @@ -14282,7 +14290,8 @@ Entry.PyToBlockParser = function(b) { if (f == blockFuncName) { if (console.log("textFuncName", f), console.log("blockFuncName", blockFuncName), console.log("textFuncParams.length", c.length), console.log("Object.keys(paramMap).length", Object.keys(h).length), c.length == Object.keys(h).length ? (k = !0, console.log("textFuncParams.length", c.length), console.log("Object.keys(paramMap).length", Object.keys(h).length), l = q.content._data[0]._data, g = l.slice(), g.shift(), console.log("blockFuncContents", l), l = Entry.TextCodingUtil.prototype.isFuncContentsMatch(g, a, h)) : l = k = !1, k && l) { - m = "func".concat("_").concat(n); + m = "func"; + m = m.concat("_").concat(n); break; } else { if (k && !l) { @@ -14296,8 +14305,8 @@ Entry.PyToBlockParser = function(b) { console.log("FunctionDeclaration matchFlag", l); if (k && l) { console.log("targetFuncId", m); - var u = c.length; - this._funcMap.put(f + u, m); + var u = c.length, u = f + u; + this._funcMap.put(u, m); console.log("FunctionDeclaration this._funcMap", this._funcMap); b = m; } else { @@ -21172,7 +21181,7 @@ Entry.BlockView.pngMap = {}; b._updateBG = function() { if (this._board.dragBlock && this._board.dragBlock.dragInstance) { var a = this.svgGroup; - if (this.magnet.next) { + if (this.magnet.next || this.magnet.previous) { if (a = this.magneting) { var b = this._board.dragBlock.getShadow(), c = this.getAbsoluteCoordinate(), e; if ("previous" === a) { @@ -21244,15 +21253,17 @@ Entry.BlockView.pngMap = {}; c._moveBy(a, a, !1); }, b) : c._moveBy(a, a, !1); }; - b.bindPrev = function(a) { + b.bindPrev = function(a, b) { if (a) { - if (this._toLocalCoordinate(a.view._nextGroup), (a = a.getNextBlock()) && a !== this.block) { - var b = this.block.getLastBlock(); - b.view.magnet.next ? a.view._toLocalCoordinate(b.view._nextGroup) : (a.view._toGlobalCoordinate(), a.separate(), a.view.bumpAway(null, 100)); + this._toLocalCoordinate(a.view._nextGroup); + var c = a.getNextBlock(); + if (c && c && c !== this.block) { + var e = this.block.getLastBlock(); + b ? c.view._toLocalCoordinate(a.view._nextGroup) : e.view.magnet.next ? c.view._toLocalCoordinate(e.view._nextGroup) : (c.view._toGlobalCoordinate(), c.separate(), c.view.bumpAway(null, 100)); } } else { if (a = this.block.getPrevBlock()) { - this._toLocalCoordinate(a.view._nextGroup), (a = this.block.getNextBlock()) && a.view && a.view._toLocalCoordinate(this._nextGroup); + this._toLocalCoordinate(a.view._nextGroup), (c = this.block.getNextBlock()) && c.view && c.view._toLocalCoordinate(this._nextGroup); } } }; @@ -21407,12 +21418,14 @@ Entry.BlockView.pngMap = {}; } return f.promise(); }; - b.downloadAsImage = function() { - this.getDataUrl().then(function(a) { - var b = document.createElement("a"); - b.href = a.src; - b.download = "\uc5d4\ud2b8\ub9ac \ube14\ub85d.png"; - b.click(); + b.downloadAsImage = function(a) { + this.getDataUrl().then(function(b) { + var c = document.createElement("a"); + c.href = b.src; + b = "\uc5d4\ud2b8\ub9ac \ube14\ub85d"; + a && (b += a); + c.download = b + ".png"; + c.click(); }); }; b._rightClick = function(a) { @@ -23520,25 +23533,28 @@ Entry.Board.DRAG_RADIUS = 5; this.workspace.setMode(Entry.Workspace.MODE_BOARD, "save"); }; b.generateCodeMagnetMap = function() { - var a = this.code; - if (a && this.dragBlock) { - for (var b in this.dragBlock.magnet) { - var c = this._getCodeBlocks(a, b); - c.sort(function(a, b) { - return a.point - b.point; - }); - c.unshift({point:-Number.MAX_VALUE, blocks:[]}); - for (var e = 1;e < c.length;e++) { - var f = c[e], g = f, h = f.startBlock; - if (h) { - for (var k = f.endPoint, l = e;k > g.point && (g.blocks.push(h), l++, g = c[l], g);) { + var a = this.code, b = this.dragBlock; + if (a && b) { + this._magnetMap = {}; + for (var c in b.magnet) { + if ("next" !== c || void 0 !== b.block.getLastBlock().view.magnet.next) { + var e = this._getCodeBlocks(a, c); + e.sort(function(a, b) { + return a.point - b.point; + }); + e.unshift({point:-Number.MAX_VALUE, blocks:[]}); + for (var f = 1;f < e.length;f++) { + var g = e[f], h = g, k = g.startBlock; + if (k) { + for (var l = g.endPoint, m = f;l > h.point && (h.blocks.push(k), m++, h = e[m], h);) { + } + delete g.startBlock; } - delete f.startBlock; + g.endPoint = Number.MAX_VALUE; + e[f - 1].endPoint = g.point; } - f.endPoint = Number.MAX_VALUE; - c[e - 1].endPoint = f.point; + this._magnetMap[c] = e; } - this._magnetMap[b] = c; } } }; @@ -23552,8 +23568,7 @@ Entry.Board.DRAG_RADIUS = 5; f = this._getPreviousMagnets; break; case "string": - f = this._getFieldMagnets; - break; + ; case "boolean": f = this._getFieldMagnets; break; @@ -23762,8 +23777,13 @@ Entry.Board.DRAG_RADIUS = 5; }}}, {activated:!0, option:{text:Lang.Blocks.Clear_all_blocks, callback:function() { a.code.clear(!0); }}}, {activated:"workspace" === Entry.type && Entry.Utils.isChrome() && !Entry.isMobile(), option:{text:Lang.Menus.save_as_image_all, enable:!0, callback:function() { - a.code.getThreads().forEach(function(a) { - (a = a.getFirstBlock()) && a.view.downloadAsImage(); + var b = a.code.getThreads(), c = []; + b.forEach(function(a, f) { + var g = a.getFirstBlock(); + g && (console.log("threads.length=", b.length), 1 < b.length && Entry.isOffline ? g.view.getDataUrl().then(function(a) { + c.push(a); + c.length == b.length && Entry.dispatchEvent("saveBlockImages", {images:c}); + }) : g.view.downloadAsImage(++f)); }); }}}]; }; @@ -24341,7 +24361,7 @@ Entry.Block.DELETABLE_FALSE_LIGHTEN = 3; this.getCode().unregisterBlock(this); f = this.getThread(); this._schema && this._schema.event && f.unregisterEvent(this, this._schema.event); - c && (b ? c.destroy(a, b) : g ? c.view && c.view.bindPrev(g) : (b = this.getThread().view.getParent(), b.constructor === Entry.FieldStatement ? (c.view && c.view.bindPrev(b), b.insertTopBlock(c)) : b.constructor === Entry.FieldStatement ? c.replace(b._valueBlock) : c.view._toGlobalCoordinate())); + c && (b ? c.destroy(a, b) : g ? c.view && c.view.bindPrev(g, !0) : (b = this.getThread().view.getParent(), b.constructor === Entry.FieldStatement ? (c.view && c.view.bindPrev(b), b.insertTopBlock(c)) : b.constructor === Entry.FieldStatement ? c.replace(b._valueBlock) : c.view._toGlobalCoordinate())); !this.doNotSplice && f.spliceBlock ? f.spliceBlock(this) : delete this.doNotSplice; this.view && this.view.destroy(a); this._schemaChangeEvent && this._schemaChangeEvent.destroy(); diff --git a/dist/entry.min.js b/dist/entry.min.js index 738592489c..73cf875aeb 100644 --- a/dist/entry.min.js +++ b/dist/entry.min.js @@ -105,7 +105,7 @@ Blockly.Blocks.arduino_get_pwm_port_number={init:function(){this.setColour("#009 Blockly.Blocks.arduino_get_number_sensor_value={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_num_sensor_value_1);this.appendValueInput("VALUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_num_sensor_value_2).appendField(" ");this.setInputsInline(!0);this.setOutput(!0,"Number")}};Entry.block.arduino_get_number_sensor_value=function(b,a){var d=a.getValue("VALUE",a);return Entry.hw.getAnalogPortValue(d[1])}; Blockly.Blocks.arduino_get_digital_value={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_get_digital_value_1);this.appendValueInput("VALUE").setCheck("Number");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_num_sensor_value_2).appendField(" ");this.setInputsInline(!0);this.setOutput(!0,"Boolean")}};Entry.block.arduino_get_digital_value=function(b,a){var d=a.getNumberValue("VALUE",a);return Entry.hw.getDigitalPortValue(d)}; Blockly.Blocks.arduino_toggle_led={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_num_pin_1);this.appendValueInput("VALUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_num_pin_2);this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.ARDUINO_on,"on"],[Lang.Blocks.ARDUINO_off,"off"]]),"OPERATOR").appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/hardware_03.png","*")); -this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.arduino_toggle_led=function(b,a){var d=a.getNumberValue("VALUE"),c=a.getField("OPERATOR");Entry.hw.setDigitalPortValue(d,"on"==c?255:0);return a.callReturn()}; +this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.arduino_toggle_led=function(b,a){var d=a.getNumberValue("VALUE"),c="on"==a.getField("OPERATOR")?255:0;Entry.hw.setDigitalPortValue(d,c);return a.callReturn()}; Blockly.Blocks.arduino_toggle_pwm={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_toggle_pwm_1);this.appendValueInput("PORT").setCheck(["Number","String"]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_toggle_pwm_2);this.appendValueInput("VALUE").setCheck(["Number","String"]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_toggle_pwm_3);this.appendDummyInput().appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/hardware_03.png", "*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.arduino_toggle_pwm=function(b,a){var d=a.getNumberValue("PORT"),c=a.getNumberValue("VALUE"),c=Math.round(c),c=Math.max(c,0),c=Math.min(c,255);Entry.hw.setDigitalPortValue(d,c);return a.callReturn()}; Blockly.Blocks.arduino_convert_scale={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_convert_scale_1);this.appendValueInput("VALUE1").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_convert_scale_2);this.appendValueInput("VALUE2").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_convert_scale_3);this.appendValueInput("VALUE3").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_convert_scale_4); @@ -133,7 +133,7 @@ Entry.block.CODEino_get_accelerometer_direction=function(b,a){var d=a.getField(" Blockly.Blocks.CODEino_get_accelerometer_value={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.CODEino_string_8).appendField(new Blockly.FieldDropdown([[Lang.Blocks.CODEino_accelerometer_X,"3"],[Lang.Blocks.CODEino_accelerometer_Y,"4"],[Lang.Blocks.CODEino_accelerometer_Z,"5"]]),"PORT").appendField(Lang.Blocks.CODEino_string_9);this.setOutput(!0,"Number");this.setInputsInline(!0)}}; Entry.block.CODEino_get_accelerometer_value=function(b,a){var d=265,c=402,e=-90,f=90,g=Entry.hw.getAnalogPortValue(a.getField("PORT",a));if(d>c)var h=d,d=c,c=h;e>f&&(h=e,e=f,f=h);g=(f-e)/(c-d)*(g-d);g+=e;g=Math.min(f,g);g=Math.max(e,g);return Math.round(g)}; Blockly.Blocks.dplay_select_led={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_num_pin_1);this.appendDummyInput().appendField(new Blockly.FieldDropdown([["7","7"],["8","8"],["9","9"],["10","10"]]),"PORT");this.appendDummyInput().appendField(Lang.Blocks.dplay_num_pin_1);this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.ARDUINO_on,"on"],[Lang.Blocks.ARDUINO_off,"off"]]),"OPERATOR").appendField(new Blockly.FieldIcon(Entry.mediaFilePath+ -"block_icon/hardware_03.png","*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.dplay_select_led=function(b,a){var d=a.getField("PORT"),c=7;"7"==d?c=7:"8"==d?c=8:"9"==d?c=9:"10"==d&&(c=10);d=a.getField("OPERATOR");Entry.hw.setDigitalPortValue(c,"on"==d?255:0);return a.callReturn()}; +"block_icon/hardware_03.png","*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.dplay_select_led=function(b,a){var d=a.getField("PORT"),c=7;"7"==d?c=7:"8"==d?c=8:"9"==d?c=9:"10"==d&&(c=10);d="on"==a.getField("OPERATOR")?255:0;Entry.hw.setDigitalPortValue(c,d);return a.callReturn()}; Blockly.Blocks.dplay_get_switch_status={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField("\ub514\uc9c0\ud138 ");this.appendDummyInput().appendField(new Blockly.FieldDropdown([["2","2"],["4","4"]]),"PORT");this.appendDummyInput().appendField(Lang.Blocks.dplay_num_pin_2).appendField(new Blockly.FieldDropdown([[Lang.Blocks.dplay_string_5,"ON"],[Lang.Blocks.dplay_string_6,"OFF"]]),"STATUS").appendField(" ");this.setInputsInline(!0);this.setOutput(!0,"Boolean")}}; Entry.block.dplay_get_switch_status=function(b,a){var d=a.getField("PORT"),c=2;"2"==d?c=2:"4"==d&&(c=4);return"OFF"==a.getField("STATUS")?1==Entry.hw.getDigitalPortValue(c)?1:0:0==Entry.hw.getDigitalPortValue(c)?1:0}; Blockly.Blocks.dplay_get_light_status={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.dplay_light).appendField(new Blockly.FieldDropdown([[Lang.Blocks.dplay_string_3,"BRIGHT"],[Lang.Blocks.dplay_string_4,"DARK"]]),"STATUS").appendField(" ");this.setInputsInline(!0);this.setOutput(!0,"Boolean")}}; @@ -292,7 +292,7 @@ Entry.block.ev3_motor_power_on_time=function(b,a){var d=a.getStringField("PORT", setTimeout(function(){a.timeFlag=0;Entry.EV3.removeTimeout(f)},1E3*c);Entry.EV3.timeouts.push(f);return a}; Blockly.Blocks.ev3_motor_degrees={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField("").appendField(new Blockly.FieldDropdown([["A","A"],["B","B"],["C","C"],["D","D"]]),"PORT").appendField("\uc758 \uac12\uc744").appendField(new Blockly.FieldDropdown([["\uc2dc\uacc4\ubc29\ud5a5","CW"],["\ubc18\uc2dc\uacc4\ubc29\ud5a5","CCW"]]),"DIRECTION").appendField("\uc73c\ub85c ");this.appendValueInput("DEGREE").setCheck(["Number"]);this.appendDummyInput().appendField("\ub3c4 \ub9cc\ud07c \ud68c\uc804"); this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.ev3_motor_degrees=function(b,a){var d=a.getStringField("PORT",a),c=a.getValue("DEGREE",a);0>=c?c=0:720<=c&&(c=720);var e=a.getStringField("DIRECTION",a);Entry.hw.sendQueue[d]={id:Math.floor(1E5*Math.random(),0),type:Entry.EV3.motorMovementTypes.Degrees,degree:c,power:"CW"==e?50:-50};return a.callReturn()};Blockly.Blocks.wait_second={init:function(){this.setColour("#498deb");this.appendDummyInput().appendField(Lang.Blocks.FLOW_wait_second_1);this.appendValueInput("SECOND").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.FLOW_wait_second_2).appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/flow_03.png","*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}}; -Entry.block.wait_second=function(b,a){if(a.isStart){if(1==a.timeFlag)return a;delete a.timeFlag;delete a.isStart;Entry.engine.isContinue=!1;return a.callReturn()}a.isStart=!0;a.timeFlag=1;var d=a.getNumberValue("SECOND",a);setTimeout(function(){a.timeFlag=0},60/(Entry.FPS||60)*d*1E3);return a}; +Entry.block.wait_second=function(b,a){if(a.isStart){if(1==a.timeFlag)return a;delete a.timeFlag;delete a.isStart;Entry.engine.isContinue=!1;return a.callReturn()}a.isStart=!0;a.timeFlag=1;var d=a.getNumberValue("SECOND",a),d=60/(Entry.FPS||60)*d*1E3;setTimeout(function(){a.timeFlag=0},d);return a}; Blockly.Blocks.repeat_basic={init:function(){this.setColour("#498deb");this.appendDummyInput().appendField(Lang.Blocks.FLOW_repeat_basic_1);this.appendValueInput("VALUE").setCheck(["Number","String"]);this.appendDummyInput().appendField(Lang.Blocks.FLOW_repeat_basic_2).appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/flow_03.png","*"));this.appendStatementInput("DO");this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}}; Entry.block.repeat_basic=function(b,a){var d;if(!a.isLooped){a.isLooped=!0;d=a.getNumberValue("VALUE",a);if(0>d)throw Error(Lang.Blocks.FLOW_repeat_basic_errorMsg);a.iterCount=Math.floor(d)}if(0==a.iterCount||0>a.iterCount)return delete a.isLooped,delete a.iterCount,a.callReturn();a.iterCount--;return a.getStatement("DO",a)}; Blockly.Blocks.repeat_inf={init:function(){this.setColour("#498deb");this.appendDummyInput().appendField(Lang.Blocks.FLOW_repeat_inf).appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/flow_03.png","*"));this.appendStatementInput("DO");this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.repeat_inf=function(b,a){a.isLooped=!0;return a.getStatement("DO")}; @@ -551,7 +551,7 @@ Entry.block.roduino_get_digital_value=function(b,a){var d=a.getNumberValue("VALU Blockly.Blocks.roduino_get_color={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_color+" ").appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_color_red,"red"],[Lang.Blocks.roborobo_color_green,"green"],[Lang.Blocks.roborobo_color_blue,"blue"],[Lang.Blocks.roborobo_color_yellow,"yellow"]]),"VALUE").appendField(Lang.Blocks.roborobo_color_detected);this.setInputsInline(!0);this.setOutput(!0,"Number")}}; Entry.block.roduino_get_color=function(b,a){var d=0,c=a.getField("VALUE",a),e=[Entry.hw.portData[Entry.Roborobo_Roduino.ColorPin[0]-2],Entry.hw.portData[Entry.Roborobo_Roduino.ColorPin[1]-2],Entry.hw.portData[Entry.Roborobo_Roduino.ColorPin[2]-2]];switch(c){case "red":1==e[0]&&0==e[1]&&0==e[2]&&(d=1);break;case "green":0==e[0]&&1==e[1]&&0==e[2]&&(d=1);break;case "blue":0==e[0]&&0==e[1]&&1==e[2]&&(d=1);break;case "yellow":1==e[0]&&1==e[1]&&1==e[2]&&(d=1)}return d}; Blockly.Blocks.roduino_set_digital={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_pin_1);this.appendValueInput("VALUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_pin_2);this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_on,"on"],[Lang.Blocks.roborobo_off,"off"]]),"OPERATOR").appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/hardware_03.png", -"*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.roduino_set_digital=function(b,a){var d=a.getNumberValue("VALUE"),c=a.getField("OPERATOR");Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_WRITE,d,"on"==c?1:0]);return a.callReturn()}; +"*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.roduino_set_digital=function(b,a){var d=a.getNumberValue("VALUE"),c="on"==a.getField("OPERATOR")?1:0;Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_WRITE,d,c]);return a.callReturn()}; Blockly.Blocks.roduino_motor={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_motor1,"motor1"],[Lang.Blocks.roborobo_motor2,"motor2"]]),"MODE");this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_motor_CW,"cw"],[Lang.Blocks.roborobo_motor_CCW,"ccw"],[Lang.Blocks.roborobo_motor_stop,"stop"]]),"OPERATOR").appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/hardware_03.png","*")); this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.roduino_motor=function(b,a){var d=pin2=0,c=value2=0,d=a.getField("MODE"),c=a.getField("OPERATOR");"motor1"==d?(d=9,pin2=10):(d=11,pin2=12);"cw"==c?(c=1,value2=0):"ccw"==c?(c=0,value2=1):value2=c=0;Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.MOTOR,d,c,pin2,value2]);return a.callReturn()}; Blockly.Blocks.roduino_set_color_pin={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_color+"R : ");this.appendValueInput("RED").setCheck(["Number","String",null]);this.appendDummyInput().appendField(" G : ");this.appendValueInput("GREEN").setCheck(["Number","String",null]);this.appendDummyInput().appendField(" B : ");this.appendValueInput("BLUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(new Blockly.FieldIcon(Entry.mediaFilePath+ @@ -559,13 +559,13 @@ Blockly.Blocks.roduino_set_color_pin={init:function(){this.setColour("#00979D"); Blockly.Blocks.schoolkit_on_block={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_on);this.setOutput(!0,"Number");this.setInputsInline(!0)}};Entry.block.schoolkit_on_block=function(b,a){return"1"};Blockly.Blocks.schoolkit_off_block={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_off);this.setOutput(!0,"Number");this.setInputsInline(!0)}};Entry.block.schoolkit_off_block=function(b,a){return"0"}; Blockly.Blocks.schoolkit_get_out_port_number={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(new Blockly.FieldDropdown([["OUT1","2"],["OUT2","3"],["OUT3","4"],["OUT4","5"],["OUT5","6"]]),"PORT");this.appendDummyInput().appendField(" ");this.setOutput(!0,"Number");this.setInputsInline(!0)}};Entry.block.schoolkit_get_out_port_number=function(b,a){return a.getNumberField("PORT")}; Blockly.Blocks.schoolkit_set_output={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_pin_1);this.appendValueInput("VALUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_pin_2);this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_on,"on"],[Lang.Blocks.roborobo_off,"off"]]),"OPERATOR").appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/hardware_03.png", -"*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.schoolkit_set_output=function(b,a){var d=a.getNumberValue("VALUE"),c=a.getField("OPERATOR");Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_WRITE,d,"on"==c?1:0]);return a.callReturn()}; +"*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.schoolkit_set_output=function(b,a){var d=a.getNumberValue("VALUE"),c="on"==a.getField("OPERATOR")?1:0;Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_WRITE,d,c]);return a.callReturn()}; Blockly.Blocks.schoolkit_get_in_port_number={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(new Blockly.FieldDropdown([["IN1","7"],["IN2","8"],["IN3","9"],["IN4","10"],["IN5","11"],["IN6","12"],["IN7","13"]]),"PORT");this.appendDummyInput().appendField(" ");this.setOutput(!0,"Number");this.setInputsInline(!0)}};Entry.block.schoolkit_get_in_port_number=function(b,a){return a.getNumberField("PORT")}; Blockly.Blocks.schoolkit_get_input_value={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_get_digital_value_1);this.appendValueInput("VALUE").setCheck("Number");this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_sensor_value_2).appendField(" ");this.setInputsInline(!0);this.setOutput(!0,"Boolean")}}; Entry.block.schoolkit_get_input_value=function(b,a){var d=a.getNumberValue("VALUE");Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_READ,d]);return Entry.hw.portData[d-7]}; Blockly.Blocks.schoolkit_motor={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_motor1,"motor1"],[Lang.Blocks.roborobo_motor2,"motor2"]]),"MODE");this.appendValueInput("VALUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_motor_CW,"cw"],[Lang.Blocks.roborobo_motor_CCW,"ccw"],[Lang.Blocks.roborobo_motor_stop,"stop"]]),"OPERATOR").appendField(new Blockly.FieldIcon(Entry.mediaFilePath+ "block_icon/hardware_03.png","*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}}; -Entry.block.schoolkit_motor=function(b,a){var d=0,d=a.getField("MODE"),c=a.getField("OPERATOR"),e=a.getNumberValue("VALUE"),d="motor1"==d?7:8;255e&&(e=0);"cw"==c?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,1,d,e]):"ccw"==c?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,2,d,e]):"stop"==c&&Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,0,d,e]);return a.callReturn()}; +Entry.block.schoolkit_motor=function(b,a){var d=0,c=0,d=a.getField("MODE"),e=a.getField("OPERATOR"),f=a.getNumberValue("VALUE"),d="motor1"==d?7:8;255f&&(f=0);"cw"==e?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,1,d,f]):"ccw"==e?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,2,d,f]):"stop"==e&&Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,c,d,f]);return a.callReturn()}; Blockly.Blocks.schoolkit_set_servo_value={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_pin_1);this.appendValueInput("PIN").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_pin_2);this.appendDummyInput().appendField(" : ");this.appendValueInput("VALUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.roborobo_degree);this.appendDummyInput().appendField(new Blockly.FieldIcon(Entry.mediaFilePath+ "block_icon/hardware_03.png","*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.schoolkit_set_servo_value=function(b,a){var d=a.getNumberValue("PIN"),c=a.getNumberValue("VALUE");0>c?c=0:180=d)return this.setRobotisData(a),this.update(),b.callReturn();if(b.isStart){if(1==b.timeFlag)return this.setRobotisData(null),b;delete b.timeFlag;delete b.isStart;Entry.engine.isContinue=!1;this.update();return b.callReturn()}b.isStart=!0;b.timeFlag=1;this.setRobotisData(a);setTimeout(function(){b.timeFlag= @@ -774,10 +774,9 @@ Entry.Container.prototype.selectPicture=function(b,a){var d=this.getObject(a),c= Entry.Container.prototype.addObject=function(b,a){var d=new Entry.EntryObject(b);d.name=Entry.getOrderedName(d.name,this.objects_);Entry.stateManager&&Entry.stateManager.addCommand("add object",this,this.removeObject,d);d.scene||(d.scene=Entry.scene.selectedScene);"number"==typeof a?b.sprite.category&&"background"==b.sprite.category.main?(d.setLock(!0),this.objects_.push(d)):this.objects_.splice(a,0,d):b.sprite.category&&"background"==b.sprite.category.main?this.objects_.push(d):this.objects_.unshift(d); d.generateView();d.pictures.map(function(a){Entry.playground.generatePictureElement(a)});d.sounds.map(function(a){Entry.playground.generateSoundElement(a)});this.setCurrentObjects();this.updateObjectsOrder();this.updateListView();this.selectObject(d.id);Entry.variableContainer.updateViews();return new Entry.State(this,this.removeObject,d)}; Entry.Container.prototype.addCloneObject=function(b,a){var d=b.toJSON(),c=Entry.generateHash();Entry.variableContainer.addCloneLocalVariables({objectId:d.id,newObjectId:c,json:d});d.id=c;d.scene=a||Entry.scene.selectedScene;this.addObject(d)}; -Entry.Container.prototype.removeObject=function(b){var a=this.objects_.indexOf(b),d=b.toJSON();Entry.stateManager&&Entry.stateManager.addCommand("remove object",this,this.addObject,d,a);d=new Entry.State(this.addObject,d,a);b.destroy();this.objects_.splice(a,1);this.setCurrentObjects();Entry.stage.sortZorder();this.objects_.length&&0!==a?0":b="BIGGER";break;case ">=":b="BIGGER_EQUAL";break;case "==":b="EQUAL";break;case "<":b="SMALLER"; -break;case "<=":b="SMALLER_EQUAL"}return b};b.radarVariableConvertor=function(a){return a.split("_")[1].toUpperCase()};b.tTobDropdownValueConvertor=function(a){return"stone"==a?"OBSTACLE":"wall"==a?a.toUpperCase():"item"==a?a.toUpperCase():a}})(Entry.TextCodingUtil.prototype);Entry.BlockToJsParser=function(b){this.syntax=b;this._iterVariableCount=0;this._iterVariableChunk=["i","j","k"]}; +function(a){if("entry_event_start"==a||"entry_event_key"==a||"entry_event_mouse_down"==a||"entry_event_mouse_up"==a||"entry_event_object_down"==a||"entry_event_signal"==a||"entry_event_scene_start"==a||"entry_event_clone_create"==a)a="def "+a;return a};b.isEntryEventFunc=function(a){return"def entry_event_start"==a||"def entry_event_key"==a||"def entry_event_mouse_down"==a||"def entry_event_mouse_up"==a||"def entry_event_object_down"==a||"def entry_event_signal"==a||"def entry_event_scene_start"== +a||"def entry_event_clone_create"==a?!0:!1};b.searchFuncDefParam=function(a){"function_field_label"==a.data.type&&this._funcNameQ.enqueue(a.data.params[0]);return a&&a.data&&a.data.params&&a.data.params[1]?("function_field_string"!=a.data.type&&"function_field_boolean"!=a.data.type||this._funcParamQ.enqueue(a.data.params[0].data.type),this.searchFuncDefParam(a.data.params[1])):a};b.gatherFuncDefParam=function(a){if(a&&a.data){if(a.data.params[0])if(a.data.params[0].data){var b=a.data.params[0].data.type; +"function_field_string"!=a.data.type&&"function_field_boolean"!=a.data.type||this._funcParamQ.enqueue(b)}else"function_field_label"==a.data.type&&this._funcNameQ.enqueue(a.data.params[0]);if(a.data.params[1]){var c=this.searchFuncDefParam(a.data.params[1]);c.data.params[0].data&&(b=c.data.params[0].data.type,"function_field_string"!=c.data.type&&"function_field_boolean"!=c.data.type||this._funcParamQ.enqueue(b));c.data.params[1]&&c.data.params[1].data.params[0].data&&(b=c.data.params[1].data.params[0].data.type, +"function_field_string"!=c.data.params[1].data.type&&"function_field_boolean"!=c.data.params[1].data.type||this._funcParamQ.enqueue(b))}}return c};b.getLastParam=function(a){a&&a.data&&a.data.params[1]&&(a=this.getLastParam(a.data.params[1]));return a};b.isFuncContentsMatch=function(a,b,c){for(var e=!0,f=0;f":b="BIGGER";break;case ">=":b="BIGGER_EQUAL";break;case "==":b="EQUAL";break;case "<":b= +"SMALLER";break;case "<=":b="SMALLER_EQUAL"}return b};b.radarVariableConvertor=function(a){return a.split("_")[1].toUpperCase()};b.tTobDropdownValueConvertor=function(a){return"stone"==a?"OBSTACLE":"wall"==a?a.toUpperCase():"item"==a?a.toUpperCase():a}})(Entry.TextCodingUtil.prototype);Entry.BlockToJsParser=function(b){this.syntax=b;this._iterVariableCount=0;this._iterVariableChunk=["i","j","k"]}; (function(b){b.Code=function(a,b){this._parseMode=b;if(a instanceof Entry.Block)return this.Block(a);for(var c="",e=a._data,f=0;fe)var h=c,c=e,e=h;f>g&&(h=f,f=g,g=h);d-=c;d*=(g-f)/(e-c);d+=f;d=Math.min(g,d);d=Math.max(f,d);return Math.round(d)},syntax:{js:[],py:["Arduino.convert_scale(%1, %2, %3, %4, %5)"]}},arduino_ext_get_analog_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["A0","0"],["A1","1"],["A2","2"],["A3","3"],["A4", @@ -1800,549 +1799,549 @@ e===f.stamp||64g[d-14]?1:0 "LEFT"],[Lang.Blocks.CODEino_string_17,"RIGHT"],[Lang.Blocks.CODEino_string_18,"FRONT"],[Lang.Blocks.CODEino_string_19,"REAR"],[Lang.Blocks.CODEino_string_20,"REVERSE"]],value:"LEFT",fontSize:11}],events:{},def:{params:[null],type:"CODEino_get_accelerometer_direction"},paramsKeyMap:{DIRECTION:0},"class":"CODEino_sensor",isNotFor:["CODEino"],func:function(b,a){var d=a.getField("DIRECTION",a),c=0,e=Entry.ArduinoExt.getSensorTime(Entry.ArduinoExt.sensorTypes.ANALOG),f=Entry.hw.portData.TIME||0,g=a.executor.scope, h=Entry.hw.portData.ANALOG;"LEFT"==d||"RIGHT"==d?c=3:"FRONT"==d||"REAR"==d?c=4:"REVERSE"==d&&(c=5);if(g.isStart)if(f&&f===g.stamp){delete g.isStart;delete g.stamp;c=h[c];c=180/137*(c-265);c+=-90;c=Math.min(90,c);c=Math.max(-90,c);c=Math.round(c);if("LEFT"==d||"REAR"==d)return-30>c?1:0;if("RIGHT"==d||"FRONT"==d)return 30c?1:0}else if(64c?1:0;if("RIGHT"==d||"FRONT"==d)return 30c?1:0}else throw new Entry.Utils.AsyncError;else throw g.isStart=!0,g.stamp=e,Entry.hw.sendQueue.TIME=e,Entry.hw.sendQueue.KEY=Entry.ArduinoExt.getSensorKey(),Entry.hw.sendQueue.GET={type:Entry.ArduinoExt.sensorTypes.ANALOG,port:c},new Entry.Utils.AsyncError;}},CODEino_get_accelerometer_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["X", -"3"],["Y","4"],["Z","5"]],value:"3",fontSize:11}],events:{},def:{params:[null],type:"CODEino_get_accelerometer_value"},paramsKeyMap:{PORT:0},"class":"CODEino_sensor",isNotFor:["CODEino"],func:function(b,a){var d=a.getNumberField("PORT",a),c=Entry.ArduinoExt.getSensorTime(Entry.ArduinoExt.sensorTypes.ANALOG),e=Entry.hw.portData.TIME||0,f=a.executor.scope,g=Entry.hw.portData.ANALOG,h=0;if(f.isStart){if(e&&e===f.stamp||64e)var h=c,c=e,e=h;f>g&&(h=f,f=g,g=h);d-=c;d*=(g-f)/(e-c);d+=f;d=Math.min(g,d);d=Math.max(f,d);return Math.round(d)}},CODEino_set_rgb_value:{color:"#00979D", -skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[["\ube68\uac15","17"],["\ucd08\ub85d","18"],["\ud30c\ub791","19"]],value:"17",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{type:"CODEino_set_rgb_value"},paramsKeyMap:{PORT:0,VALUE:1},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getNumberField("PORT",a),e=a.getNumberValue("VALUE",a),e=Math.min(255,e),e=Math.max(0, -e);17==c?CODEINO_RED=e:18==c?CODEINO_GREEN=e:CODEINO_BLUE=e;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:e};return a.callReturn()}},CODEino_set_rgb_add_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[["\ube68\uac15","17"],["\ucd08\ub85d","18"],["\ud30c\ub791","19"]],value:"17",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{}, -def:{type:"CODEino_set_rgb_add_value"},paramsKeyMap:{PORT:0,VALUE:1},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getNumberField("PORT",a),e=a.getNumberValue("VALUE",a),e=Math.min(255,e),e=Math.max(0,e);17==c&&(CODEINO_RED+=e,CODEINO_RED=Math.min(255,CODEINO_RED),e=CODEINO_RED=Math.max(0,CODEINO_RED));18==c&&(CODEINO_GREEN+=e,CODEINO_GREEN=Math.min(255,CODEINO_GREEN),e=CODEINO_GREEN=Math.max(0,CODEINO_GREEN));19==c&&(CODEINO_BLUE+=e,CODEINO_BLUE= -Math.min(255,CODEINO_BLUE),e=CODEINO_BLUE=Math.max(0,CODEINO_BLUE));d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:e};return a.callReturn()}},CODEino_rgb_set_color:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Color"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"CODEino_rgb_set_color"},paramsKeyMap:{VALUE:0},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b, -a){var d=a.getStringField("VALUE");CODEINO_RED=parseInt(d.substr(1,2),16);CODEINO_GREEN=parseInt(d.substr(3,2),16);CODEINO_BLUE=parseInt(d.substr(5,2),16);var d=Entry.hw.sendQueue,c=17;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_RED};d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_GREEN};d=Entry.hw.sendQueue;c=19; -d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_BLUE};return a.callReturn()}},CODEino_set_rgb_off:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"CODEino_set_rgb_off"},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue;CODEINO_GREEN=CODEINO_BLUE=CODEINO_RED=0;var c=17;d.TIME= -Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:0};d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:0};d=Entry.hw.sendQueue;c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:0};return a.callReturn()}},CODEino_set__led_by_rgb:{color:"#00979D",skeleton:"basic",statements:[], -params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["255"]},{type:"text",params:["255"]},{type:"text",params:["255"]},null],type:"CODEino_set__led_by_rgb"},paramsKeyMap:{rValue:0,gValue:1,bValue:2},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){CODEINO_RED=a.getNumberValue("rValue");CODEINO_GREEN=a.getNumberValue("gValue"); -CODEINO_BLUE=a.getNumberValue("bValue");var d=Entry.hw.sendQueue,c=17;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_RED};d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_GREEN};d=Entry.hw.sendQueue;c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4, -data:CODEINO_BLUE};return a.callReturn()}},CODEino_led_by_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"CODEino_led_by_value"},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue,c=17;CODEINO_BLUE=CODEINO_GREEN=CODEINO_RED=100;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:100}; -d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:100};d=Entry.hw.sendQueue;c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:100};return a.callReturn()}},CODEino_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["CODEino"],def:{params:[{type:"arduino_get_sensor_number"}],type:"CODEino_get_number_sensor_value"}, -"class":"arduino_value",syntax:{js:[],py:["hw.CODEino_get_number_sensor_value(%1)"]}},CODEino_toggle_led:{parent:"arduino_toggle_led",isNotFor:["CODEino"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"CODEino_toggle_led"},"class":"arduino_set",syntax:{js:[],py:["hw.CODEino_toggle_led(%1)"]}},CODEino_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["CODEino"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"CODEino_toggle_pwm"},"class":"arduino_set", -syntax:{js:[],py:["hw.CODEino_toggle_pwm(%1, %2)"]}},nemoino_get_named_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],template:"%1 \uc13c\uc11c\uac12",params:[{type:"Dropdown",options:[["\uc18c\ub9ac","0"],["\ube5b","1"],["\uc2ac\ub77c\uc774\ub354","2"],["\uc800\ud56d-A","3"],["\uc800\ud56d-B","4"],["\uc800\ud56d-C","5"],["\uc800\ud56d-D","6"]],value:"0",fontSize:11}],events:{},def:{params:[null],type:"nemoino_get_named_sensor_value"},paramsKeyMap:{PORT:0}, -"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){return Entry.hw.getAnalogPortValue(a.getField("PORT",a))}},nemoino_get_sound_status:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",statements:[],template:"\uc18c\ub9ac\uc13c\uc11c %1",params:[{type:"Dropdown",options:[["\uc18c\ub9ac\ud07c","GREAT"],["\uc18c\ub9ac\uc791\uc74c","SMALL"]],value:"GREAT",fontSize:11}],events:{},def:{params:[null],type:"nemoino_get_sound_status"},paramsKeyMap:{STATUS:0},"class":"nemoino",isNotFor:["nemoino"], -func:function(b,a){return"GREAT"==a.getField("STATUS",a)?600Entry.hw.getAnalogPortValue(0)?1:0}},nemoino_is_button_pressed:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",statements:[],template:"\ubcf4\ub4dc\uc758 %1",params:[{type:"Dropdown",options:[["\ubc84\ud2bc\ub204\ub984","4"],["A\uc5f0\uacb0\ub428","17"],["B\uc5f0\uacb0\ub428","18"],["C\uc5f0\uacb0\ub428","19"],["D\uc5f0\uacb0\ub428","20"]],value:"4",fontSize:11}],events:{},def:{params:[null], -type:"nemoino_is_button_pressed"},paramsKeyMap:{PORT:0},"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){var d=a.getNumberField("PORT",a);return 14c?1:0;if("RIGHT"==d||"FRONT"==d)return 30c?1:0}},nemoino_get_accelerometer_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],template:"3\ucd95 \uac00\uc18d\ub3c4\uc13c\uc11c %1 \ucd95\uc758 \uc13c\uc11c\uac12",params:[{type:"Dropdown",options:[["X","3"],["Y","4"],["Z","5"]],value:"3",fontSize:11}],events:{},def:{params:[null],type:"nemoino_get_accelerometer_value"}, -paramsKeyMap:{PORT:0},"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){var d=265,c=402,e=-90,f=90,g=Entry.hw.getAnalogPortValue(a.getField("PORT",a));if(d>c)var h=d,d=c,c=h;e>f&&(h=e,e=f,f=h);g=(f-e)/(c-d)*(g-d);g+=e;g=Math.min(f,g);g=Math.max(e,g);return Math.round(g)}},bitbrick_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW,menuName:Entry.Bitbrick.sensorList}], -events:{},def:{params:[null],type:"bitbrick_sensor_value"},paramsKeyMap:{PORT:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getStringField("PORT");return Entry.hw.portData[d].value},syntax:{js:[],py:["Bitbrick.sensor_value(%1)"]}},bitbrick_is_touch_pressed:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.touchList}],events:{},def:{params:[null],type:"bitbrick_is_touch_pressed"}, -paramsKeyMap:{PORT:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){return 0===Entry.hw.portData[a.getStringField("PORT")].value},syntax:{js:[],py:["Bitbrick.is_touch_pressed(%1)"]}},bitbrick_turn_off_color_led:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"bitbrick_turn_off_color_led",id:"i3je"},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){Entry.hw.sendQueue.LEDR= -0;Entry.hw.sendQueue.LEDG=0;Entry.hw.sendQueue.LEDB=0;return a.callReturn()},syntax:{js:[],py:["Bitbrick.turn_off_color_led()"]}},bitbrick_turn_on_color_led_by_rgb:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["255"]},{type:"text",params:["255"]},{type:"text",params:["255"]},null],type:"bitbrick_turn_on_color_led_by_rgb"}, -paramsKeyMap:{rValue:0,gValue:1,bValue:2},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getNumberValue("rValue"),c=a.getNumberValue("gValue"),e=a.getNumberValue("bValue"),f=Entry.adjustValueWithMaxMin,g=Entry.hw.sendQueue;g.LEDR=f(d,0,255);g.LEDG=f(c,0,255);g.LEDB=f(e,0,255);return a.callReturn()},syntax:{js:[],py:["Bitbrick.color_led_by_rgb(%1, %2, %3)"]}},bitbrick_turn_on_color_led_by_picker:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Color"},{type:"Indicator", -img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"bitbrick_turn_on_color_led_by_picker"},paramsKeyMap:{VALUE:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getStringField("VALUE");Entry.hw.sendQueue.LEDR=parseInt(d.substr(1,2),16);Entry.hw.sendQueue.LEDG=parseInt(d.substr(3,2),16);Entry.hw.sendQueue.LEDB=parseInt(d.substr(5,2),16);return a.callReturn()},syntax:{js:[],py:["Bitbrick.color_led_by_picker(%1)"]}},bitbrick_turn_on_color_led_by_value:{color:"#00979D", -skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["0"]},null],type:"bitbrick_turn_on_color_led_by_value"},paramsKeyMap:{VALUE:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getNumberValue("VALUE"),c,e,f,d=d%200;67>d?(c=200-3*d,e=3*d,f=0):134>d?(d-=67,c=0,e=200-3*d,f=3*d):201>d&&(d-=134,c=3*d,e=0,f=200-3*d);Entry.hw.sendQueue.LEDR=c;Entry.hw.sendQueue.LEDG= -e;Entry.hw.sendQueue.LEDB=f;return a.callReturn()},syntax:{js:[],py:["Bitbrick.color_led_by_value(%1)"]}},bitbrick_buzzer:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["60"]},null],type:"bitbrick_buzzer"},paramsKeyMap:{VALUE:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){if(a.isStart)return Entry.hw.sendQueue.buzzer=0,delete a.isStart,a.callReturn(); -var d=a.getNumberValue("VALUE");Entry.hw.sendQueue.buzzer=d;a.isStart=!0;return a},syntax:{js:[],py:["Bitbrick.buzzer(%1)"]}},bitbrick_turn_off_all_motors:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"bitbrick_turn_off_all_motors"},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=Entry.hw.sendQueue,c=Entry.Bitbrick;c.servoList().map(function(a){d[a[1]]=0});c.dcList().map(function(a){d[a[1]]= -128});return a.callReturn()},syntax:{js:[],py:["Bitbrick.turn_off_all_motors()"]}},bitbrick_dc_speed:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.dcList},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text",params:["60"]},null],type:"bitbrick_dc_speed"},paramsKeyMap:{PORT:0,VALUE:1},"class":"condition",isNotFor:["bitbrick"],func:function(b, -a){var d=a.getNumberValue("VALUE"),d=Math.min(d,Entry.Bitbrick.dcMaxValue),d=Math.max(d,Entry.Bitbrick.dcMinValue);Entry.hw.sendQueue[a.getStringField("PORT")]=d+128;return a.callReturn()},syntax:{js:[],py:["Bitbrick.dc_speed(%1, %2)"]}},bitbrick_dc_direction_speed:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.dcList},{type:"Dropdown",options:[[Lang.Blocks.BITBRICK_dc_direction_cw,"CW"],[Lang.Blocks.BITBRICK_dc_direction_ccw, -"CCW"]],value:"CW",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,{type:"text",params:["100"]},null],type:"bitbrick_dc_direction_speed"},paramsKeyMap:{PORT:0,DIRECTION:1,VALUE:2},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d="CW"===a.getStringField("DIRECTION"),c=a.getNumberValue("VALUE"),c=Math.min(c,Entry.Bitbrick.dcMaxValue),c=Math.max(c,0);Entry.hw.sendQueue[a.getStringField("PORT")]= -d?c+128:128-c;return a.callReturn()},syntax:{js:[],py:["Bitbrick.dc_direction_speed(%1, %2, %3)"]}},bitbrick_servomotor_angle:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.servoList},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text",params:["100"]},null],type:"bitbrick_servomotor_angle"},paramsKeyMap:{PORT:0,VALUE:1},"class":"condition", -isNotFor:["bitbrick"],func:function(b,a){var d=Entry.Bitbrick.servoMaxValue-(a.getNumberValue("VALUE")+1),d=Math.min(d,Entry.Bitbrick.servoMaxValue),d=Math.max(d,Entry.Bitbrick.servoMinValue);Entry.hw.sendQueue[a.getStringField("PORT")]=d;return a.callReturn()},syntax:{js:[],py:["Bitbrick.servomotor_angle(%1, %2)"]}},bitbrick_convert_scale:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.sensorList}, -{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"}],events:{},def:{params:[null,{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["-100"]},{type:"number",params:["100"]}],type:"bitbrick_convert_scale"},paramsKeyMap:{PORT:0,VALUE2:1,VALUE3:2,VALUE4:3,VALUE5:4},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getNumberField("PORT"),c=Entry.hw.portData[d].value,d=a.getNumberValue("VALUE2", -a),e=a.getNumberValue("VALUE3",a),f=a.getNumberValue("VALUE4",a),g=a.getNumberValue("VALUE5",a);if(f>g)var h=f,f=g,g=h;c-=d;c*=(g-f)/(e-d);c+=f;c=Math.min(g,c);c=Math.max(f,c);return Math.round(c)},syntax:{js:[],py:["Bitbrick.convert_scale(%1, %2, %3, %4, %5)"]}},cobl_read_ultrason:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"1. \ucd08\uc74c\ud30c\uac70\ub9ac(0~400)",def:{type:"cobl_read_ultrason"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("ultrason")}}, -cobl_read_potenmeter:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"2.\uac00\ubcc0\uc800\ud56d(0~1023)",def:{type:"cobl_read_potenmeter"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("potenmeter")}},cobl_read_irread1:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"3.\uc801\uc678\uc120\uc13c\uc11c1(0~1023)",def:{type:"cobl_read_irread1"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("irread1")}}, -cobl_read_irread2:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"4.\uc801\uc678\uc120\uc13c\uc11c2(0~1023)",def:{type:"cobl_read_irread2"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("irread2")}},cobl_read_joyx:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"5.\uc870\uc774\uc2a4\ud2f1X\ucd95(1, 0, -1)",def:{type:"cobl_read_joyx"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("joyx")}}, -cobl_read_joyy:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"6.\uc870\uc774\uc2a4\ud2f1Y\ucd95(1, 0, -1)",def:{type:"cobl_read_joyy"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("joyy")}},cobl_read_tilt:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"7.\uae30\uc6b8\uae30\uc13c\uc11c(0~4)",def:{type:"cobl_read_tilt"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("tilt")}}, -cobl_read_temps:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"8.\uc628\ub3c4\uc13c\uc11c@\ud3ec\ud2b8%1",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11}],def:{params:["1"],type:"cobl_read_temps"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getValue("VALUE",a);if(1==d)return Entry.hw.getAnalogPortValue("temps1");if(2==d)return Entry.hw.getAnalogPortValue("temps2")}},cobl_read_light:{color:"#00979D",fontColor:"#fff", -skeleton:"basic_string_field",template:"9.\ube5b\uc13c\uc11c@\ud3ec\ud2b8%1",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11}],def:{params:["1"],type:"cobl_read_light"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getValue("VALUE",a);if(1==d)return Entry.hw.getAnalogPortValue("light1");if(2==d)return Entry.hw.getAnalogPortValue("light2")}},cobl_read_btn:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",template:"10.\ubc84\ud2bc\uc2a4\uc704\uce58@\ud3ec\ud2b8%1", -params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11}],def:{params:["1"],type:"cobl_read_btn"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getValue("VALUE",a);if(1==d)return Entry.hw.getDigitalPortValue("btn1");if(2==d)return Entry.hw.getDigitalPortValue("btn2")}},cobl_led_control:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"11.\ubb34\uc9c0\uac1cLED%1%2 %3",params:[{type:"Dropdown",options:[["1","1"],["2","2"],["3","3"]],fontSize:11}, -{type:"Dropdown",options:[["OFF","OFF"],["\ube68\uac15","Red"],["\uc8fc\ud669","Orange"],["\ub178\ub791","Yellow"],["\ucd08\ub85d","Green"],["\ud30c\ub791","Blue"],["\ub0a8\uc0c9","Dark Blue"],["\ubcf4\ub77c","Purple"],["\ud770\uc0c9","White"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","OFF"],type:"cobl_led_control"},paramsKeyMap:{PORT:0,OPERATOR:1},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("PORT"),c=a.getStringField("OPERATOR"); -Entry.hw.setDigitalPortValue("RainBowLED_"+d,c);Entry.hw.update();delete Entry.hw.sendQueue["RainBowLED_"+d];return a.callReturn()}},cobl_servo_angle_control:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"12.\uac01\ub3c4\ubaa8\ud130 \uac01\ub3c4%1(15~165) %2",params:[{type:"TextInput",value:0},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{type:"cobl_servo_angle_control"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getNumberField("VALUE"), -d=Math.round(d),d=Math.max(d,15),d=Math.min(d,165);Entry.hw.setDigitalPortValue("Servo1",d);Entry.hw.update();delete Entry.hw.sendQueue.Servo1;return a.callReturn()}},cobl_melody:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"13.\uba5c\ub85c\ub514%1 ,%2",params:[{type:"Dropdown",options:[["((\ub0ae\uc740)\uc194","L_So"],["(\ub0ae\uc740)\uc194#","L_So#"],["(\ub0ae\uc740)\ub77c","L_La"],["(\ub0ae\uc740)\ub77c#","L_La#"],["(\ub0ae\uc740)\uc2dc","L_Ti"],["\ub3c4","Do"],["\ub3c4#","Do#"], -["\ub808","Re"],["\ub808#","Re#"],["\ubbf8","Mi"],["\ud30c","Fa"],["\ud30c#","Fa#"],["\uc194","So"],["\uc194#","So#"],["\ub77c","La"],["\ub77c#","La#"],["\uc2dc","Ti"],["(\ub192\uc740)\ub3c4","H_Do"],["(\ub192\uc740)\ub3c4#","H_Do#"],["(\ub192\uc740)\ub808","H_Re"],["(\ub192\uc740)\ub808#","H_Re#"],["(\ub192\uc740)\ubbf8#","H_Mi"],["(\ub192\uc740)\ud30c","H_Fa"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["Do"],type:"cobl_melody"},paramsKeyMap:{MELODY:0}, -class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("MELODY");Entry.hw.setDigitalPortValue("Melody",d);Entry.hw.update();delete Entry.hw.sendQueue.Melody;return a.callReturn()}},cobl_dcmotor:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"14.\ud68c\uc804\ubaa8\ud130%1%2\uc18d\ub3c4%3 %4",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11},{type:"Dropdown",options:[["1.\uc2dc\uacc4\ubc29\ud5a5","1"],["2.\ubc18\uc2dc\uacc4\ubc29\ud5a5","2"],["3.\uc815\uc9c0", -"3"]],fontSize:11},{type:"Dropdown",options:[["1","1"],["2","2"],["3","3"],["4","4"],["5","5"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","1","1"],type:"cobl_dcmotor"},paramsKeyMap:{MOTOR:0,DIRECTION:1,SPEED:2},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("MOTOR"),c=a.getStringField("DIRECTION"),e=a.getStringField("SPEED");1==d&&(Entry.hw.setDigitalPortValue("DC1_DIR",c),Entry.hw.setDigitalPortValue("DC1_SPEED",e),Entry.hw.update(), -delete Entry.hw.sendQueue.DC1_DIR,delete Entry.hw.sendQueue.DC1_SPEED);2==d&&(Entry.hw.setDigitalPortValue("DC2_DIR",c),Entry.hw.setDigitalPortValue("DC2_SPEED",e),Entry.hw.update(),delete Entry.hw.sendQueue.DC2_DIR,delete Entry.hw.sendQueue.DC2_SPEED);return a.callReturn()}},cobl_extention_port:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"15.USB\ud3ec\ud2b8%1\ub2e8\uacc4%2 %3",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11},{type:"Dropdown",options:[["0","0"], -["1","1"],["2","2"],["3","3"],["4","4"],["5","5"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","0"],type:"cobl_extention_port"},paramsKeyMap:{PORT:0,LEVEL:1},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("PORT"),c=a.getStringField("LEVEL");1==d&&(Entry.hw.setDigitalPortValue("EXUSB1",c),Entry.hw.update(),delete Entry.hw.sendQueue.EXUSB1);2==d&&(Entry.hw.setDigitalPortValue("EXUSB2",c),Entry.hw.update(),delete Entry.hw.sendQueue.EXUSB2); -return a.callReturn()}},cobl_external_led:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"16.\uc678\ubd80LED%1(1~64)R%2G%3B%4 %5",params:[{type:"TextInput",value:0,fontSize:11},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]],fontSize:11},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]],fontSize:11},{type:"Dropdown", -options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","1","1","1"],type:"cobl_external_led"},paramsKeyMap:{LED:0,RED:1,GREEN:2,BLUE:3},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getNumberField("LED"),c=a.getStringField("RED"),e=a.getStringField("GREEN"),f=a.getStringField("BLUE");Entry.hw.setDigitalPortValue("ELED_IDX",d);Entry.hw.setDigitalPortValue("ELED_R", -c);Entry.hw.setDigitalPortValue("ELED_G",e);Entry.hw.setDigitalPortValue("ELED_B",f);Entry.hw.update();delete Entry.hw.sendQueue.ELED_IDX;delete Entry.hw.sendQueue.ELED_R;delete Entry.hw.sendQueue.ELED_G;delete Entry.hw.sendQueue.ELED_B;return a.callReturn()}},cobl_7_segment:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"17.\uc22b\uc790\uc804\uad11\ud310%1(0~9999) %2",params:[{type:"TextInput",value:0},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{type:"cobl_7_segment"}, -paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getNumberField("VALUE");Entry.hw.setDigitalPortValue("7SEG",d);Entry.hw.update();delete Entry.hw.sendQueue["7SEG"];return a.callReturn()}},start_drawing:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"start_drawing"},"class":"brush_control",isNotFor:["textBox"],func:function(b,a){b.brush?b.brush.stop=!1:Entry.setBasicBrush(b); -Entry.stage.sortZorder();b.brush.moveTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.start_drawing()"]}},stop_drawing:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"stop_drawing"},"class":"brush_control",isNotFor:["textBox"],func:function(b,a){b.brush&&b.shape&&(b.brush.stop=!0);return a.callReturn()},syntax:{js:[],py:["Entry.stop_drawing()"]}},set_color:{color:"#FF9E20", -skeleton:"basic",statements:[],params:[{type:"Color"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"set_color"},paramsKeyMap:{VALUE:0},"class":"brush_color",isNotFor:["textBox"],func:function(b,a){var d=a.getField("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(d=Entry.hex2rgb(d),b.brush.rgb=d,b.brush.endStroke(),b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()}, -syntax:{js:[],py:["Entry.set_brush_color(%1)"]}},set_random_color:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"set_random_color"},"class":"brush_color",isNotFor:["textBox"],func:function(b,a){b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);if(b.brush){var d=Entry.generateRgb();b.brush.rgb=d;b.brush.endStroke();b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")");b.brush.moveTo(b.getX(), --1*b.getY())}return a.callReturn()},syntax:{js:[],py:["Entry.set_brush_color_random()"]}},change_thickness:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["1"]},null],type:"change_thickness"},paramsKeyMap:{VALUE:0},"class":"brush_thickness",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop= -!0);b.brush&&(b.brush.thickness+=d,1>b.brush.thickness&&(b.brush.thickness=1),b.brush.setStrokeStyle(b.brush.thickness),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.add_brush_size(%1)"]}},set_thickness:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["1"]},null],type:"set_thickness"},paramsKeyMap:{VALUE:0},"class":"brush_thickness", -isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(b.brush.thickness=d,b.brush.setStrokeStyle(b.brush.thickness),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.set_brush_size(%1)"]}},change_opacity:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number", -params:["10"]},null],type:"change_opacity"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);d=Entry.adjustValueWithMaxMin(b.brush.opacity+d,0,100);b.brush&&(b.brush.opacity=d,b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:[""]}},set_opacity:{color:"#FF9E20", -skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["50"]},null],type:"set_opacity"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(b.brush.opacity=Entry.adjustValueWithMaxMin(d,0,100),b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+ -d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:[""]}},brush_erase_all:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"brush_erase_all"},"class":"brush_clear",isNotFor:["textBox"],func:function(b,a){var d=b.brush;if(d){var c=d._stroke.style,e=d._strokeStyle.width;d.clear().setStrokeStyle(e).beginStroke(c);d.moveTo(b.getX(), --1*b.getY())}d=b.parent.getStampEntities();d.map(function(a){a.removeClone()});d=null;return a.callReturn()},syntax:{js:[],py:["Entry.clear_drawing()"]}},brush_stamp:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"brush_stamp"},"class":"stamp",isNotFor:["textBox"],func:function(b,a){b.parent.addStampEntity(b);return a.callReturn()},syntax:{js:[],py:["Entry.stamp()"]}},change_brush_transparency:{color:"#FF9E20", -skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"change_brush_transparency"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);d=Entry.adjustValueWithMaxMin(b.brush.opacity-d,0,100);b.brush&&(b.brush.opacity=d,b.brush.endStroke(),d=b.brush.rgb, -b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.add_brush_transparency(%1)"]}},set_brush_tranparency:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["50"]},null],type:"set_brush_tranparency"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"], -func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(b.brush.opacity=Entry.adjustValueWithMaxMin(d,0,100),b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+(1-b.brush.opacity/100)+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.set_brush_transparency(%1)"]}},number:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"TextInput",value:10}], -events:{},def:{params:[]},paramsKeyMap:{NUM:0},func:function(b,a){return a.getField("NUM",a)},isPrimitive:!0,syntax:{js:["Scope","%1"],py:["%1number#"]}},angle:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Angle"}],events:{},def:{params:[null],type:"angle"},paramsKeyMap:{ANGLE:0},func:function(b,a){return a.getNumberField("ANGLE")},syntax:{js:[],py:["%1angle#"]}},get_x_coordinate:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_x_coordinate, -color:"#3D3D3D"}],events:{},def:{params:[null],type:"get_x_coordinate"},"class":"calc",isNotFor:[],func:function(b,a){return b.getX()},syntax:{js:[],py:[""]}},get_y_coordinate:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_y_coordinate,color:"#3D3D3D"}],events:{},def:{params:[null],type:"get_y_coordinate"},"class":"calc",isNotFor:[],func:function(b,a){return b.getY()},syntax:{js:[],py:[""]}},get_angle:{color:"#FFD974",skeleton:"basic_string_field", -statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_angle,color:"#3D3D3D"}],events:{},def:{params:[null]},func:function(b,a){return parseFloat(b.getRotation().toFixed(1))},syntax:{js:[],py:[""]}},get_rotation_direction:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.CALC_rotation_value,"ROTATION"],[Lang.Blocks.CALC_direction_value,"DIRECTION"]],value:"ROTATION",fontSize:11}],events:{},def:{params:[null],type:"get_rotation_direction"}, -paramsKeyMap:{OPERATOR:0},"class":"calc",isNotFor:[],func:function(b,a){return"DIRECTION"==a.getField("OPERATOR",a).toUpperCase()?parseFloat(b.getDirection().toFixed(1)):parseFloat(b.getRotation().toFixed(1))},syntax:{js:[],py:[""]}},distance_something:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_distance_something_1,color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC}, -{type:"Text",text:Lang.Blocks.CALC_distance_something_2,color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"distance_something"},paramsKeyMap:{VALUE:1},"class":"calc_distance",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a);if("mouse"==d)return d=Entry.stage.mouseCoordinate,Math.sqrt(Math.pow(b.getX()-d.x,2)+Math.pow(b.getY()-d.y,2));d=Entry.container.getEntity(d);return Math.sqrt(Math.pow(b.getX()-d.getX(),2)+Math.pow(b.getY()-d.getY(),2))},syntax:{js:[],py:["Entry.value_of_distance(%2)"]}}, -coordinate_mouse:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_coordinate_mouse_1,color:"#3D3D3D"},{type:"Dropdown",options:[["x","x"],["y","y"]],value:"x",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_coordinate_mouse_2,color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"coordinate_mouse"},paramsKeyMap:{VALUE:1},"class":"calc",isNotFor:[],func:function(b,a){return"x"===a.getField("VALUE", -a)?Number(Entry.stage.mouseCoordinate.x):Number(Entry.stage.mouseCoordinate.y)},syntax:{js:[],py:["Entry.coordinate_of_mouse(%2)"]}},coordinate_object:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_coordinate_object_1,color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"spritesWithSelf",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_coordinate_object_2,color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_coordinate_x_value, -"x"],[Lang.Blocks.CALC_coordinate_y_value,"y"],[Lang.Blocks.CALC_coordinate_rotation_value,"rotation"],[Lang.Blocks.CALC_coordinate_direction_value,"direction"],[Lang.Blocks.CALC_coordinate_size_value,"size"],[Lang.Blocks.CALC_picture_index,"picture_index"],[Lang.Blocks.CALC_picture_name,"picture_name"]],value:"x",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC}],events:{},def:{params:[null,null,null,null],type:"coordinate_object"},paramsKeyMap:{VALUE:1,COORDINATE:3},"class":"calc",isNotFor:[], -func:function(b,a){var d=a.getField("VALUE",a),d="self"==d?b:Entry.container.getEntity(d);switch(a.getField("COORDINATE",a)){case "x":return d.getX();case "y":return d.getY();case "rotation":return d.getRotation();case "direction":return d.getDirection();case "picture_index":var c=d.parent,c=c.pictures;return c.indexOf(d.picture)+1;case "size":return Number(d.getSize().toFixed(1));case "picture_name":return c=d.parent,c=c.pictures,c[c.indexOf(d.picture)].name}},syntax:{js:[],py:["Entry.value_of(%2, %4)"]}}, -calc_basic:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[["+","PLUS"],["-","MINUS"],["x","MULTI"],["/","DIVIDE"]],value:"PLUS",fontSize:11,noArrow:!0},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"number",params:["10"]},"PLUS",{type:"number",params:["10"]}],type:"calc_basic"},defs:[{params:[{type:"number",params:["10"]},"PLUS",{type:"number",params:["10"]}],type:"calc_basic"},{params:[{type:"number",params:["10"]}, -"MINUS",{type:"number",params:["10"]}],type:"calc_basic"},{params:[{type:"number",params:["10"]},"MULTI",{type:"number",params:["10"]}],type:"calc_basic"},{params:[{type:"number",params:["10"]},"DIVIDE",{type:"number",params:["10"]}],type:"calc_basic"}],paramsKeyMap:{LEFTHAND:0,OPERATOR:1,RIGHTHAND:2},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getField("OPERATOR",a),c=a.getNumberValue("LEFTHAND",a),e=a.getNumberValue("RIGHTHAND",a);return"PLUS"==d?c+e:"MINUS"==d?c-e:"MULTI"==d?c*e:c/e}, -syntax:{js:[],py:["(%1 %2calc_basic# %3)"]}},calc_plus:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"+",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d+c},syntax:{js:[],py:[""]}},calc_minus:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block", -accept:"string"},{type:"Text",text:"-",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d-c},syntax:{js:[],py:[""]}},calc_times:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"x",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0, -RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d*c},syntax:{js:[],py:[""]}},calc_divide:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"/",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d/c},syntax:{js:[], -py:[""]}},calc_mod:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"/",color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_mod_3,color:"#3D3D3D"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]},null],type:"calc_mod"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND", -a);return d%c},syntax:{js:[],py:["Entry.get_remainder(%1, %3)"]}},calc_share:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"/",color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:"\uc758 \ubaab",color:"#3D3D3D"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]},null],type:"calc_share"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"calc",isNotFor:[],func:function(b,a){var d= -a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return Math.floor(d/c)},syntax:{js:[],py:[""]}},calc_operation:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_calc_operation_of_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_operation_of_2,color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_calc_operation_square,"square"],[Lang.Blocks.CALC_calc_operation_root,"root"],[Lang.Blocks.CALC_calc_operation_sin, -"sin"],[Lang.Blocks.CALC_calc_operation_cos,"cos"],[Lang.Blocks.CALC_calc_operation_tan,"tan"],[Lang.Blocks.CALC_calc_operation_asin,"asin_radian"],[Lang.Blocks.CALC_calc_operation_acos,"acos_radian"],[Lang.Blocks.CALC_calc_operation_atan,"atan_radian"],[Lang.Blocks.CALC_calc_operation_log,"log"],[Lang.Blocks.CALC_calc_operation_ln,"ln"],[Lang.Blocks.CALC_calc_operation_unnatural,"unnatural"],[Lang.Blocks.CALC_calc_operation_floor,"floor"],[Lang.Blocks.CALC_calc_operation_ceil,"ceil"],[Lang.Blocks.CALC_calc_operation_round, -"round"],[Lang.Blocks.CALC_calc_operation_factorial,"factorial"],[Lang.Blocks.CALC_calc_operation_abs,"abs"]],value:"square",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC}],events:{},def:{params:[null,{type:"number",params:["10"]},null,null],type:"calc_operation"},paramsKeyMap:{LEFTHAND:1,VALUE:3},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getField("VALUE",a);if(-1<["asin_radian","acos_radian"].indexOf(c)&&(1d))throw Error("x range exceeded"); -c.indexOf("_")&&(c=c.split("_")[0]);-1<["sin","cos","tan"].indexOf(c)&&(d=Entry.toRadian(d));var e=0;switch(c){case "square":e=d*d;break;case "factorial":e=Entry.factorial(d);break;case "root":e=Math.sqrt(d);break;case "log":e=Math.log(d)/Math.LN10;break;case "ln":e=Math.log(d);break;case "asin":case "acos":case "atan":e=Entry.toDegrees(Math[c](d));break;case "unnatural":e=d-Math.floor(d);0>d&&(e=1-e);break;default:e=Math[c](d)}return e},syntax:{js:[],py:["Entry.value_of_math_operation(%2, %4)"]}}, -calc_rand:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_calc_rand_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_rand_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_rand_3,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"number",params:["0"]},null,{type:"number",params:["10"]},null],type:"calc_rand"},paramsKeyMap:{LEFTHAND:1,RIGHTHAND:3},"class":"calc", -isNotFor:[],func:function(b,a){var d=a.getStringValue("LEFTHAND",a),c=a.getStringValue("RIGHTHAND",a),e=Math.min(d,c),f=Math.max(d,c),d=Entry.isFloat(d);return Entry.isFloat(c)||d?(Math.random()*(f-e)+e).toFixed(2):Math.floor(Math.random()*(f-e+1)+e)},syntax:{js:[],py:["random.randint(%2, %4)"]}},get_date:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_date_1,color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_get_date_year,"YEAR"], -[Lang.Blocks.CALC_get_date_month,"MONTH"],[Lang.Blocks.CALC_get_date_day,"DAY"],[Lang.Blocks.CALC_get_date_hour,"HOUR"],[Lang.Blocks.CALC_get_date_minute,"MINUTE"],[Lang.Blocks.CALC_get_date_second,"SECOND"]],value:"YEAR",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_get_date_2,color:"#3D3D3D"}],events:{},def:{params:[null,"YEAR",null],type:"get_date"},paramsKeyMap:{VALUE:1},"class":"calc_date",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c= -new Date;return"YEAR"==d?c.getFullYear():"MONTH"==d?c.getMonth()+1:"DAY"==d?c.getDate():"HOUR"==d?c.getHours():"MINUTE"==d?c.getMinutes():c.getSeconds()},syntax:{js:[],py:["Entry.value_of_date_time(%2)"]}},get_sound_duration:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_sound_duration_1,color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"sounds",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_get_sound_duration_2, -color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"get_sound_duration"},paramsKeyMap:{VALUE:1},"class":"calc_duration",isNotFor:[],func:function(b,a){for(var d=a.getField("VALUE",a),c=b.parent.sounds,e=0;ec||c>d.length-1)throw Error();return d[c]},syntax:{js:[],py:["Entry.string_index_of(%2, %4)"]}},length_of_string:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_length_of_string_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_length_of_string_2,color:"#3D3D3D"}],events:{}, -def:{params:[null,{type:"text",params:[Lang.Blocks.entry]},null],type:"length_of_string"},paramsKeyMap:{STRING:1},"class":"calc_string",isNotFor:[],func:function(b,a){return a.getStringValue("STRING",a).length},syntax:{js:[],py:["Entry.string_length(%2)"]}},substring:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_substring_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_substring_2,color:"#3D3D3D"},{type:"Block", -accept:"string"},{type:"Text",text:Lang.Blocks.CALC_substring_3,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_substring_4,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.hi_entry]},null,{type:"number",params:["2"]},null,{type:"number",params:["5"]},null],type:"substring"},paramsKeyMap:{STRING:1,START:3,END:5},"class":"calc_string",isNotFor:[],func:function(b,a){var d=a.getStringValue("STRING",a),c=a.getNumberValue("START",a)-1,e= -a.getNumberValue("END",a)-1,f=d.length-1;if(0>c||0>e||c>f||e>f)throw Error();return d.substring(Math.min(c,e),Math.max(c,e)+1)},syntax:{js:[],py:["Entry.string_substring(%2, %4, %6)"]}},replace_string:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_replace_string_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_replace_string_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_replace_string_3, -color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_replace_string_4,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.hi_entry]},null,{type:"text",params:[Lang.Blocks.hello]},null,{type:"text",params:[Lang.Blocks.nice]},null],type:"replace_string"},paramsKeyMap:{STRING:1,OLD_WORD:3,NEW_WORD:5},"class":"calc_string",isNotFor:[],func:function(b,a){return a.getStringValue("STRING",a).replace(new RegExp(a.getStringValue("OLD_WORD",a),"gm"), -a.getStringValue("NEW_WORD",a))},syntax:{js:[],py:["Entry.string_replace(%2, %4, %6)"]}},change_string_case:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_change_string_case_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_change_string_case_2,color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_change_string_case_sub_1,"toUpperCase"],[Lang.Blocks.CALC_change_string_case_sub_2,"toLowerCase"]],value:"toUpperCase", -fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_change_string_case_3,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:["Hello Entry!"]},null,null,null],type:"change_string_case"},paramsKeyMap:{STRING:1,CASE:3},"class":"calc_string",isNotFor:[],func:function(b,a){return a.getStringValue("STRING",a)[a.getField("CASE",a)]()},syntax:{js:[],py:["Entry.string_case(%2, %4)"]}},index_of_string:{color:"#FFD974",skeleton:"basic_string_field",statements:[], -params:[{type:"Text",text:Lang.Blocks.CALC_index_of_string_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_index_of_string_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_index_of_string_3,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.hi_entry]},null,{type:"text",params:[Lang.Blocks.entry]},null],type:"index_of_string"},paramsKeyMap:{LEFTHAND:1,RIGHTHAND:3},"class":"calc_string",isNotFor:[], -func:function(b,a){var d=a.getStringValue("LEFTHAND",a),c=a.getStringValue("RIGHTHAND",a),d=d.indexOf(c);return-1d)throw Error(Lang.Blocks.FLOW_repeat_basic_errorMsg);a.iterCount=Math.floor(d)}if(0==a.iterCount||0>a.iterCount)return delete a.isLooped,delete a.iterCount,a.callReturn();a.iterCount--;return a.getStatement("DO",a)},syntax:{js:[],py:["for i in range(%1):\n$1"]}},repeat_inf:{color:"#498deb",skeleton:"basic_loop",statements:[{accept:"basic"}],params:[{type:"Indicator",img:"block_icon/flow_03.png", -size:12}],events:{},def:{params:[null],type:"repeat_inf"},statementsKeyMap:{DO:0},"class":"repeat",isNotFor:[],func:function(b,a){a.isLooped=!0;return a.getStatement("DO")},syntax:{js:[],py:["while True:\n$1"]}},stop_repeat:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null],type:"stop_repeat"},"class":"repeat",isNotFor:[],func:function(b,a){return this.executor.breakLoop()},syntax:{js:[],py:["break"]}},wait_until_true:{color:"#498deb", -skeleton:"basic",statements:[],params:[{type:"Block",accept:"boolean"},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[{type:"True"},null],type:"wait_until_true"},paramsKeyMap:{BOOL:0},"class":"wait",isNotFor:[],func:function(b,a){return a.getBooleanValue("BOOL",a)?a.callReturn():a},syntax:{js:[],py:["Entry.wait_until(%1)"]}},_if:{color:"#498deb",skeleton:"basic_loop",statements:[{accept:"basic"}],params:[{type:"Block",accept:"boolean"},{type:"Indicator",img:"block_icon/flow_03.png", -size:12}],events:{},def:{params:[{type:"True"},null],type:"_if"},paramsKeyMap:{BOOL:0},statementsKeyMap:{STACK:0},"class":"condition",isNotFor:[],func:function(b,a){return a.isCondition?(delete a.isCondition,a.callReturn()):a.getBooleanValue("BOOL",a)?(a.isCondition=!0,a.getStatement("STACK",a)):a.callReturn()},syntax:{js:[],py:["if %1:\n$1"]}},if_else:{color:"#498deb",skeleton:"basic_double_loop",statements:[{accept:"basic"},{accept:"basic"}],params:[{type:"Block",accept:"boolean"},{type:"Indicator", -img:"block_icon/flow_03.png",size:12},{type:"LineBreak"}],events:{},def:{params:[{type:"True"},null],type:"if_else"},paramsKeyMap:{BOOL:0},statementsKeyMap:{STACK_IF:0,STACK_ELSE:1},"class":"condition",isNotFor:[],func:function(b,a){if(a.isCondition)return delete a.isCondition,a.callReturn();var d=a.getBooleanValue("BOOL",a);a.isCondition=!0;return d?a.getStatement("STACK_IF",a):a.getStatement("STACK_ELSE",a)},syntax:{js:[],py:["if %1:\n$1\nelse:\n$2"]}},create_clone:{color:"#498deb",skeleton:"basic", -statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"clone",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_FLOW},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null,null],type:"create_clone"},paramsKeyMap:{VALUE:0},"class":"clone",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c=a.callReturn();"self"==d?b.parent.addCloneEntity(b.parent,b,null):Entry.container.getObject(d).addCloneEntity(b.parent,null,null);return c},syntax:{js:[],py:["Entry.create_clone(%1)"]}}, -delete_clone:{color:"#498deb",skeleton:"basic_without_next",statements:[],params:[{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null],type:"delete_clone"},"class":"clone",isNotFor:[],func:function(b,a){if(!b.isClone)return a.callReturn();b.removeClone();return this.die()},syntax:{js:[],py:["Entry.remove_clone()"]}},when_clone_start:{color:"#498deb",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_clone.png",size:17,position:{x:0, -y:-2}}],events:{},def:{params:[null],type:"when_clone_start"},"class":"clone",isNotFor:[],func:function(b,a){return a.callReturn()},event:"when_clone_start",syntax:{js:[],py:["def entry_event_clone_create():"]}},stop_run:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null]},func:function(b,a){return Entry.engine.toggleStop()},syntax:{js:[],py:[""]}},repeat_while_true:{color:"#498deb",skeleton:"basic_loop",statements:[{accept:"basic"}], -params:[{type:"Block",accept:"boolean"},{type:"Dropdown",options:[[Lang.Blocks.FLOW_repeat_while_true_until,"until"],[Lang.Blocks.FLOW_repeat_while_true_while,"while"]],value:"until",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_FLOW},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[{type:"True"},null,null],type:"repeat_while_true"},paramsKeyMap:{BOOL:0,OPTION:1},statementsKeyMap:{DO:0},"class":"repeat",isNotFor:[],func:function(b,a){var d=a.getBooleanValue("BOOL", -a);"until"==a.getField("OPTION",a)&&(d=!d);return(a.isLooped=d)?a.getStatement("DO",a):a.callReturn()},syntax:{js:[],py:["not yet supported in textcoding"]}},stop_object:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.FLOW_stop_object_all,"all"],[Lang.Blocks.FLOW_stop_object_this_object,"thisOnly"],[Lang.Blocks.FLOW_stop_object_this_thread,"thisThread"],[Lang.Blocks.FLOW_stop_object_other_thread,"otherThread"]],value:"all",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_FLOW}, -{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null,null],type:"stop_object"},paramsKeyMap:{TARGET:0},"class":"terminate",isNotFor:[],func:function(b,a){var d=a.getField("TARGET",a),c=Entry.container;switch(d){case "all":return c.mapObject(function(a){a.script.clearExecutors()},null),this.die();case "thisOnly":return b.parent.script.clearExecutorsByEntity(b),this.die();case "thisObject":return b.parent.script.clearExecutors(),this.die();case "thisThread":return this.die(); -case "otherThread":for(var d=this.executor,c=b.parent.script,e=c.executors,f=0;fa.count?(50>c.leftFloor&& -50>c.rightFloor?a.count++:a.count=0,c=c.leftFloor-c.rightFloor,d.leftWheel=45+.25*c,d.rightWheel=45-.25*c):(a.count=0,a.boardState=2);break;case 2:c=c.leftFloor-c.rightFloor;d.leftWheel=45+.25*c;d.rightWheel=45-.25*c;a.boardState=3;var e=setTimeout(function(){a.boardState=4;Entry.Hamster.removeTimeout(e)},250);Entry.Hamster.timeouts.push(e);break;case 3:c=c.leftFloor-c.rightFloor;d.leftWheel=45+.25*c;d.rightWheel=45-.25*c;break;case 4:d.leftWheel=0,d.rightWheel=0,a.boardState=0,a.isMoving=!1}return a}delete a.isStart; -delete a.isMoving;delete a.count;delete a.boardState;Entry.engine.isContinue=!1;d.leftWheel=0;d.rightWheel=0;return a.callReturn()}a.isStart=!0;a.isMoving=!0;a.count=0;a.boardState=1;d.leftWheel=45;d.rightWheel=45;Entry.Hamster.setLineTracerMode(d,0);return a},syntax:{js:[],py:["Hamster.move_forward()"]}},hamster_turn_once:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_turn_once_left,"LEFT"],[Lang.Blocks.HAMSTER_turn_right,"RIGHT"]],value:"LEFT", -fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null],type:"hamster_turn_once"},paramsKeyMap:{DIRECTION:0},"class":"hamster_board",isNotFor:["hamster"],func:function(b,a){var d=Entry.hw.sendQueue,c=Entry.hw.portData;if(a.isStart){if(a.isMoving){if(a.isLeft)switch(a.boardState){case 1:2>a.count?50c.leftFloor&&(a.boardState=3);break;case 3:2>a.count?20>c.leftFloor&&a.count++:(a.count= -0,a.boardState=4);break;case 4:50a.count?50c.rightFloor&&(a.boardState=3);break;case 3:2>a.count?20>c.rightFloor&&a.count++:(a.count=0,a.boardState=4);break;case 4:50Entry.Hamster.tempo&&(Entry.Hamster.tempo=1);return a.callReturn()},syntax:{js:[],py:["Hamster.add_tempo(%1)"]}},hamster_set_tempo_to:{color:"#00979D",skeleton:"basic", -statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["60"]},null],type:"hamster_set_tempo_to"},paramsKeyMap:{VALUE:0},"class":"hamster_buzzer",isNotFor:["hamster"],func:function(b,a){Entry.Hamster.tempo=a.getNumberValue("VALUE");1>Entry.Hamster.tempo&&(Entry.Hamster.tempo=1);return a.callReturn()},syntax:{js:[],py:["Hamster.set_tempo(%1)"]}},hamster_set_port_to:{color:"#00979D",skeleton:"basic", -statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_port_a,"A"],[Lang.Blocks.HAMSTER_port_b,"B"],[Lang.Blocks.HAMSTER_port_ab,"AB"]],value:"A",fontSize:11},{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_analog_input,"0"],[Lang.Blocks.HAMSTER_digital_input,"1"],[Lang.Blocks.HAMSTER_servo_output,"8"],[Lang.Blocks.HAMSTER_pwm_output,"9"],[Lang.Blocks.HAMSTER_digital_output,"10"]],value:"0",fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null, -null,null],type:"hamster_set_port_to"},paramsKeyMap:{PORT:0,MODE:1},"class":"hamster_port",isNotFor:["hamster"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getField("PORT",a),e=Number(a.getField("MODE",a));"A"==c?d.ioModeA=e:("B"!=c&&(d.ioModeA=e),d.ioModeB=e);return a.callReturn()},syntax:{js:[],py:["Hamster.set_port(%1, %2)"]}},hamster_change_output_by:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_port_a,"A"],[Lang.Blocks.HAMSTER_port_b, -"B"],[Lang.Blocks.HAMSTER_port_ab,"AB"]],value:"A",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text",params:["10"]},null],type:"hamster_change_output_by"},paramsKeyMap:{PORT:0,VALUE:1},"class":"hamster_port",isNotFor:["hamster"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getField("PORT"),e=a.getNumberValue("VALUE");"A"==c?d.outputA=void 0!=d.outputA?d.outputA+e:e:("B"!=c&&(d.outputA=void 0!=d.outputA? -d.outputA+e:e),d.outputB=void 0!=d.outputB?d.outputB+e:e);return a.callReturn()},syntax:{js:[],py:["Hamster.add_output(%1, %2)"]}},hamster_set_output_to:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_port_a,"A"],[Lang.Blocks.HAMSTER_port_b,"B"],[Lang.Blocks.HAMSTER_port_ab,"AB"]],value:"A",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text",params:["100"]}, -null],type:"hamster_set_output_to"},paramsKeyMap:{PORT:0,VALUE:1},"class":"hamster_port",isNotFor:["hamster"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getField("PORT"),e=a.getNumberValue("VALUE");"A"==c?d.outputA=e:("B"!=c&&(d.outputA=e),d.outputB=e);return a.callReturn()},syntax:{js:[],py:["Hamster.set_output(%1, %2)"]}},is_clicked:{color:"#AEB8FF",skeleton:"basic_boolean_field",statements:[],params:[{type:"Text",text:Lang.Blocks.JUDGEMENT_is_clicked,color:"#3D3D3D"}],events:{},def:{params:[null], -type:"is_clicked"},"class":"boolean_input",isNotFor:[],func:function(b,a){return Entry.stage.isClick},syntax:{js:[],py:["Entry.is_mouse_clicked()"]}},is_press_some_key:{color:"#AEB8FF",skeleton:"basic_boolean_field",statements:[],params:[{type:"Keyboard",value:81},{type:"Text",text:Lang.Blocks.JUDGEMENT_is_press_some_key_2,color:"#3D3D3D"}],events:{},def:{params:[null,null],type:"is_press_some_key"},paramsKeyMap:{VALUE:0},"class":"boolean_input",isNotFor:[],func:function(b,a){var d=Number(a.getField("VALUE", -a));return 0<=Entry.pressedKeys.indexOf(d)},syntax:{js:[],py:["Entry.is_pressed(%1)"]}},reach_something:{color:"#AEB8FF",skeleton:"basic_boolean_field",statements:[],params:[{type:"Text",text:Lang.Blocks.JUDGEMENT_reach_something_1,color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"collision",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_JUDGE},{type:"Text",text:Lang.Blocks.JUDGEMENT_reach_something_2,color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"reach_something"},paramsKeyMap:{VALUE:1}, -"class":"boolean_collision",isNotFor:[],func:function(b,a){if(!b.getVisible())return!1;var d=a.getField("VALUE",a),c=b.object,e=/wall/.test(d),f=ndgmr.checkPixelCollision;if(e)switch(e=Entry.stage.wall,d){case "wall":return!!(f(c,e.up,.2,!0)||f(c,e.down,.2,!0)||f(c,e.left,.2,!0)||f(c,e.right,.2,!0));case "wall_up":return!!f(c,e.up,.2,!0);case "wall_down":return!!f(c,e.down,.2,!0);case "wall_right":return!!f(c,e.right,.2,!0);case "wall_left":return!!f(c,e.left,.2,!0)}else{if("mouse"==d)return f=Entry.stage.canvas, -f=c.globalToLocal(f.mouseX,f.mouseY),c.hitTest(f.x,f.y);d=Entry.container.getEntity(d);if("textBox"==d.type||"textBox"==b.type){f=d.object.getTransformedBounds();c=c.getTransformedBounds();if(Entry.checkCollisionRect(c,f))return!0;for(var d=d.parent.clonedEntities,e=0,g=d.length;e","BIGGER"]],value:"EQUAL",fontSize:11},{type:"Block",accept:"string"}],events:{},def:{params:[null],type:"boolean_comparison"},paramsKeyMap:{LEFTHAND:0,OPERATOR:1,RIGHTHAND:2},func:function(b,a){var d= -a.getField("OPERATOR",a),c=a.getNumberValue("LEFTHAND",a),e=a.getNumberValue("RIGHTHAND",a);return"EQUAL"==d?c==e:"BIGGER"==d?c>e:c",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]}],type:"boolean_bigger"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"boolean_compare", -isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d>c},syntax:{js:[],py:[""]}},boolean_smaller:{color:"#AEB8FF",skeleton:"basic_boolean_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"<",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]}],type:"boolean_smaller"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"boolean_compare", -isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d","GREATER"],["<","LESS"],["\u2265","GREATER_OR_EQUAL"],["\u2264","LESS_OR_EQUAL"]],value:"EQUAL",fontSize:11,noArrow:!0},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"text",params:["10"]},"EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"},defs:[{params:[{type:"text",params:["10"]},"EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"}, -{params:[{type:"text",params:["10"]},"GREATER",{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"LESS",{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"GREATER_OR_EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"LESS_OR_EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"}],paramsKeyMap:{LEFTHAND:0,OPERATOR:1,RIGHTHAND:2},"class":"boolean_compare", -isNotFor:[],func:function(b,a){var d=a.getField("OPERATOR",a),c=a.getStringValue("LEFTHAND",a),e=a.getStringValue("RIGHTHAND",a);switch(d){case "EQUAL":return c==e;case "GREATER":return Number(c)>Number(e);case "LESS":return Number(c)=Number(e);case "LESS_OR_EQUAL":return Number(c)<=Number(e)}},syntax:{js:[],py:["(%1 %2boolean_compare# %3)"]}},show:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png", -size:12}],events:{},def:{params:[null],type:"show"},"class":"visibility",isNotFor:[],func:function(b,a){b.setVisible(!0);return a.callReturn()},syntax:{js:[],py:["Entry.show()"]}},hide:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"hide"},"class":"visibility",isNotFor:[],func:function(b,a){b.setVisible(!1);return a.callReturn()},syntax:{js:[],py:["Entry.hide()"]}},dialog_time:{color:"#EC4466",skeleton:"basic", -statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.speak,"speak"]],value:"speak",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_LOOKS},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"text",params:[Lang.Blocks.block_hi]},{type:"number",params:["4"]},null,null],type:"dialog_time"},paramsKeyMap:{VALUE:0,SECOND:1,OPTION:2},"class":"say",isNotFor:["textBox"],func:function(b,a){if(!a.isStart){var d= -a.getNumberValue("SECOND",a),c=a.getStringValue("VALUE",a),e=a.getField("OPTION",a);a.isStart=!0;a.timeFlag=1;c||"number"==typeof c||(c=" ");c=Entry.convertToRoundedDecimals(c,3);new Entry.Dialog(b,c,e);b.syncDialogVisible(b.getVisible());setTimeout(function(){a.timeFlag=0},1E3*d)}if(0==a.timeFlag)return delete a.timeFlag,delete a.isStart,b.dialog&&b.dialog.remove(),a.callReturn();b.dialog||(c=a.getStringValue("VALUE",a),e=a.getField("OPTION",a),c||"number"==typeof c||(c=" "),c=Entry.convertToRoundedDecimals(c, -3),new Entry.Dialog(b,c,e),b.syncDialogVisible(b.getVisible()));return a},syntax:{js:[],py:["Entry.print_for_seconds(%1, %2, %3)"]}},dialog:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.speak,"speak"]],value:"speak",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_LOOKS},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"text",params:[Lang.Blocks.block_hi]},null,null],type:"dialog"}, -paramsKeyMap:{VALUE:0,OPTION:1},"class":"say",isNotFor:["textBox"],func:function(b,a){var d=a.getStringValue("VALUE",a);d||"number"==typeof d||(d=" ");var c=a.getField("OPTION",a),d=Entry.convertToRoundedDecimals(d,3);new Entry.Dialog(b,d,c);b.syncDialogVisible(b.getVisible());return a.callReturn()},syntax:{js:[],py:["Entry.print(%1)"]}},remove_dialog:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"remove_dialog"}, -"class":"say",isNotFor:["textBox"],func:function(b,a){b.dialog&&b.dialog.remove();return a.callReturn()},syntax:{js:[],py:["Entry.print_remove()"]}},change_to_nth_shape:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"pictures",fontSize:11},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,null],type:"change_to_nth_shape"},paramsKeyMap:{VALUE:0},"class":"shape",isNotFor:[],func:function(b,a){var d=a.getField("VALUE", -a),d=b.parent.getPicture(d);b.setImage(d);return a.callReturn()},syntax:{js:[],py:[""]}},change_to_next_shape:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.LOOKS_change_shape_next,"next"],[Lang.Blocks.LOOKS_change_shape_prev,"prev"]],value:"next",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_LOOKS},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,null],type:"change_to_next_shape"},paramsKeyMap:{DRIECTION:0},"class":"shape", -isNotFor:["textBox"],func:function(b,a){var d;d="prev"!==a.getStringField("DRIECTION")?b.parent.getNextPicture(b.picture.id):b.parent.getPrevPicture(b.picture.id);b.setImage(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_shape_of(%1)"]}},set_effect_volume:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.color,"color"],[Lang.Blocks.brightness,"brightness"],[Lang.Blocks.opacity,"opacity"]],value:"color",fontSize:11},{type:"Block",accept:"string"}, -{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["10"]},null],type:"set_effect_volume"},paramsKeyMap:{EFFECT:0,VALUE:1},"class":"effect",isNotFor:["textBox"],func:function(b,a){var d=a.getField("EFFECT",a),c=a.getNumberValue("VALUE",a);"color"==d?b.effect.hue=c+b.effect.hue:"lens"!=d&&"swriling"!=d&&"pixel"!=d&&"mosaic"!=d&&("brightness"==d?b.effect.brightness=c+b.effect.brightness:"blur"!=d&&"opacity"==d&&(b.effect.alpha+=c/100));b.applyFilter(!0); -return a.callReturn()},syntax:{js:[],py:["Entry.add_effect(%1, %2)"]}},set_effect:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.color,"color"],[Lang.Blocks.brightness,"brightness"],[Lang.Blocks.opacity,"opacity"]],value:"color",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["100"]},null],type:"set_effect"},paramsKeyMap:{EFFECT:0,VALUE:1},"class":"effect", -isNotFor:["textBox"],func:function(b,a){var d=a.getField("EFFECT",a),c=a.getNumberValue("VALUE",a);"color"==d?b.effect.hue=c:"lens"!=d&&"swriling"!=d&&"pixel"!=d&&"mosaic"!=d&&("brightness"==d?b.effect.brightness=c:"blur"!=d&&"opacity"==d&&(b.effect.alpha=c/100));b.applyFilter(!0);return a.callReturn()},syntax:{js:[],py:["Entry.set_effect(%1, %2)"]}},erase_all_effects:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null], -type:"erase_all_effects"},"class":"effect",isNotFor:["textBox"],func:function(b,a){b.resetFilter();return a.callReturn()},syntax:{js:[],py:["Entry.clear_effect()"]}},change_scale_percent:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"change_scale_percent"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=(a.getNumberValue("VALUE", -a)+100)/100;b.setScaleX(b.getScaleX()*d);b.setScaleY(b.getScaleY()*d);return a.callReturn()},syntax:{js:[],py:[""]}},set_scale_percent:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number",params:["100"]},null],type:"set_scale_percent"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a)/100,c=b.snapshot_;b.setScaleX(d* -c.scaleX);b.setScaleY(d*c.scaleY);return a.callReturn()},syntax:{js:[],py:[""]}},change_scale_size:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"change_scale_size"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setSize(b.getSize()+d);return a.callReturn()},syntax:{js:[],py:["Entry.add_size(%1)"]}}, -set_scale_size:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number",params:["100"]},null],type:"set_scale_size"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setSize(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_size(%1)"]}},flip_y:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator", -img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"flip_y"},"class":"flip",isNotFor:[],func:function(b,a){b.setScaleX(-1*b.getScaleX());return a.callReturn()},syntax:{js:[],py:["Entry.flip_vertical()"]}},flip_x:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"flip_x"},"class":"flip",isNotFor:[],func:function(b,a){b.setScaleY(-1*b.getScaleY());return a.callReturn()},syntax:{js:[], -py:["Entry.flip_horizontal()"]}},set_object_order:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"objectSequence",fontSize:11},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,null],type:"set_object_order"},paramsKeyMap:{VALUE:0},"class":"z-index",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c=Entry.container.getCurrentObjects().indexOf(b.parent);if(-1f)throw Error("object is not available for current scene");switch(c){case "FRONT":d=0;break;case "FORWARD":d=Math.max(0,f-1);break;case "BACKWARD":d=Math.min(e,f+1);break;case "BACK":d=e}Entry.container.moveElementByBlock(f,d);return a.callReturn()},syntax:{js:[],py:["Entry.set_layer(%1)"]}},move_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator", -img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"move_direction"},paramsKeyMap:{VALUE:0},"class":"walk",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setX(b.getX()+d*Math.cos((b.getRotation()+b.getDirection()-90)/180*Math.PI));b.setY(b.getY()-d*Math.sin((b.getRotation()+b.getDirection()-90)/180*Math.PI));b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move(%1)"]}}, -move_x:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"move_x"},paramsKeyMap:{VALUE:0},"class":"move_relative",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setX(b.getX()+d);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.set_x(%1)"]}},move_y:{color:"#A751E3", -skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"move_y"},paramsKeyMap:{VALUE:0},"class":"move_relative",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setY(b.getY()+d);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.set_y(%1)"]}},locate_xy_time:{color:"#A751E3",skeleton:"basic", -statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["2"]},{type:"number",params:["10"]},{type:"number",params:["10"]},null],type:"locate_xy_time"},paramsKeyMap:{VALUE1:0,VALUE2:1,VALUE3:2},"class":"move_absolute",isNotFor:[],func:function(b,a){function d(){var d=a.x-b.getX(),c=a.y-b.getY(),d=d/a.frameCount,c=c/a.frameCount;b.setX(b.getX()+ -d);b.setY(b.getY()+c);a.frameCount--;b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY())}if(!a.isStart){var c;c=a.getNumberValue("VALUE1",a);a.isStart=!0;a.frameCount=Math.max(Math.floor(c*Entry.FPS),1);a.x=a.getNumberValue("VALUE2",a);a.y=a.getNumberValue("VALUE3",a);1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.set_xy_for_seconds(%1, %2, %3)"]}},rotate_by_angle:{color:"#A751E3",skeleton:"basic", -statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["90"]},null],type:"rotate_by_angle"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setRotation(b.getRotation()+d);return a.callReturn()},syntax:{js:[],py:[""]}},rotate_by_angle_dropdown:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[["45","45"],["90", -"90"],["135","135"],["180","180"]],value:"45",fontSize:11},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:["45",null],type:"rotate_by_angle_dropdown"},paramsKeyMap:{VALUE:0},"class":"ebs",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a);b.setRotation(b.getRotation()+Number(d));return a.callReturn()},syntax:{js:[],py:[""]}},see_angle:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png", -size:12}],events:{},def:{params:[{type:"number",params:["90"]},null],type:"see_angle"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d);return a.callReturn()},syntax:{js:[],py:[""]}},see_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"sprites",fontSize:11},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null,null]},paramsKeyMap:{VALUE:0}, -func:function(b,a){var d=a.getField("VALUE",a),c=Entry.container.getEntity(d),d=c.getX()-b.getX(),c=c.getY()-b.getY();0<=d?b.setRotation(Math.atan(c/d)/Math.PI*180+90):b.setRotation(Math.atan(c/d)/Math.PI*180+270);return a.callReturn()},syntax:{js:[],py:[""]}},locate_xy:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["0"]},{type:"number", -params:["0"]},null],type:"locate_xy"},paramsKeyMap:{VALUE1:0,VALUE2:1},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE1",a),c=a.getNumberValue("VALUE2",a);b.setX(d);b.setY(c);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.set_xy(%1, %2)"]}},locate_x:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{}, -def:{params:[{type:"number",params:["10"]},null],type:"locate_x"},paramsKeyMap:{VALUE:0},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setX(d);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move_x(%1)"]}},locate_y:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number", -params:["10"]},null],type:"locate_y"},paramsKeyMap:{VALUE:0},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setY(d);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move_y(%1)"]}},locate:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_MOVING},{type:"Indicator",img:"block_icon/moving_03.png", -size:12}],events:{},def:{params:[null,null],type:"locate"},paramsKeyMap:{VALUE:0},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c;"mouse"==d?(d=Entry.stage.mouseCoordinate.x,c=Entry.stage.mouseCoordinate.y):(c=Entry.container.getEntity(d),d=c.getX(),c=c.getY());b.setX(Number(d));b.setY(Number(c));b.brush&&!b.brush.stop&&b.brush.lineTo(d,-1*c);return a.callReturn()},syntax:{js:[],py:["Entry.set_location(%1)"]}},move_xy_time:{color:"#A751E3",skeleton:"basic",statements:[], -params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["2"]},{type:"number",params:["10"]},{type:"number",params:["10"]},null],type:"move_xy_time"},paramsKeyMap:{VALUE1:0,VALUE2:1,VALUE3:2},"class":"move_relative",isNotFor:[],func:function(b,a){function d(){b.setX(b.getX()+a.dX);b.setY(b.getY()+a.dY);a.frameCount--;b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(), --1*b.getY())}if(!a.isStart){var c;c=a.getNumberValue("VALUE1",a);var e=a.getNumberValue("VALUE2",a),f=a.getNumberValue("VALUE3",a);a.isStart=!0;a.frameCount=Math.max(Math.floor(c*Entry.FPS),1);a.dX=e/a.frameCount;a.dY=f/a.frameCount;1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.add_xy_for_seconds(%1, %2, %3)"]}},rotate_by_angle_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"}, -{type:"Angle"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["2"]},null,null],type:"rotate_by_angle_time"},paramsKeyMap:{VALUE:1},"class":"rotate",isNotFor:[],func:function(b,a){if(!a.isStart){var d;d=a.getNumberValue("VALUE",a);var c=a.getNumberField("VALUE",a);a.isStart=!0;a.frameCount=Math.floor(d*Entry.FPS);a.dAngle=c/a.frameCount}if(0!=a.frameCount)return b.setRotation(b.getRotation()+a.dAngle),a.frameCount--,a;delete a.isStart;delete a.frameCount; -return a.callReturn()},syntax:{js:[],py:[""]}},bounce_wall:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null],type:"bounce_wall"},"class":"walk",isNotFor:[],func:function(b,a){var d=b.parent.getRotateMethod(),c="free"==d?(b.getRotation()+b.getDirection()).mod(360):b.getDirection(),e=Entry.Utils.COLLISION.NONE;if(90>c&&0<=c||360>c&&270<=c){var e=b.collision==Entry.Utils.COLLISION.UP,f=ndgmr.checkPixelCollision(Entry.stage.wall.up, -b.object,0,!1);!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE);f&&e&&(f=!1);f?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision=Entry.Utils.COLLISION.UP):(e=b.collision==Entry.Utils.COLLISION.DOWN,f=ndgmr.checkPixelCollision(Entry.stage.wall.down,b.object,0,!1),!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE),f&&e&&(f=!1),f&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision= -Entry.Utils.COLLISION.DOWN))}else 270>c&&90<=c&&(e=b.collision==Entry.Utils.COLLISION.DOWN,f=ndgmr.checkPixelCollision(Entry.stage.wall.down,b.object,0,!1),!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE),f&&e&&(f=!1),f?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision=Entry.Utils.COLLISION.DOWN):(e=b.collision==Entry.Utils.COLLISION.UP,f=ndgmr.checkPixelCollision(Entry.stage.wall.up,b.object,0,!1),!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE), -f&&e&&(f=!1),f&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision=Entry.Utils.COLLISION.UP)));360>c&&180<=c?(e=b.collision==Entry.Utils.COLLISION.LEFT,c=ndgmr.checkPixelCollision(Entry.stage.wall.left,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.LEFT):(e=b.collision== -Entry.Utils.COLLISION.RIGHT,c=ndgmr.checkPixelCollision(Entry.stage.wall.right,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.RIGHT))):180>c&&0<=c&&(e=b.collision==Entry.Utils.COLLISION.RIGHT,c=ndgmr.checkPixelCollision(Entry.stage.wall.right,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c?("free"==d?b.setRotation(-b.getRotation()- -2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.RIGHT):(e=b.collision==Entry.Utils.COLLISION.LEFT,c=ndgmr.checkPixelCollision(Entry.stage.wall.left,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.LEFT)));return a.callReturn()},syntax:{js:[],py:["Entry.bounce_wall()"]}},flip_arrow_horizontal:{color:"#A751E3", -skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null]},func:function(b,a){b.setDirection(b.getDirection()+180);return a.callReturn()},syntax:{js:[],py:[""]}},flip_arrow_vertical:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null]},func:function(b,a){b.setDirection(b.getDirection()+180);return a.callReturn()},syntax:{js:[],py:[""]}},see_angle_object:{color:"#A751E3", -skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_MOVING},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null,null],type:"see_angle_object"},paramsKeyMap:{VALUE:0},"class":"rotate_absolute",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c=b.getX(),e=b.getY();if(b.parent.id==d)return a.callReturn();"mouse"==d?(d=Entry.stage.mouseCoordinate.y,c=Entry.stage.mouseCoordinate.x- -c,e=d-e):(d=Entry.container.getEntity(d),c=d.getX()-c,e=d.getY()-e);e=0===c&&0===e?b.getDirection()+b.getRotation():0<=c?-Math.atan(e/c)/Math.PI*180+90:-Math.atan(e/c)/Math.PI*180+270;c=b.getDirection()+b.getRotation();b.setRotation(b.getRotation()+e-c);return a.callReturn()},syntax:{js:[],py:["Entry.look_at_object(%1)"]}},see_angle_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{}, -def:{params:[{type:"number",params:["90"]},null],type:"see_angle_direction"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a),c=b.getDirection()+b.getRotation();b.setRotation(b.getRotation()+d-c);return a.callReturn()},syntax:{js:[],py:[""]}},rotate_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["90"]}, -null],type:"rotate_direction"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d+b.getDirection());return a.callReturn()},syntax:{js:[],py:[""]}},locate_object_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_MOVING},{type:"Indicator",img:"block_icon/moving_03.png",size:12}], -events:{},def:{params:[{type:"number",params:["2"]},null,null],type:"locate_object_time"},paramsKeyMap:{VALUE:0,TARGET:1},"class":"move_absolute",isNotFor:[],func:function(b,a){if(!a.isStart){var d,c,e;c=a.getField("TARGET",a);d=a.getNumberValue("VALUE",a);d=Math.floor(d*Entry.FPS);e=Entry.stage.mouseCoordinate;if(0!=d)"mouse"==c?(c=e.x-b.getX(),e=e.y-b.getY()):(e=Entry.container.getEntity(c),c=e.getX()-b.getX(),e=e.getY()-b.getY()),a.isStart=!0,a.frameCount=d,a.dX=c/a.frameCount,a.dY=e/a.frameCount; -else return"mouse"==c?(c=Number(e.x),e=Number(e.y)):(e=Entry.container.getEntity(c),c=e.getX(),e=e.getY()),b.setX(c),b.setY(e),b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY()),a.callReturn()}if(0!=a.frameCount)return b.setX(b.getX()+a.dX),b.setY(b.getY()+a.dY),a.frameCount--,b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY()),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.set_location_for_seconds(%1, %2)"]}},rotate_absolute:{color:"#A751E3", -skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},null],type:"rotate_absolute"},paramsKeyMap:{VALUE:0},"class":"rotate_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setRotation(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_rotation(%1)"]}},rotate_relative:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator", -img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},null],type:"rotate_relative"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setRotation(d+b.getRotation());return a.callReturn()},syntax:{js:[],py:["Entry.add_rotation(%1)"]}},direction_absolute:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"}, -null],type:"direction_absolute"},paramsKeyMap:{VALUE:0},"class":"rotate_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_direction(%1)"]}},direction_relative:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},null],type:"direction_relative"},paramsKeyMap:{VALUE:0},"class":"rotate", -isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d+b.getDirection());return a.callReturn()},syntax:{js:[],py:["Entry.add_direction(%1)"]}},move_to_angle:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},{type:"number",params:["10"]},null],type:"move_to_angle"},paramsKeyMap:{ANGLE:0,VALUE:1},"class":"move_rotate", -isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a),c=a.getNumberValue("ANGLE",a);b.setX(b.getX()+d*Math.cos((c-90)/180*Math.PI));b.setY(b.getY()-d*Math.sin((c-90)/180*Math.PI));b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move_degree(%1, %2)"]}},rotate_by_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png", -size:12}],events:{},def:{params:[{type:"number",params:["2"]},{type:"angle"},null],type:"rotate_by_time"},paramsKeyMap:{VALUE:0,ANGLE:1},"class":"rotate",isNotFor:[],func:function(b,a){function d(){b.setRotation(b.getRotation()+a.dAngle);a.frameCount--}if(!a.isStart){var c;c=a.getNumberValue("VALUE",a);var e=a.getNumberValue("ANGLE",a);a.isStart=!0;a.frameCount=Math.max(Math.floor(c*Entry.FPS),1);a.dAngle=e/a.frameCount;1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount; -return a.callReturn()},syntax:{js:[],py:["Entry.add_rotation_for_seconds(%1, %2)"]}},direction_relative_duration:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"text",params:["2"]},{type:"angle"},null],type:"direction_relative_duration"},paramsKeyMap:{DURATION:0,AMOUNT:1},"class":"rotate",isNotFor:[],func:function(b,a){function d(){b.setDirection(b.getDirection()+ -a.dDirection);a.frameCount--}if(!a.isStart){var c;c=a.getNumberValue("DURATION",a);var e=a.getNumberValue("AMOUNT",a);a.isStart=!0;a.frameCount=Math.max(Math.floor(c*Entry.FPS),1);a.dDirection=e/a.frameCount;1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;delete a.dDirection;return a.callReturn()},syntax:{js:[],py:["Entry.add_direction_for_seconds(%1, %2)"]}},neobot_sensor_value:{color:"#00979D",skeleton:"basic_string_field",fontColor:"#fff",statements:[], -template:"%1 \uac12",params:[{type:"Dropdown",options:[["1\ubc88 \ud3ec\ud2b8","IN1"],["2\ubc88 \ud3ec\ud2b8","IN2"],["3\ubc88 \ud3ec\ud2b8","IN3"],["\ub9ac\ubaa8\ucee8","IR"],["\ubc30\ud130\ub9ac","BAT"]],value:"IN1",fontSize:11}],events:{},def:{params:[null],type:"neobot_sensor_value"},paramsKeyMap:{PORT:0},"class":"neobot_value",isNotFor:["neobot"],func:function(b,a){var d=a.getStringField("PORT");return Entry.hw.portData[d]},syntax:{js:[],py:["Neobot.sensor_value(%1)"]}},neobot_sensor_convert_scale:{color:"#00979D", -skeleton:"basic_string_field",fontColor:"#fff",statements:[],template:"%1 \uac12\uc758 \ubc94\uc704\ub97c %2 ~ %3 \uc5d0\uc11c %4 ~ %5 (\uc73c)\ub85c \ubcc0\ud658",params:[{type:"Dropdown",options:[["1\ubc88 \ud3ec\ud2b8","IN1"],["2\ubc88 \ud3ec\ud2b8","IN2"],["3\ubc88 \ud3ec\ud2b8","IN3"],["\ub9ac\ubaa8\ucee8","IR"],["\ubc30\ud130\ub9ac","BAT"]],value:"IN1",fontSize:11},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"}],events:{}, -def:{params:[null,{type:"number",params:["0"]},{type:"number",params:["255"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"neobot_sensor_convert_scale"},paramsKeyMap:{PORT:0,OMIN:1,OMAX:2,MIN:3,MAX:4},"class":"neobot_value",isNotFor:["neobot"],func:function(b,a){var d=a.getStringField("PORT"),d=Entry.hw.portData[d],c=a.getNumberValue("OMIN",a),e=a.getNumberValue("OMAX",a),f=a.getNumberValue("MIN",a),g=a.getNumberValue("MAX",a);if(c>e)var h=c,c=e,e=h;f>g&&(h=f,f=g,g=h);d=(g-f)/ -(e-c)*(d-c);d+=f;d=Math.min(g,d);d=Math.max(f,d);return Math.round(d)}},neobot_left_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc67c\ucabd \ubaa8\ud130\ub97c %1 %2 \uc758 \uc18d\ub3c4\ub85c \ud68c\uc804 %3",params:[{type:"Dropdown",options:[["\uc55e\uc73c\ub85c","16"],["\ub4a4\ub85c","32"]],value:"16",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"], -["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],value:"0",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,"15",null],type:"neobot_left_motor"},paramsKeyMap:{DIRECTION:0,SPEED:1},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){var d=a.getNumberField("SPEED"),c=a.getNumberField("DIRECTION");Entry.hw.sendQueue.DCL=d+c;return a.callReturn()},syntax:{js:[],py:["Neobot.turn_left(%1, %2)"]}}, -neobot_stop_left_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc67c\ucabd \ubaa8\ud130\ub97c \uc815\uc9c0 %1",params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"neobot_stop_left_motor"},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){Entry.hw.sendQueue.DCL=0;return a.callReturn()},syntax:{js:[],py:["Neobot.stop_left()"]}},neobot_right_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc624\ub978\ucabd \ubaa8\ud130\ub97c %1 %2 \uc758 \uc18d\ub3c4\ub85c \ud68c\uc804 %3", +"3"],["Y","4"],["Z","5"]],value:"3",fontSize:11}],events:{},def:{params:[null],type:"CODEino_get_accelerometer_value"},paramsKeyMap:{PORT:0},"class":"CODEino_sensor",isNotFor:["CODEino"],func:function(b,a){var d=a.getNumberField("PORT",a),c=Entry.ArduinoExt.getSensorTime(Entry.ArduinoExt.sensorTypes.ANALOG),e=Entry.hw.portData.TIME||0,f=a.executor.scope,g=Entry.hw.portData.ANALOG,h=0;if(f.isStart){if(e&&e===f.stamp)return delete f.isStart,delete f.stamp,h=g[d],h=Math.min(90,1.46*(h-333)),h=Math.max(-90, +h),Math.round(h);if(64e)var h= +c,c=e,e=h;f>g&&(h=f,f=g,g=h);d-=c;d*=(g-f)/(e-c);d+=f;d=Math.min(g,d);d=Math.max(f,d);return Math.round(d)}},CODEino_set_rgb_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[["\ube68\uac15","17"],["\ucd08\ub85d","18"],["\ud30c\ub791","19"]],value:"17",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{type:"CODEino_set_rgb_value"},paramsKeyMap:{PORT:0,VALUE:1},"class":"CODEino_RGBLED_mode", +isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getNumberField("PORT",a),e=a.getNumberValue("VALUE",a),e=Math.min(255,e),e=Math.max(0,e);17==c?CODEINO_RED=e:18==c?CODEINO_GREEN=e:CODEINO_BLUE=e;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:e};return a.callReturn()}},CODEino_set_rgb_add_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[["\ube68\uac15","17"],["\ucd08\ub85d", +"18"],["\ud30c\ub791","19"]],value:"17",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{type:"CODEino_set_rgb_add_value"},paramsKeyMap:{PORT:0,VALUE:1},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getNumberField("PORT",a),e=a.getNumberValue("VALUE",a),e=Math.min(255,e),e=Math.max(0,e);17==c&&(CODEINO_RED+=e,CODEINO_RED=Math.min(255,CODEINO_RED),e=CODEINO_RED=Math.max(0,CODEINO_RED)); +18==c&&(CODEINO_GREEN+=e,CODEINO_GREEN=Math.min(255,CODEINO_GREEN),e=CODEINO_GREEN=Math.max(0,CODEINO_GREEN));19==c&&(CODEINO_BLUE+=e,CODEINO_BLUE=Math.min(255,CODEINO_BLUE),e=CODEINO_BLUE=Math.max(0,CODEINO_BLUE));d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:e};return a.callReturn()}},CODEino_rgb_set_color:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Color"},{type:"Indicator",img:"block_icon/brush_03.png", +size:12}],events:{},def:{params:[null],type:"CODEino_rgb_set_color"},paramsKeyMap:{VALUE:0},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=a.getStringField("VALUE");CODEINO_RED=parseInt(d.substr(1,2),16);CODEINO_GREEN=parseInt(d.substr(3,2),16);CODEINO_BLUE=parseInt(d.substr(5,2),16);var d=Entry.hw.sendQueue,c=17;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_RED};d=Entry.hw.sendQueue;c=18; +d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_GREEN};d=Entry.hw.sendQueue;c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_BLUE};return a.callReturn()}},CODEino_set_rgb_off:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"CODEino_set_rgb_off"}, +"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue;CODEINO_GREEN=CODEINO_BLUE=CODEINO_RED=0;var c=17;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:0};d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:0};d=Entry.hw.sendQueue;c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey(); +d.SET||(d.SET={});d.SET[c]={type:4,data:0};return a.callReturn()}},CODEino_set__led_by_rgb:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["255"]},{type:"text",params:["255"]},{type:"text",params:["255"]},null],type:"CODEino_set__led_by_rgb"},paramsKeyMap:{rValue:0,gValue:1,bValue:2},"class":"CODEino_RGBLED_mode", +isNotFor:["CODEino"],func:function(b,a){CODEINO_RED=a.getNumberValue("rValue");CODEINO_GREEN=a.getNumberValue("gValue");CODEINO_BLUE=a.getNumberValue("bValue");var d=Entry.hw.sendQueue,c=17;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_RED};d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_GREEN};d=Entry.hw.sendQueue; +c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_BLUE};return a.callReturn()}},CODEino_led_by_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"CODEino_led_by_value"},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue,c=17;CODEINO_BLUE=CODEINO_GREEN=CODEINO_RED=100; +d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:100};d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:100};d=Entry.hw.sendQueue;c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:100};return a.callReturn()}},CODEino_get_number_sensor_value:{parent:"arduino_get_number_sensor_value", +isNotFor:["CODEino"],def:{params:[{type:"arduino_get_sensor_number"}],type:"CODEino_get_number_sensor_value"},"class":"arduino_value",syntax:{js:[],py:["hw.CODEino_get_number_sensor_value(%1)"]}},CODEino_toggle_led:{parent:"arduino_toggle_led",isNotFor:["CODEino"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"CODEino_toggle_led"},"class":"arduino_set",syntax:{js:[],py:["hw.CODEino_toggle_led(%1)"]}},CODEino_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["CODEino"],def:{params:[{type:"arduino_get_pwm_port_number"}, +{type:"arduino_text",params:["255"]},null],type:"CODEino_toggle_pwm"},"class":"arduino_set",syntax:{js:[],py:["hw.CODEino_toggle_pwm(%1, %2)"]}},nemoino_get_named_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],template:"%1 \uc13c\uc11c\uac12",params:[{type:"Dropdown",options:[["\uc18c\ub9ac","0"],["\ube5b","1"],["\uc2ac\ub77c\uc774\ub354","2"],["\uc800\ud56d-A","3"],["\uc800\ud56d-B","4"],["\uc800\ud56d-C","5"],["\uc800\ud56d-D","6"]],value:"0",fontSize:11}], +events:{},def:{params:[null],type:"nemoino_get_named_sensor_value"},paramsKeyMap:{PORT:0},"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){return Entry.hw.getAnalogPortValue(a.getField("PORT",a))}},nemoino_get_sound_status:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",statements:[],template:"\uc18c\ub9ac\uc13c\uc11c %1",params:[{type:"Dropdown",options:[["\uc18c\ub9ac\ud07c","GREAT"],["\uc18c\ub9ac\uc791\uc74c","SMALL"]],value:"GREAT",fontSize:11}],events:{},def:{params:[null], +type:"nemoino_get_sound_status"},paramsKeyMap:{STATUS:0},"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){return"GREAT"==a.getField("STATUS",a)?600Entry.hw.getAnalogPortValue(0)?1:0}},nemoino_is_button_pressed:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",statements:[],template:"\ubcf4\ub4dc\uc758 %1",params:[{type:"Dropdown",options:[["\ubc84\ud2bc\ub204\ub984","4"],["A\uc5f0\uacb0\ub428","17"],["B\uc5f0\uacb0\ub428","18"],["C\uc5f0\uacb0\ub428", +"19"],["D\uc5f0\uacb0\ub428","20"]],value:"4",fontSize:11}],events:{},def:{params:[null],type:"nemoino_is_button_pressed"},paramsKeyMap:{PORT:0},"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){var d=a.getNumberField("PORT",a);return 14c?1:0;if("RIGHT"==d||"FRONT"==d)return 30c?1:0}},nemoino_get_accelerometer_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],template:"3\ucd95 \uac00\uc18d\ub3c4\uc13c\uc11c %1 \ucd95\uc758 \uc13c\uc11c\uac12",params:[{type:"Dropdown",options:[["X","3"],["Y","4"],["Z","5"]], +value:"3",fontSize:11}],events:{},def:{params:[null],type:"nemoino_get_accelerometer_value"},paramsKeyMap:{PORT:0},"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){var d=265,c=402,e=-90,f=90,g=Entry.hw.getAnalogPortValue(a.getField("PORT",a));if(d>c)var h=d,d=c,c=h;e>f&&(h=e,e=f,f=h);g=(f-e)/(c-d)*(g-d);g+=e;g=Math.min(f,g);g=Math.max(e,g);return Math.round(g)}},bitbrick_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"DropdownDynamic", +value:null,fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW,menuName:Entry.Bitbrick.sensorList}],events:{},def:{params:[null],type:"bitbrick_sensor_value"},paramsKeyMap:{PORT:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getStringField("PORT");return Entry.hw.portData[d].value},syntax:{js:[],py:["Bitbrick.sensor_value(%1)"]}},bitbrick_is_touch_pressed:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",statements:[],params:[{type:"DropdownDynamic",value:null, +fontSize:11,menuName:Entry.Bitbrick.touchList}],events:{},def:{params:[null],type:"bitbrick_is_touch_pressed"},paramsKeyMap:{PORT:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){return 0===Entry.hw.portData[a.getStringField("PORT")].value},syntax:{js:[],py:["Bitbrick.is_touch_pressed(%1)"]}},bitbrick_turn_off_color_led:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"bitbrick_turn_off_color_led", +id:"i3je"},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){Entry.hw.sendQueue.LEDR=0;Entry.hw.sendQueue.LEDG=0;Entry.hw.sendQueue.LEDB=0;return a.callReturn()},syntax:{js:[],py:["Bitbrick.turn_off_color_led()"]}},bitbrick_turn_on_color_led_by_rgb:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text", +params:["255"]},{type:"text",params:["255"]},{type:"text",params:["255"]},null],type:"bitbrick_turn_on_color_led_by_rgb"},paramsKeyMap:{rValue:0,gValue:1,bValue:2},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getNumberValue("rValue"),c=a.getNumberValue("gValue"),e=a.getNumberValue("bValue"),f=Entry.adjustValueWithMaxMin,g=Entry.hw.sendQueue;g.LEDR=f(d,0,255);g.LEDG=f(c,0,255);g.LEDB=f(e,0,255);return a.callReturn()},syntax:{js:[],py:["Bitbrick.color_led_by_rgb(%1, %2, %3)"]}}, +bitbrick_turn_on_color_led_by_picker:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Color"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"bitbrick_turn_on_color_led_by_picker"},paramsKeyMap:{VALUE:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getStringField("VALUE");Entry.hw.sendQueue.LEDR=parseInt(d.substr(1,2),16);Entry.hw.sendQueue.LEDG=parseInt(d.substr(3,2),16);Entry.hw.sendQueue.LEDB=parseInt(d.substr(5, +2),16);return a.callReturn()},syntax:{js:[],py:["Bitbrick.color_led_by_picker(%1)"]}},bitbrick_turn_on_color_led_by_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["0"]},null],type:"bitbrick_turn_on_color_led_by_value"},paramsKeyMap:{VALUE:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getNumberValue("VALUE"),c,e,f,d=d%200;67> +d?(c=200-3*d,e=3*d,f=0):134>d?(d-=67,c=0,e=200-3*d,f=3*d):201>d&&(d-=134,c=3*d,e=0,f=200-3*d);Entry.hw.sendQueue.LEDR=c;Entry.hw.sendQueue.LEDG=e;Entry.hw.sendQueue.LEDB=f;return a.callReturn()},syntax:{js:[],py:["Bitbrick.color_led_by_value(%1)"]}},bitbrick_buzzer:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["60"]},null],type:"bitbrick_buzzer"},paramsKeyMap:{VALUE:0}, +"class":"condition",isNotFor:["bitbrick"],func:function(b,a){if(a.isStart)return Entry.hw.sendQueue.buzzer=0,delete a.isStart,a.callReturn();var d=a.getNumberValue("VALUE");Entry.hw.sendQueue.buzzer=d;a.isStart=!0;return a},syntax:{js:[],py:["Bitbrick.buzzer(%1)"]}},bitbrick_turn_off_all_motors:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"bitbrick_turn_off_all_motors"},"class":"condition",isNotFor:["bitbrick"], +func:function(b,a){var d=Entry.hw.sendQueue,c=Entry.Bitbrick;c.servoList().map(function(a){d[a[1]]=0});c.dcList().map(function(a){d[a[1]]=128});return a.callReturn()},syntax:{js:[],py:["Bitbrick.turn_off_all_motors()"]}},bitbrick_dc_speed:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.dcList},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text", +params:["60"]},null],type:"bitbrick_dc_speed"},paramsKeyMap:{PORT:0,VALUE:1},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getNumberValue("VALUE"),d=Math.min(d,Entry.Bitbrick.dcMaxValue),d=Math.max(d,Entry.Bitbrick.dcMinValue);Entry.hw.sendQueue[a.getStringField("PORT")]=d+128;return a.callReturn()},syntax:{js:[],py:["Bitbrick.dc_speed(%1, %2)"]}},bitbrick_dc_direction_speed:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11, +menuName:Entry.Bitbrick.dcList},{type:"Dropdown",options:[[Lang.Blocks.BITBRICK_dc_direction_cw,"CW"],[Lang.Blocks.BITBRICK_dc_direction_ccw,"CCW"]],value:"CW",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,{type:"text",params:["100"]},null],type:"bitbrick_dc_direction_speed"},paramsKeyMap:{PORT:0,DIRECTION:1,VALUE:2},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d="CW"===a.getStringField("DIRECTION"), +c=a.getNumberValue("VALUE"),c=Math.min(c,Entry.Bitbrick.dcMaxValue),c=Math.max(c,0);Entry.hw.sendQueue[a.getStringField("PORT")]=d?c+128:128-c;return a.callReturn()},syntax:{js:[],py:["Bitbrick.dc_direction_speed(%1, %2, %3)"]}},bitbrick_servomotor_angle:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.servoList},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null, +{type:"text",params:["100"]},null],type:"bitbrick_servomotor_angle"},paramsKeyMap:{PORT:0,VALUE:1},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=Entry.Bitbrick.servoMaxValue-(a.getNumberValue("VALUE")+1),d=Math.min(d,Entry.Bitbrick.servoMaxValue),d=Math.max(d,Entry.Bitbrick.servoMinValue);Entry.hw.sendQueue[a.getStringField("PORT")]=d;return a.callReturn()},syntax:{js:[],py:["Bitbrick.servomotor_angle(%1, %2)"]}},bitbrick_convert_scale:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field", +statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.sensorList},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"}],events:{},def:{params:[null,{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["-100"]},{type:"number",params:["100"]}],type:"bitbrick_convert_scale"},paramsKeyMap:{PORT:0,VALUE2:1,VALUE3:2,VALUE4:3,VALUE5:4},"class":"condition",isNotFor:["bitbrick"], +func:function(b,a){var d=a.getNumberField("PORT"),c=Entry.hw.portData[d].value,d=a.getNumberValue("VALUE2",a),e=a.getNumberValue("VALUE3",a),f=a.getNumberValue("VALUE4",a),g=a.getNumberValue("VALUE5",a);if(f>g)var h=f,f=g,g=h;c-=d;c*=(g-f)/(e-d);c+=f;c=Math.min(g,c);c=Math.max(f,c);return Math.round(c)},syntax:{js:[],py:["Bitbrick.convert_scale(%1, %2, %3, %4, %5)"]}},cobl_read_ultrason:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"1. \ucd08\uc74c\ud30c\uac70\ub9ac(0~400)", +def:{type:"cobl_read_ultrason"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("ultrason")}},cobl_read_potenmeter:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"2.\uac00\ubcc0\uc800\ud56d(0~1023)",def:{type:"cobl_read_potenmeter"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("potenmeter")}},cobl_read_irread1:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"3.\uc801\uc678\uc120\uc13c\uc11c1(0~1023)", +def:{type:"cobl_read_irread1"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("irread1")}},cobl_read_irread2:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"4.\uc801\uc678\uc120\uc13c\uc11c2(0~1023)",def:{type:"cobl_read_irread2"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("irread2")}},cobl_read_joyx:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"5.\uc870\uc774\uc2a4\ud2f1X\ucd95(1, 0, -1)", +def:{type:"cobl_read_joyx"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("joyx")}},cobl_read_joyy:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"6.\uc870\uc774\uc2a4\ud2f1Y\ucd95(1, 0, -1)",def:{type:"cobl_read_joyy"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("joyy")}},cobl_read_tilt:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"7.\uae30\uc6b8\uae30\uc13c\uc11c(0~4)", +def:{type:"cobl_read_tilt"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("tilt")}},cobl_read_temps:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"8.\uc628\ub3c4\uc13c\uc11c@\ud3ec\ud2b8%1",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11}],def:{params:["1"],type:"cobl_read_temps"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getValue("VALUE",a);if(1==d)return Entry.hw.getAnalogPortValue("temps1"); +if(2==d)return Entry.hw.getAnalogPortValue("temps2")}},cobl_read_light:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"9.\ube5b\uc13c\uc11c@\ud3ec\ud2b8%1",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11}],def:{params:["1"],type:"cobl_read_light"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getValue("VALUE",a);if(1==d)return Entry.hw.getAnalogPortValue("light1");if(2==d)return Entry.hw.getAnalogPortValue("light2")}}, +cobl_read_btn:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",template:"10.\ubc84\ud2bc\uc2a4\uc704\uce58@\ud3ec\ud2b8%1",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11}],def:{params:["1"],type:"cobl_read_btn"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getValue("VALUE",a);if(1==d)return Entry.hw.getDigitalPortValue("btn1");if(2==d)return Entry.hw.getDigitalPortValue("btn2")}},cobl_led_control:{color:"#00979D",fontColor:"#fff", +skeleton:"basic",template:"11.\ubb34\uc9c0\uac1cLED%1%2 %3",params:[{type:"Dropdown",options:[["1","1"],["2","2"],["3","3"]],fontSize:11},{type:"Dropdown",options:[["OFF","OFF"],["\ube68\uac15","Red"],["\uc8fc\ud669","Orange"],["\ub178\ub791","Yellow"],["\ucd08\ub85d","Green"],["\ud30c\ub791","Blue"],["\ub0a8\uc0c9","Dark Blue"],["\ubcf4\ub77c","Purple"],["\ud770\uc0c9","White"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","OFF"],type:"cobl_led_control"}, +paramsKeyMap:{PORT:0,OPERATOR:1},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("PORT"),c=a.getStringField("OPERATOR");Entry.hw.setDigitalPortValue("RainBowLED_"+d,c);Entry.hw.update();delete Entry.hw.sendQueue["RainBowLED_"+d];return a.callReturn()}},cobl_servo_angle_control:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"12.\uac01\ub3c4\ubaa8\ud130 \uac01\ub3c4%1(15~165) %2",params:[{type:"TextInput",value:0},{type:"Indicator",img:"block_icon/hardware_03.png", +size:12}],def:{type:"cobl_servo_angle_control"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getNumberField("VALUE"),d=Math.round(d),d=Math.max(d,15),d=Math.min(d,165);Entry.hw.setDigitalPortValue("Servo1",d);Entry.hw.update();delete Entry.hw.sendQueue.Servo1;return a.callReturn()}},cobl_melody:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"13.\uba5c\ub85c\ub514%1 ,%2",params:[{type:"Dropdown",options:[["((\ub0ae\uc740)\uc194","L_So"],["(\ub0ae\uc740)\uc194#", +"L_So#"],["(\ub0ae\uc740)\ub77c","L_La"],["(\ub0ae\uc740)\ub77c#","L_La#"],["(\ub0ae\uc740)\uc2dc","L_Ti"],["\ub3c4","Do"],["\ub3c4#","Do#"],["\ub808","Re"],["\ub808#","Re#"],["\ubbf8","Mi"],["\ud30c","Fa"],["\ud30c#","Fa#"],["\uc194","So"],["\uc194#","So#"],["\ub77c","La"],["\ub77c#","La#"],["\uc2dc","Ti"],["(\ub192\uc740)\ub3c4","H_Do"],["(\ub192\uc740)\ub3c4#","H_Do#"],["(\ub192\uc740)\ub808","H_Re"],["(\ub192\uc740)\ub808#","H_Re#"],["(\ub192\uc740)\ubbf8#","H_Mi"],["(\ub192\uc740)\ud30c","H_Fa"]], +fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["Do"],type:"cobl_melody"},paramsKeyMap:{MELODY:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("MELODY");Entry.hw.setDigitalPortValue("Melody",d);Entry.hw.update();delete Entry.hw.sendQueue.Melody;return a.callReturn()}},cobl_dcmotor:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"14.\ud68c\uc804\ubaa8\ud130%1%2\uc18d\ub3c4%3 %4",params:[{type:"Dropdown",options:[["1","1"], +["2","2"]],fontSize:11},{type:"Dropdown",options:[["1.\uc2dc\uacc4\ubc29\ud5a5","1"],["2.\ubc18\uc2dc\uacc4\ubc29\ud5a5","2"],["3.\uc815\uc9c0","3"]],fontSize:11},{type:"Dropdown",options:[["1","1"],["2","2"],["3","3"],["4","4"],["5","5"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","1","1"],type:"cobl_dcmotor"},paramsKeyMap:{MOTOR:0,DIRECTION:1,SPEED:2},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("MOTOR"),c=a.getStringField("DIRECTION"), +e=a.getStringField("SPEED");1==d&&(Entry.hw.setDigitalPortValue("DC1_DIR",c),Entry.hw.setDigitalPortValue("DC1_SPEED",e),Entry.hw.update(),delete Entry.hw.sendQueue.DC1_DIR,delete Entry.hw.sendQueue.DC1_SPEED);2==d&&(Entry.hw.setDigitalPortValue("DC2_DIR",c),Entry.hw.setDigitalPortValue("DC2_SPEED",e),Entry.hw.update(),delete Entry.hw.sendQueue.DC2_DIR,delete Entry.hw.sendQueue.DC2_SPEED);return a.callReturn()}},cobl_extention_port:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"15.USB\ud3ec\ud2b8%1\ub2e8\uacc4%2 %3", +params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","0"],type:"cobl_extention_port"},paramsKeyMap:{PORT:0,LEVEL:1},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("PORT"),c=a.getStringField("LEVEL");1==d&&(Entry.hw.setDigitalPortValue("EXUSB1",c),Entry.hw.update(),delete Entry.hw.sendQueue.EXUSB1); +2==d&&(Entry.hw.setDigitalPortValue("EXUSB2",c),Entry.hw.update(),delete Entry.hw.sendQueue.EXUSB2);return a.callReturn()}},cobl_external_led:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"16.\uc678\ubd80LED%1(1~64)R%2G%3B%4 %5",params:[{type:"TextInput",value:0,fontSize:11},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]],fontSize:11},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3", +"3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]],fontSize:11},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","1","1","1"],type:"cobl_external_led"},paramsKeyMap:{LED:0,RED:1,GREEN:2,BLUE:3},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getNumberField("LED"),c=a.getStringField("RED"), +e=a.getStringField("GREEN"),f=a.getStringField("BLUE");Entry.hw.setDigitalPortValue("ELED_IDX",d);Entry.hw.setDigitalPortValue("ELED_R",c);Entry.hw.setDigitalPortValue("ELED_G",e);Entry.hw.setDigitalPortValue("ELED_B",f);Entry.hw.update();delete Entry.hw.sendQueue.ELED_IDX;delete Entry.hw.sendQueue.ELED_R;delete Entry.hw.sendQueue.ELED_G;delete Entry.hw.sendQueue.ELED_B;return a.callReturn()}},cobl_7_segment:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"17.\uc22b\uc790\uc804\uad11\ud310%1(0~9999) %2", +params:[{type:"TextInput",value:0},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{type:"cobl_7_segment"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getNumberField("VALUE");Entry.hw.setDigitalPortValue("7SEG",d);Entry.hw.update();delete Entry.hw.sendQueue["7SEG"];return a.callReturn()}},start_drawing:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null], +type:"start_drawing"},"class":"brush_control",isNotFor:["textBox"],func:function(b,a){b.brush?b.brush.stop=!1:Entry.setBasicBrush(b);Entry.stage.sortZorder();b.brush.moveTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.start_drawing()"]}},stop_drawing:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"stop_drawing"},"class":"brush_control",isNotFor:["textBox"],func:function(b, +a){b.brush&&b.shape&&(b.brush.stop=!0);return a.callReturn()},syntax:{js:[],py:["Entry.stop_drawing()"]}},set_color:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Color"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"set_color"},paramsKeyMap:{VALUE:0},"class":"brush_color",isNotFor:["textBox"],func:function(b,a){var d=a.getField("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(d=Entry.hex2rgb(d),b.brush.rgb=d,b.brush.endStroke(), +b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.set_brush_color(%1)"]}},set_random_color:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"set_random_color"},"class":"brush_color",isNotFor:["textBox"],func:function(b,a){b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);if(b.brush){var d= +Entry.generateRgb();b.brush.rgb=d;b.brush.endStroke();b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")");b.brush.moveTo(b.getX(),-1*b.getY())}return a.callReturn()},syntax:{js:[],py:["Entry.set_brush_color_random()"]}},change_thickness:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["1"]},null],type:"change_thickness"},paramsKeyMap:{VALUE:0}, +"class":"brush_thickness",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(b.brush.thickness+=d,1>b.brush.thickness&&(b.brush.thickness=1),b.brush.setStrokeStyle(b.brush.thickness),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.add_brush_size(%1)"]}},set_thickness:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png", +size:12}],events:{},def:{params:[{type:"number",params:["1"]},null],type:"set_thickness"},paramsKeyMap:{VALUE:0},"class":"brush_thickness",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(b.brush.thickness=d,b.brush.setStrokeStyle(b.brush.thickness),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.set_brush_size(%1)"]}},change_opacity:{color:"#FF9E20",skeleton:"basic",statements:[], +params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"change_opacity"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);d=Entry.adjustValueWithMaxMin(b.brush.opacity+d,0,100);b.brush&&(b.brush.opacity=d,b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+d.r+","+ +d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:[""]}},set_opacity:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["50"]},null],type:"set_opacity"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b), +b.brush.stop=!0);b.brush&&(b.brush.opacity=Entry.adjustValueWithMaxMin(d,0,100),b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:[""]}},brush_erase_all:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"brush_erase_all"},"class":"brush_clear",isNotFor:["textBox"], +func:function(b,a){var d=b.brush;if(d){var c=d._stroke.style,e=d._strokeStyle.width;d.clear().setStrokeStyle(e).beginStroke(c);d.moveTo(b.getX(),-1*b.getY())}d=b.parent.getStampEntities();d.map(function(a){a.removeClone()});d=null;return a.callReturn()},syntax:{js:[],py:["Entry.clear_drawing()"]}},brush_stamp:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"brush_stamp"},"class":"stamp",isNotFor:["textBox"], +func:function(b,a){b.parent.addStampEntity(b);return a.callReturn()},syntax:{js:[],py:["Entry.stamp()"]}},change_brush_transparency:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"change_brush_transparency"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b), +b.brush.stop=!0);d=Entry.adjustValueWithMaxMin(b.brush.opacity-d,0,100);b.brush&&(b.brush.opacity=d,b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.add_brush_transparency(%1)"]}},set_brush_tranparency:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{}, +def:{params:[{type:"number",params:["50"]},null],type:"set_brush_tranparency"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(b.brush.opacity=Entry.adjustValueWithMaxMin(d,0,100),b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+(1-b.brush.opacity/100)+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[], +py:["Entry.set_brush_transparency(%1)"]}},number:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"TextInput",value:10}],events:{},def:{params:[]},paramsKeyMap:{NUM:0},func:function(b,a){return a.getField("NUM",a)},isPrimitive:!0,syntax:{js:["Scope","%1"],py:["%1number#"]}},angle:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Angle"}],events:{},def:{params:[null],type:"angle"},paramsKeyMap:{ANGLE:0},func:function(b,a){return a.getNumberField("ANGLE")}, +syntax:{js:[],py:["%1angle#"]}},get_x_coordinate:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_x_coordinate,color:"#3D3D3D"}],events:{},def:{params:[null],type:"get_x_coordinate"},"class":"calc",isNotFor:[],func:function(b,a){return b.getX()},syntax:{js:[],py:[""]}},get_y_coordinate:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_y_coordinate,color:"#3D3D3D"}],events:{},def:{params:[null], +type:"get_y_coordinate"},"class":"calc",isNotFor:[],func:function(b,a){return b.getY()},syntax:{js:[],py:[""]}},get_angle:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_angle,color:"#3D3D3D"}],events:{},def:{params:[null]},func:function(b,a){return parseFloat(b.getRotation().toFixed(1))},syntax:{js:[],py:[""]}},get_rotation_direction:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.CALC_rotation_value, +"ROTATION"],[Lang.Blocks.CALC_direction_value,"DIRECTION"]],value:"ROTATION",fontSize:11}],events:{},def:{params:[null],type:"get_rotation_direction"},paramsKeyMap:{OPERATOR:0},"class":"calc",isNotFor:[],func:function(b,a){return"DIRECTION"==a.getField("OPERATOR",a).toUpperCase()?parseFloat(b.getDirection().toFixed(1)):parseFloat(b.getRotation().toFixed(1))},syntax:{js:[],py:[""]}},distance_something:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_distance_something_1, +color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_distance_something_2,color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"distance_something"},paramsKeyMap:{VALUE:1},"class":"calc_distance",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a);if("mouse"==d)return d=Entry.stage.mouseCoordinate,Math.sqrt(Math.pow(b.getX()-d.x,2)+Math.pow(b.getY()-d.y,2));d=Entry.container.getEntity(d); +return Math.sqrt(Math.pow(b.getX()-d.getX(),2)+Math.pow(b.getY()-d.getY(),2))},syntax:{js:[],py:["Entry.value_of_distance(%2)"]}},coordinate_mouse:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_coordinate_mouse_1,color:"#3D3D3D"},{type:"Dropdown",options:[["x","x"],["y","y"]],value:"x",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_coordinate_mouse_2,color:"#3D3D3D"}],events:{},def:{params:[null,null, +null],type:"coordinate_mouse"},paramsKeyMap:{VALUE:1},"class":"calc",isNotFor:[],func:function(b,a){return"x"===a.getField("VALUE",a)?Number(Entry.stage.mouseCoordinate.x):Number(Entry.stage.mouseCoordinate.y)},syntax:{js:[],py:["Entry.coordinate_of_mouse(%2)"]}},coordinate_object:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_coordinate_object_1,color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"spritesWithSelf",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC}, +{type:"Text",text:Lang.Blocks.CALC_coordinate_object_2,color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_coordinate_x_value,"x"],[Lang.Blocks.CALC_coordinate_y_value,"y"],[Lang.Blocks.CALC_coordinate_rotation_value,"rotation"],[Lang.Blocks.CALC_coordinate_direction_value,"direction"],[Lang.Blocks.CALC_coordinate_size_value,"size"],[Lang.Blocks.CALC_picture_index,"picture_index"],[Lang.Blocks.CALC_picture_name,"picture_name"]],value:"x",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC}], +events:{},def:{params:[null,null,null,null],type:"coordinate_object"},paramsKeyMap:{VALUE:1,COORDINATE:3},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),d="self"==d?b:Entry.container.getEntity(d);switch(a.getField("COORDINATE",a)){case "x":return d.getX();case "y":return d.getY();case "rotation":return d.getRotation();case "direction":return d.getDirection();case "picture_index":var c=d.parent,c=c.pictures;return c.indexOf(d.picture)+1;case "size":return Number(d.getSize().toFixed(1)); +case "picture_name":return c=d.parent,c=c.pictures,c[c.indexOf(d.picture)].name}},syntax:{js:[],py:["Entry.value_of(%2, %4)"]}},calc_basic:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[["+","PLUS"],["-","MINUS"],["x","MULTI"],["/","DIVIDE"]],value:"PLUS",fontSize:11,noArrow:!0},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"number",params:["10"]},"PLUS",{type:"number",params:["10"]}],type:"calc_basic"}, +defs:[{params:[{type:"number",params:["10"]},"PLUS",{type:"number",params:["10"]}],type:"calc_basic"},{params:[{type:"number",params:["10"]},"MINUS",{type:"number",params:["10"]}],type:"calc_basic"},{params:[{type:"number",params:["10"]},"MULTI",{type:"number",params:["10"]}],type:"calc_basic"},{params:[{type:"number",params:["10"]},"DIVIDE",{type:"number",params:["10"]}],type:"calc_basic"}],paramsKeyMap:{LEFTHAND:0,OPERATOR:1,RIGHTHAND:2},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getField("OPERATOR", +a),c=a.getNumberValue("LEFTHAND",a),e=a.getNumberValue("RIGHTHAND",a);return"PLUS"==d?c+e:"MINUS"==d?c-e:"MULTI"==d?c*e:c/e},syntax:{js:[],py:["(%1 %2calc_basic# %3)"]}},calc_plus:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"+",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND", +a);return d+c},syntax:{js:[],py:[""]}},calc_minus:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"-",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d-c},syntax:{js:[],py:[""]}},calc_times:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block", +accept:"string"},{type:"Text",text:"x",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d*c},syntax:{js:[],py:[""]}},calc_divide:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"/",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0, +RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d/c},syntax:{js:[],py:[""]}},calc_mod:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"/",color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_mod_3,color:"#3D3D3D"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]},null],type:"calc_mod"},paramsKeyMap:{LEFTHAND:0, +RIGHTHAND:2},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d%c},syntax:{js:[],py:["Entry.get_remainder(%1, %3)"]}},calc_share:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"/",color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:"\uc758 \ubaab",color:"#3D3D3D"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]}, +null],type:"calc_share"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return Math.floor(d/c)},syntax:{js:[],py:[""]}},calc_operation:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_calc_operation_of_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_operation_of_2,color:"#3D3D3D"},{type:"Dropdown", +options:[[Lang.Blocks.CALC_calc_operation_square,"square"],[Lang.Blocks.CALC_calc_operation_root,"root"],[Lang.Blocks.CALC_calc_operation_sin,"sin"],[Lang.Blocks.CALC_calc_operation_cos,"cos"],[Lang.Blocks.CALC_calc_operation_tan,"tan"],[Lang.Blocks.CALC_calc_operation_asin,"asin_radian"],[Lang.Blocks.CALC_calc_operation_acos,"acos_radian"],[Lang.Blocks.CALC_calc_operation_atan,"atan_radian"],[Lang.Blocks.CALC_calc_operation_log,"log"],[Lang.Blocks.CALC_calc_operation_ln,"ln"],[Lang.Blocks.CALC_calc_operation_unnatural, +"unnatural"],[Lang.Blocks.CALC_calc_operation_floor,"floor"],[Lang.Blocks.CALC_calc_operation_ceil,"ceil"],[Lang.Blocks.CALC_calc_operation_round,"round"],[Lang.Blocks.CALC_calc_operation_factorial,"factorial"],[Lang.Blocks.CALC_calc_operation_abs,"abs"]],value:"square",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC}],events:{},def:{params:[null,{type:"number",params:["10"]},null,null],type:"calc_operation"},paramsKeyMap:{LEFTHAND:1,VALUE:3},"class":"calc",isNotFor:[],func:function(b,a){var d= +a.getNumberValue("LEFTHAND",a),c=a.getField("VALUE",a);if(-1<["asin_radian","acos_radian"].indexOf(c)&&(1d))throw Error("x range exceeded");c.indexOf("_")&&(c=c.split("_")[0]);-1<["sin","cos","tan"].indexOf(c)&&(d=Entry.toRadian(d));var e=0;switch(c){case "square":e=d*d;break;case "factorial":e=Entry.factorial(d);break;case "root":e=Math.sqrt(d);break;case "log":e=Math.log(d)/Math.LN10;break;case "ln":e=Math.log(d);break;case "asin":case "acos":case "atan":e=Entry.toDegrees(Math[c](d));break; +case "unnatural":e=d-Math.floor(d);0>d&&(e=1-e);break;default:e=Math[c](d)}return e},syntax:{js:[],py:["Entry.value_of_math_operation(%2, %4)"]}},calc_rand:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_calc_rand_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_rand_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_rand_3,color:"#3D3D3D"}],events:{},def:{params:[null, +{type:"number",params:["0"]},null,{type:"number",params:["10"]},null],type:"calc_rand"},paramsKeyMap:{LEFTHAND:1,RIGHTHAND:3},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getStringValue("LEFTHAND",a),c=a.getStringValue("RIGHTHAND",a),e=Math.min(d,c),f=Math.max(d,c),d=Entry.isFloat(d);return Entry.isFloat(c)||d?(Math.random()*(f-e)+e).toFixed(2):Math.floor(Math.random()*(f-e+1)+e)},syntax:{js:[],py:["random.randint(%2, %4)"]}},get_date:{color:"#FFD974",skeleton:"basic_string_field",statements:[], +params:[{type:"Text",text:Lang.Blocks.CALC_get_date_1,color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_get_date_year,"YEAR"],[Lang.Blocks.CALC_get_date_month,"MONTH"],[Lang.Blocks.CALC_get_date_day,"DAY"],[Lang.Blocks.CALC_get_date_hour,"HOUR"],[Lang.Blocks.CALC_get_date_minute,"MINUTE"],[Lang.Blocks.CALC_get_date_second,"SECOND"]],value:"YEAR",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_get_date_2,color:"#3D3D3D"}],events:{},def:{params:[null, +"YEAR",null],type:"get_date"},paramsKeyMap:{VALUE:1},"class":"calc_date",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c=new Date;return"YEAR"==d?c.getFullYear():"MONTH"==d?c.getMonth()+1:"DAY"==d?c.getDate():"HOUR"==d?c.getHours():"MINUTE"==d?c.getMinutes():c.getSeconds()},syntax:{js:[],py:["Entry.value_of_date_time(%2)"]}},get_sound_duration:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_sound_duration_1,color:"#3D3D3D"}, +{type:"DropdownDynamic",value:null,menuName:"sounds",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_get_sound_duration_2,color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"get_sound_duration"},paramsKeyMap:{VALUE:1},"class":"calc_duration",isNotFor:[],func:function(b,a){for(var d=a.getField("VALUE",a),c=b.parent.sounds,e=0;ec||c>d.length-1)throw Error();return d[c]},syntax:{js:[],py:["Entry.string_index_of(%2, %4)"]}},length_of_string:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text", +text:Lang.Blocks.CALC_length_of_string_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_length_of_string_2,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.entry]},null],type:"length_of_string"},paramsKeyMap:{STRING:1},"class":"calc_string",isNotFor:[],func:function(b,a){return a.getStringValue("STRING",a).length},syntax:{js:[],py:["Entry.string_length(%2)"]}},substring:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text", +text:Lang.Blocks.CALC_substring_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_substring_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_substring_3,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_substring_4,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.hi_entry]},null,{type:"number",params:["2"]},null,{type:"number",params:["5"]},null],type:"substring"}, +paramsKeyMap:{STRING:1,START:3,END:5},"class":"calc_string",isNotFor:[],func:function(b,a){var d=a.getStringValue("STRING",a),c=a.getNumberValue("START",a)-1,e=a.getNumberValue("END",a)-1,f=d.length-1;if(0>c||0>e||c>f||e>f)throw Error();return d.substring(Math.min(c,e),Math.max(c,e)+1)},syntax:{js:[],py:["Entry.string_substring(%2, %4, %6)"]}},replace_string:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_replace_string_1,color:"#3D3D3D"},{type:"Block", +accept:"string"},{type:"Text",text:Lang.Blocks.CALC_replace_string_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_replace_string_3,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_replace_string_4,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.hi_entry]},null,{type:"text",params:[Lang.Blocks.hello]},null,{type:"text",params:[Lang.Blocks.nice]},null],type:"replace_string"},paramsKeyMap:{STRING:1, +OLD_WORD:3,NEW_WORD:5},"class":"calc_string",isNotFor:[],func:function(b,a){return a.getStringValue("STRING",a).replace(new RegExp(a.getStringValue("OLD_WORD",a),"gm"),a.getStringValue("NEW_WORD",a))},syntax:{js:[],py:["Entry.string_replace(%2, %4, %6)"]}},change_string_case:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_change_string_case_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_change_string_case_2, +color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_change_string_case_sub_1,"toUpperCase"],[Lang.Blocks.CALC_change_string_case_sub_2,"toLowerCase"]],value:"toUpperCase",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_change_string_case_3,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:["Hello Entry!"]},null,null,null],type:"change_string_case"},paramsKeyMap:{STRING:1,CASE:3},"class":"calc_string",isNotFor:[],func:function(b,a){return a.getStringValue("STRING", +a)[a.getField("CASE",a)]()},syntax:{js:[],py:["Entry.string_case(%2, %4)"]}},index_of_string:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_index_of_string_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_index_of_string_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_index_of_string_3,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.hi_entry]}, +null,{type:"text",params:[Lang.Blocks.entry]},null],type:"index_of_string"},paramsKeyMap:{LEFTHAND:1,RIGHTHAND:3},"class":"calc_string",isNotFor:[],func:function(b,a){var d=a.getStringValue("LEFTHAND",a),c=a.getStringValue("RIGHTHAND",a),d=d.indexOf(c);return-1d)throw Error(Lang.Blocks.FLOW_repeat_basic_errorMsg);a.iterCount=Math.floor(d)}if(0==a.iterCount||0>a.iterCount)return delete a.isLooped,delete a.iterCount,a.callReturn();a.iterCount--;return a.getStatement("DO", +a)},syntax:{js:[],py:["for i in range(%1):\n$1"]}},repeat_inf:{color:"#498deb",skeleton:"basic_loop",statements:[{accept:"basic"}],params:[{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null],type:"repeat_inf"},statementsKeyMap:{DO:0},"class":"repeat",isNotFor:[],func:function(b,a){a.isLooped=!0;return a.getStatement("DO")},syntax:{js:[],py:["while True:\n$1"]}},stop_repeat:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/flow_03.png", +size:12}],events:{},def:{params:[null],type:"stop_repeat"},"class":"repeat",isNotFor:[],func:function(b,a){return this.executor.breakLoop()},syntax:{js:[],py:["break"]}},wait_until_true:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"Block",accept:"boolean"},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[{type:"True"},null],type:"wait_until_true"},paramsKeyMap:{BOOL:0},"class":"wait",isNotFor:[],func:function(b,a){return a.getBooleanValue("BOOL",a)? +a.callReturn():a},syntax:{js:[],py:["Entry.wait_until(%1)"]}},_if:{color:"#498deb",skeleton:"basic_loop",statements:[{accept:"basic"}],params:[{type:"Block",accept:"boolean"},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[{type:"True"},null],type:"_if"},paramsKeyMap:{BOOL:0},statementsKeyMap:{STACK:0},"class":"condition",isNotFor:[],func:function(b,a){return a.isCondition?(delete a.isCondition,a.callReturn()):a.getBooleanValue("BOOL",a)?(a.isCondition=!0,a.getStatement("STACK", +a)):a.callReturn()},syntax:{js:[],py:["if %1:\n$1"]}},if_else:{color:"#498deb",skeleton:"basic_double_loop",statements:[{accept:"basic"},{accept:"basic"}],params:[{type:"Block",accept:"boolean"},{type:"Indicator",img:"block_icon/flow_03.png",size:12},{type:"LineBreak"}],events:{},def:{params:[{type:"True"},null],type:"if_else"},paramsKeyMap:{BOOL:0},statementsKeyMap:{STACK_IF:0,STACK_ELSE:1},"class":"condition",isNotFor:[],func:function(b,a){if(a.isCondition)return delete a.isCondition,a.callReturn(); +var d=a.getBooleanValue("BOOL",a);a.isCondition=!0;return d?a.getStatement("STACK_IF",a):a.getStatement("STACK_ELSE",a)},syntax:{js:[],py:["if %1:\n$1\nelse:\n$2"]}},create_clone:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"clone",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_FLOW},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null,null],type:"create_clone"},paramsKeyMap:{VALUE:0},"class":"clone",isNotFor:[], +func:function(b,a){var d=a.getField("VALUE",a),c=a.callReturn();"self"==d?b.parent.addCloneEntity(b.parent,b,null):Entry.container.getObject(d).addCloneEntity(b.parent,null,null);return c},syntax:{js:[],py:["Entry.create_clone(%1)"]}},delete_clone:{color:"#498deb",skeleton:"basic_without_next",statements:[],params:[{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null],type:"delete_clone"},"class":"clone",isNotFor:[],func:function(b,a){if(!b.isClone)return a.callReturn(); +b.removeClone();return this.die()},syntax:{js:[],py:["Entry.remove_clone()"]}},when_clone_start:{color:"#498deb",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_clone.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"when_clone_start"},"class":"clone",isNotFor:[],func:function(b,a){return a.callReturn()},event:"when_clone_start",syntax:{js:[],py:["def entry_event_clone_create():"]}},stop_run:{color:"#498deb",skeleton:"basic",statements:[], +params:[{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null]},func:function(b,a){return Entry.engine.toggleStop()},syntax:{js:[],py:[""]}},repeat_while_true:{color:"#498deb",skeleton:"basic_loop",statements:[{accept:"basic"}],params:[{type:"Block",accept:"boolean"},{type:"Dropdown",options:[[Lang.Blocks.FLOW_repeat_while_true_until,"until"],[Lang.Blocks.FLOW_repeat_while_true_while,"while"]],value:"until",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_FLOW},{type:"Indicator", +img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[{type:"True"},null,null],type:"repeat_while_true"},paramsKeyMap:{BOOL:0,OPTION:1},statementsKeyMap:{DO:0},"class":"repeat",isNotFor:[],func:function(b,a){var d=a.getBooleanValue("BOOL",a);"until"==a.getField("OPTION",a)&&(d=!d);return(a.isLooped=d)?a.getStatement("DO",a):a.callReturn()},syntax:{js:[],py:["not yet supported in textcoding"]}},stop_object:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.FLOW_stop_object_all, +"all"],[Lang.Blocks.FLOW_stop_object_this_object,"thisOnly"],[Lang.Blocks.FLOW_stop_object_this_thread,"thisThread"],[Lang.Blocks.FLOW_stop_object_other_thread,"otherThread"]],value:"all",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_FLOW},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null,null],type:"stop_object"},paramsKeyMap:{TARGET:0},"class":"terminate",isNotFor:[],func:function(b,a){var d=a.getField("TARGET",a),c=Entry.container;switch(d){case "all":return c.mapObject(function(a){a.script.clearExecutors()}, +null),this.die();case "thisOnly":return b.parent.script.clearExecutorsByEntity(b),this.die();case "thisObject":return b.parent.script.clearExecutors(),this.die();case "thisThread":return this.die();case "otherThread":for(var d=this.executor,c=b.parent.script,e=c.executors,f=0;fa.count?(50>c.leftFloor&&50>c.rightFloor?a.count++:a.count=0,c=c.leftFloor-c.rightFloor,d.leftWheel=45+.25*c,d.rightWheel=45-.25*c):(a.count=0,a.boardState=2);break;case 2:c=c.leftFloor-c.rightFloor;d.leftWheel=45+.25*c;d.rightWheel=45-.25*c;a.boardState=3;var e= +setTimeout(function(){a.boardState=4;Entry.Hamster.removeTimeout(e)},250);Entry.Hamster.timeouts.push(e);break;case 3:c=c.leftFloor-c.rightFloor;d.leftWheel=45+.25*c;d.rightWheel=45-.25*c;break;case 4:d.leftWheel=0,d.rightWheel=0,a.boardState=0,a.isMoving=!1}return a}delete a.isStart;delete a.isMoving;delete a.count;delete a.boardState;Entry.engine.isContinue=!1;d.leftWheel=0;d.rightWheel=0;return a.callReturn()}a.isStart=!0;a.isMoving=!0;a.count=0;a.boardState=1;d.leftWheel=45;d.rightWheel=45;Entry.Hamster.setLineTracerMode(d, +0);return a},syntax:{js:[],py:["Hamster.move_forward()"]}},hamster_turn_once:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_turn_once_left,"LEFT"],[Lang.Blocks.HAMSTER_turn_right,"RIGHT"]],value:"LEFT",fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null],type:"hamster_turn_once"},paramsKeyMap:{DIRECTION:0},"class":"hamster_board",isNotFor:["hamster"],func:function(b,a){var d=Entry.hw.sendQueue, +c=Entry.hw.portData;if(a.isStart){if(a.isMoving){if(a.isLeft)switch(a.boardState){case 1:2>a.count?50c.leftFloor&&(a.boardState=3);break;case 3:2>a.count?20>c.leftFloor&&a.count++:(a.count=0,a.boardState=4);break;case 4:50a.count? +50c.rightFloor&&(a.boardState=3);break;case 3:2>a.count?20>c.rightFloor&&a.count++:(a.count=0,a.boardState=4);break;case 4:50Entry.Hamster.tempo&&(Entry.Hamster.tempo=1);return a.callReturn()},syntax:{js:[],py:["Hamster.add_tempo(%1)"]}},hamster_set_tempo_to:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}], +events:{},def:{params:[{type:"text",params:["60"]},null],type:"hamster_set_tempo_to"},paramsKeyMap:{VALUE:0},"class":"hamster_buzzer",isNotFor:["hamster"],func:function(b,a){Entry.Hamster.tempo=a.getNumberValue("VALUE");1>Entry.Hamster.tempo&&(Entry.Hamster.tempo=1);return a.callReturn()},syntax:{js:[],py:["Hamster.set_tempo(%1)"]}},hamster_set_port_to:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_port_a,"A"],[Lang.Blocks.HAMSTER_port_b,"B"], +[Lang.Blocks.HAMSTER_port_ab,"AB"]],value:"A",fontSize:11},{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_analog_input,"0"],[Lang.Blocks.HAMSTER_digital_input,"1"],[Lang.Blocks.HAMSTER_servo_output,"8"],[Lang.Blocks.HAMSTER_pwm_output,"9"],[Lang.Blocks.HAMSTER_digital_output,"10"]],value:"0",fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"hamster_set_port_to"},paramsKeyMap:{PORT:0,MODE:1},"class":"hamster_port",isNotFor:["hamster"], +func:function(b,a){var d=Entry.hw.sendQueue,c=a.getField("PORT",a),e=Number(a.getField("MODE",a));"A"==c?d.ioModeA=e:("B"!=c&&(d.ioModeA=e),d.ioModeB=e);return a.callReturn()},syntax:{js:[],py:["Hamster.set_port(%1, %2)"]}},hamster_change_output_by:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_port_a,"A"],[Lang.Blocks.HAMSTER_port_b,"B"],[Lang.Blocks.HAMSTER_port_ab,"AB"]],value:"A",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator", +img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text",params:["10"]},null],type:"hamster_change_output_by"},paramsKeyMap:{PORT:0,VALUE:1},"class":"hamster_port",isNotFor:["hamster"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getField("PORT"),e=a.getNumberValue("VALUE");"A"==c?d.outputA=void 0!=d.outputA?d.outputA+e:e:("B"!=c&&(d.outputA=void 0!=d.outputA?d.outputA+e:e),d.outputB=void 0!=d.outputB?d.outputB+e:e);return a.callReturn()},syntax:{js:[],py:["Hamster.add_output(%1, %2)"]}}, +hamster_set_output_to:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_port_a,"A"],[Lang.Blocks.HAMSTER_port_b,"B"],[Lang.Blocks.HAMSTER_port_ab,"AB"]],value:"A",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text",params:["100"]},null],type:"hamster_set_output_to"},paramsKeyMap:{PORT:0,VALUE:1},"class":"hamster_port",isNotFor:["hamster"],func:function(b, +a){var d=Entry.hw.sendQueue,c=a.getField("PORT"),e=a.getNumberValue("VALUE");"A"==c?d.outputA=e:("B"!=c&&(d.outputA=e),d.outputB=e);return a.callReturn()},syntax:{js:[],py:["Hamster.set_output(%1, %2)"]}},is_clicked:{color:"#AEB8FF",skeleton:"basic_boolean_field",statements:[],params:[{type:"Text",text:Lang.Blocks.JUDGEMENT_is_clicked,color:"#3D3D3D"}],events:{},def:{params:[null],type:"is_clicked"},"class":"boolean_input",isNotFor:[],func:function(b,a){return Entry.stage.isClick},syntax:{js:[],py:["Entry.is_mouse_clicked()"]}}, +is_press_some_key:{color:"#AEB8FF",skeleton:"basic_boolean_field",statements:[],params:[{type:"Keyboard",value:81},{type:"Text",text:Lang.Blocks.JUDGEMENT_is_press_some_key_2,color:"#3D3D3D"}],events:{},def:{params:[null,null],type:"is_press_some_key"},paramsKeyMap:{VALUE:0},"class":"boolean_input",isNotFor:[],func:function(b,a){var d=Number(a.getField("VALUE",a));return 0<=Entry.pressedKeys.indexOf(d)},syntax:{js:[],py:["Entry.is_pressed(%1)"]}},reach_something:{color:"#AEB8FF",skeleton:"basic_boolean_field", +statements:[],params:[{type:"Text",text:Lang.Blocks.JUDGEMENT_reach_something_1,color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"collision",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_JUDGE},{type:"Text",text:Lang.Blocks.JUDGEMENT_reach_something_2,color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"reach_something"},paramsKeyMap:{VALUE:1},"class":"boolean_collision",isNotFor:[],func:function(b,a){if(!b.getVisible())return!1;var d=a.getField("VALUE",a),c=b.object,e=/wall/.test(d), +f=ndgmr.checkPixelCollision;if(e)switch(e=Entry.stage.wall,d){case "wall":return!!(f(c,e.up,.2,!0)||f(c,e.down,.2,!0)||f(c,e.left,.2,!0)||f(c,e.right,.2,!0));case "wall_up":return!!f(c,e.up,.2,!0);case "wall_down":return!!f(c,e.down,.2,!0);case "wall_right":return!!f(c,e.right,.2,!0);case "wall_left":return!!f(c,e.left,.2,!0)}else{if("mouse"==d)return f=Entry.stage.canvas,f=c.globalToLocal(f.mouseX,f.mouseY),c.hitTest(f.x,f.y);d=Entry.container.getEntity(d);if("textBox"==d.type||"textBox"==b.type){f= +d.object.getTransformedBounds();c=c.getTransformedBounds();if(Entry.checkCollisionRect(c,f))return!0;for(var d=d.parent.clonedEntities,e=0,g=d.length;e","BIGGER"]],value:"EQUAL",fontSize:11},{type:"Block",accept:"string"}],events:{},def:{params:[null],type:"boolean_comparison"},paramsKeyMap:{LEFTHAND:0,OPERATOR:1,RIGHTHAND:2},func:function(b,a){var d=a.getField("OPERATOR",a),c=a.getNumberValue("LEFTHAND",a),e=a.getNumberValue("RIGHTHAND",a);return"EQUAL"==d?c==e:"BIGGER"==d?c>e:c",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]}],type:"boolean_bigger"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"boolean_compare",isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d>c},syntax:{js:[],py:[""]}},boolean_smaller:{color:"#AEB8FF", +skeleton:"basic_boolean_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"<",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]}],type:"boolean_smaller"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"boolean_compare",isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d","GREATER"],["<","LESS"],["\u2265","GREATER_OR_EQUAL"],["\u2264","LESS_OR_EQUAL"]],value:"EQUAL",fontSize:11,noArrow:!0},{type:"Block", +accept:"string"}],events:{},def:{params:[{type:"text",params:["10"]},"EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"},defs:[{params:[{type:"text",params:["10"]},"EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"GREATER",{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"LESS",{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"GREATER_OR_EQUAL", +{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"LESS_OR_EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"}],paramsKeyMap:{LEFTHAND:0,OPERATOR:1,RIGHTHAND:2},"class":"boolean_compare",isNotFor:[],func:function(b,a){var d=a.getField("OPERATOR",a),c=a.getStringValue("LEFTHAND",a),e=a.getStringValue("RIGHTHAND",a);switch(d){case "EQUAL":return c==e;case "GREATER":return Number(c)>Number(e);case "LESS":return Number(c)= +Number(e);case "LESS_OR_EQUAL":return Number(c)<=Number(e)}},syntax:{js:[],py:["(%1 %2boolean_compare# %3)"]}},show:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"show"},"class":"visibility",isNotFor:[],func:function(b,a){b.setVisible(!0);return a.callReturn()},syntax:{js:[],py:["Entry.show()"]}},hide:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png", +size:12}],events:{},def:{params:[null],type:"hide"},"class":"visibility",isNotFor:[],func:function(b,a){b.setVisible(!1);return a.callReturn()},syntax:{js:[],py:["Entry.hide()"]}},dialog_time:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.speak,"speak"]],value:"speak",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_LOOKS},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{}, +def:{params:[{type:"text",params:[Lang.Blocks.block_hi]},{type:"number",params:["4"]},null,null],type:"dialog_time"},paramsKeyMap:{VALUE:0,SECOND:1,OPTION:2},"class":"say",isNotFor:["textBox"],func:function(b,a){if(!a.isStart){var d=a.getNumberValue("SECOND",a),c=a.getStringValue("VALUE",a),e=a.getField("OPTION",a);a.isStart=!0;a.timeFlag=1;c||"number"==typeof c||(c=" ");c=Entry.convertToRoundedDecimals(c,3);new Entry.Dialog(b,c,e);b.syncDialogVisible(b.getVisible());setTimeout(function(){a.timeFlag= +0},1E3*d)}if(0==a.timeFlag)return delete a.timeFlag,delete a.isStart,b.dialog&&b.dialog.remove(),a.callReturn();b.dialog||(c=a.getStringValue("VALUE",a),e=a.getField("OPTION",a),c||"number"==typeof c||(c=" "),c=Entry.convertToRoundedDecimals(c,3),new Entry.Dialog(b,c,e),b.syncDialogVisible(b.getVisible()));return a},syntax:{js:[],py:["Entry.print_for_seconds(%1, %2, %3)"]}},dialog:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.speak, +"speak"]],value:"speak",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_LOOKS},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"text",params:[Lang.Blocks.block_hi]},null,null],type:"dialog"},paramsKeyMap:{VALUE:0,OPTION:1},"class":"say",isNotFor:["textBox"],func:function(b,a){var d=a.getStringValue("VALUE",a);d||"number"==typeof d||(d=" ");var c=a.getField("OPTION",a),d=Entry.convertToRoundedDecimals(d,3);new Entry.Dialog(b,d,c);b.syncDialogVisible(b.getVisible()); +return a.callReturn()},syntax:{js:[],py:["Entry.print(%1)"]}},remove_dialog:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"remove_dialog"},"class":"say",isNotFor:["textBox"],func:function(b,a){b.dialog&&b.dialog.remove();return a.callReturn()},syntax:{js:[],py:["Entry.print_remove()"]}},change_to_nth_shape:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null, +menuName:"pictures",fontSize:11},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,null],type:"change_to_nth_shape"},paramsKeyMap:{VALUE:0},"class":"shape",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),d=b.parent.getPicture(d);b.setImage(d);return a.callReturn()},syntax:{js:[],py:[""]}},change_to_next_shape:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.LOOKS_change_shape_next,"next"],[Lang.Blocks.LOOKS_change_shape_prev, +"prev"]],value:"next",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_LOOKS},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,null],type:"change_to_next_shape"},paramsKeyMap:{DRIECTION:0},"class":"shape",isNotFor:["textBox"],func:function(b,a){var d;d="prev"!==a.getStringField("DRIECTION")?b.parent.getNextPicture(b.picture.id):b.parent.getPrevPicture(b.picture.id);b.setImage(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_shape_of(%1)"]}},set_effect_volume:{color:"#EC4466", +skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.color,"color"],[Lang.Blocks.brightness,"brightness"],[Lang.Blocks.opacity,"opacity"]],value:"color",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["10"]},null],type:"set_effect_volume"},paramsKeyMap:{EFFECT:0,VALUE:1},"class":"effect",isNotFor:["textBox"],func:function(b,a){var d=a.getField("EFFECT",a),c=a.getNumberValue("VALUE", +a);"color"==d?b.effect.hue=c+b.effect.hue:"lens"!=d&&"swriling"!=d&&"pixel"!=d&&"mosaic"!=d&&("brightness"==d?b.effect.brightness=c+b.effect.brightness:"blur"!=d&&"opacity"==d&&(b.effect.alpha+=c/100));b.applyFilter(!0);return a.callReturn()},syntax:{js:[],py:["Entry.add_effect(%1, %2)"]}},set_effect:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.color,"color"],[Lang.Blocks.brightness,"brightness"],[Lang.Blocks.opacity,"opacity"]],value:"color",fontSize:11}, +{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["100"]},null],type:"set_effect"},paramsKeyMap:{EFFECT:0,VALUE:1},"class":"effect",isNotFor:["textBox"],func:function(b,a){var d=a.getField("EFFECT",a),c=a.getNumberValue("VALUE",a);"color"==d?b.effect.hue=c:"lens"!=d&&"swriling"!=d&&"pixel"!=d&&"mosaic"!=d&&("brightness"==d?b.effect.brightness=c:"blur"!=d&&"opacity"==d&&(b.effect.alpha=c/100));b.applyFilter(!0); +return a.callReturn()},syntax:{js:[],py:["Entry.set_effect(%1, %2)"]}},erase_all_effects:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"erase_all_effects"},"class":"effect",isNotFor:["textBox"],func:function(b,a){b.resetFilter();return a.callReturn()},syntax:{js:[],py:["Entry.clear_effect()"]}},change_scale_percent:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"}, +{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"change_scale_percent"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=(a.getNumberValue("VALUE",a)+100)/100;b.setScaleX(b.getScaleX()*d);b.setScaleY(b.getScaleY()*d);return a.callReturn()},syntax:{js:[],py:[""]}},set_scale_percent:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png", +size:12}],events:{},def:{params:[{type:"number",params:["100"]},null],type:"set_scale_percent"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a)/100,c=b.snapshot_;b.setScaleX(d*c.scaleX);b.setScaleY(d*c.scaleY);return a.callReturn()},syntax:{js:[],py:[""]}},change_scale_size:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number", +params:["10"]},null],type:"change_scale_size"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setSize(b.getSize()+d);return a.callReturn()},syntax:{js:[],py:["Entry.add_size(%1)"]}},set_scale_size:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number",params:["100"]},null],type:"set_scale_size"},paramsKeyMap:{VALUE:0}, +"class":"scale",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setSize(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_size(%1)"]}},flip_y:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"flip_y"},"class":"flip",isNotFor:[],func:function(b,a){b.setScaleX(-1*b.getScaleX());return a.callReturn()},syntax:{js:[],py:["Entry.flip_vertical()"]}},flip_x:{color:"#EC4466",skeleton:"basic", +statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"flip_x"},"class":"flip",isNotFor:[],func:function(b,a){b.setScaleY(-1*b.getScaleY());return a.callReturn()},syntax:{js:[],py:["Entry.flip_horizontal()"]}},set_object_order:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"objectSequence",fontSize:11},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null, +null],type:"set_object_order"},paramsKeyMap:{VALUE:0},"class":"z-index",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c=Entry.container.getCurrentObjects().indexOf(b.parent);if(-1f)throw Error("object is not available for current scene");switch(c){case "FRONT":d= +0;break;case "FORWARD":d=Math.max(0,f-1);break;case "BACKWARD":d=Math.min(e,f+1);break;case "BACK":d=e}Entry.container.moveElementByBlock(f,d);return a.callReturn()},syntax:{js:[],py:["Entry.set_layer(%1)"]}},move_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"move_direction"},paramsKeyMap:{VALUE:0},"class":"walk",isNotFor:[], +func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setX(b.getX()+d*Math.cos((b.getRotation()+b.getDirection()-90)/180*Math.PI));b.setY(b.getY()-d*Math.sin((b.getRotation()+b.getDirection()-90)/180*Math.PI));b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move(%1)"]}},move_x:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number", +params:["10"]},null],type:"move_x"},paramsKeyMap:{VALUE:0},"class":"move_relative",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setX(b.getX()+d);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.set_x(%1)"]}},move_y:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null], +type:"move_y"},paramsKeyMap:{VALUE:0},"class":"move_relative",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setY(b.getY()+d);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.set_y(%1)"]}},locate_xy_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{}, +def:{params:[{type:"number",params:["2"]},{type:"number",params:["10"]},{type:"number",params:["10"]},null],type:"locate_xy_time"},paramsKeyMap:{VALUE1:0,VALUE2:1,VALUE3:2},"class":"move_absolute",isNotFor:[],func:function(b,a){function d(){var d=a.x-b.getX(),c=a.y-b.getY(),d=d/a.frameCount,c=c/a.frameCount;b.setX(b.getX()+d);b.setY(b.getY()+c);a.frameCount--;b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY())}if(!a.isStart){var c;c=a.getNumberValue("VALUE1",a);a.isStart=!0;a.frameCount= +Math.max(Math.floor(c*Entry.FPS),1);a.x=a.getNumberValue("VALUE2",a);a.y=a.getNumberValue("VALUE3",a);1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.set_xy_for_seconds(%1, %2, %3)"]}},rotate_by_angle:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["90"]},null],type:"rotate_by_angle"}, +paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setRotation(b.getRotation()+d);return a.callReturn()},syntax:{js:[],py:[""]}},rotate_by_angle_dropdown:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[["45","45"],["90","90"],["135","135"],["180","180"]],value:"45",fontSize:11},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:["45",null],type:"rotate_by_angle_dropdown"},paramsKeyMap:{VALUE:0}, +"class":"ebs",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a);b.setRotation(b.getRotation()+Number(d));return a.callReturn()},syntax:{js:[],py:[""]}},see_angle:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["90"]},null],type:"see_angle"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d); +return a.callReturn()},syntax:{js:[],py:[""]}},see_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"sprites",fontSize:11},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null,null]},paramsKeyMap:{VALUE:0},func:function(b,a){var d=a.getField("VALUE",a),c=Entry.container.getEntity(d),d=c.getX()-b.getX(),c=c.getY()-b.getY();0<=d?b.setRotation(Math.atan(c/d)/Math.PI*180+90):b.setRotation(Math.atan(c/d)/Math.PI* +180+270);return a.callReturn()},syntax:{js:[],py:[""]}},locate_xy:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["0"]},{type:"number",params:["0"]},null],type:"locate_xy"},paramsKeyMap:{VALUE1:0,VALUE2:1},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE1",a),c=a.getNumberValue("VALUE2",a); +b.setX(d);b.setY(c);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.set_xy(%1, %2)"]}},locate_x:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"locate_x"},paramsKeyMap:{VALUE:0},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setX(d); +b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move_x(%1)"]}},locate_y:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"locate_y"},paramsKeyMap:{VALUE:0},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setY(d);b.brush&&!b.brush.stop&& +b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move_y(%1)"]}},locate:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_MOVING},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null,null],type:"locate"},paramsKeyMap:{VALUE:0},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c;"mouse"== +d?(d=Entry.stage.mouseCoordinate.x,c=Entry.stage.mouseCoordinate.y):(c=Entry.container.getEntity(d),d=c.getX(),c=c.getY());b.setX(Number(d));b.setY(Number(c));b.brush&&!b.brush.stop&&b.brush.lineTo(d,-1*c);return a.callReturn()},syntax:{js:[],py:["Entry.set_location(%1)"]}},move_xy_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{}, +def:{params:[{type:"number",params:["2"]},{type:"number",params:["10"]},{type:"number",params:["10"]},null],type:"move_xy_time"},paramsKeyMap:{VALUE1:0,VALUE2:1,VALUE3:2},"class":"move_relative",isNotFor:[],func:function(b,a){function d(){b.setX(b.getX()+a.dX);b.setY(b.getY()+a.dY);a.frameCount--;b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY())}if(!a.isStart){var c;c=a.getNumberValue("VALUE1",a);var e=a.getNumberValue("VALUE2",a),f=a.getNumberValue("VALUE3",a);a.isStart=!0;a.frameCount= +Math.max(Math.floor(c*Entry.FPS),1);a.dX=e/a.frameCount;a.dY=f/a.frameCount;1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.add_xy_for_seconds(%1, %2, %3)"]}},rotate_by_angle_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Angle"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["2"]},null,null],type:"rotate_by_angle_time"}, +paramsKeyMap:{VALUE:1},"class":"rotate",isNotFor:[],func:function(b,a){if(!a.isStart){var d;d=a.getNumberValue("VALUE",a);var c=a.getNumberField("VALUE",a);a.isStart=!0;a.frameCount=Math.floor(d*Entry.FPS);a.dAngle=c/a.frameCount}if(0!=a.frameCount)return b.setRotation(b.getRotation()+a.dAngle),a.frameCount--,a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:[""]}},bounce_wall:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/moving_03.png", +size:12}],events:{},def:{params:[null],type:"bounce_wall"},"class":"walk",isNotFor:[],func:function(b,a){var d=b.parent.getRotateMethod(),c="free"==d?(b.getRotation()+b.getDirection()).mod(360):b.getDirection(),e=Entry.Utils.COLLISION.NONE;if(90>c&&0<=c||360>c&&270<=c){var e=b.collision==Entry.Utils.COLLISION.UP,f=ndgmr.checkPixelCollision(Entry.stage.wall.up,b.object,0,!1);!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE);f&&e&&(f=!1);f?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+ +180):b.setDirection(-b.getDirection()+180),b.collision=Entry.Utils.COLLISION.UP):(e=b.collision==Entry.Utils.COLLISION.DOWN,f=ndgmr.checkPixelCollision(Entry.stage.wall.down,b.object,0,!1),!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE),f&&e&&(f=!1),f&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision=Entry.Utils.COLLISION.DOWN))}else 270>c&&90<=c&&(e=b.collision==Entry.Utils.COLLISION.DOWN,f=ndgmr.checkPixelCollision(Entry.stage.wall.down, +b.object,0,!1),!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE),f&&e&&(f=!1),f?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision=Entry.Utils.COLLISION.DOWN):(e=b.collision==Entry.Utils.COLLISION.UP,f=ndgmr.checkPixelCollision(Entry.stage.wall.up,b.object,0,!1),!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE),f&&e&&(f=!1),f&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision= +Entry.Utils.COLLISION.UP)));360>c&&180<=c?(e=b.collision==Entry.Utils.COLLISION.LEFT,c=ndgmr.checkPixelCollision(Entry.stage.wall.left,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.LEFT):(e=b.collision==Entry.Utils.COLLISION.RIGHT,c=ndgmr.checkPixelCollision(Entry.stage.wall.right,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE), +c&&e&&(c=!1),c&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.RIGHT))):180>c&&0<=c&&(e=b.collision==Entry.Utils.COLLISION.RIGHT,c=ndgmr.checkPixelCollision(Entry.stage.wall.right,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.RIGHT):(e=b.collision== +Entry.Utils.COLLISION.LEFT,c=ndgmr.checkPixelCollision(Entry.stage.wall.left,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.LEFT)));return a.callReturn()},syntax:{js:[],py:["Entry.bounce_wall()"]}},flip_arrow_horizontal:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/moving_03.png",size:12}], +events:{},def:{params:[null]},func:function(b,a){b.setDirection(b.getDirection()+180);return a.callReturn()},syntax:{js:[],py:[""]}},flip_arrow_vertical:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null]},func:function(b,a){b.setDirection(b.getDirection()+180);return a.callReturn()},syntax:{js:[],py:[""]}},see_angle_object:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null, +menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_MOVING},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null,null],type:"see_angle_object"},paramsKeyMap:{VALUE:0},"class":"rotate_absolute",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c=b.getX(),e=b.getY();if(b.parent.id==d)return a.callReturn();"mouse"==d?(d=Entry.stage.mouseCoordinate.y,c=Entry.stage.mouseCoordinate.x-c,e=d-e):(d=Entry.container.getEntity(d),c=d.getX()-c, +e=d.getY()-e);e=0===c&&0===e?b.getDirection()+b.getRotation():0<=c?-Math.atan(e/c)/Math.PI*180+90:-Math.atan(e/c)/Math.PI*180+270;c=b.getDirection()+b.getRotation();b.setRotation(b.getRotation()+e-c);return a.callReturn()},syntax:{js:[],py:["Entry.look_at_object(%1)"]}},see_angle_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["90"]},null],type:"see_angle_direction"}, +paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a),c=b.getDirection()+b.getRotation();b.setRotation(b.getRotation()+d-c);return a.callReturn()},syntax:{js:[],py:[""]}},rotate_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["90"]},null],type:"rotate_direction"},paramsKeyMap:{VALUE:0},"class":"rotate", +isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d+b.getDirection());return a.callReturn()},syntax:{js:[],py:[""]}},locate_object_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_MOVING},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["2"]},null,null],type:"locate_object_time"}, +paramsKeyMap:{VALUE:0,TARGET:1},"class":"move_absolute",isNotFor:[],func:function(b,a){if(!a.isStart){var d,c,e;c=a.getField("TARGET",a);d=a.getNumberValue("VALUE",a);d=Math.floor(d*Entry.FPS);e=Entry.stage.mouseCoordinate;if(0!=d)"mouse"==c?(c=e.x-b.getX(),e=e.y-b.getY()):(e=Entry.container.getEntity(c),c=e.getX()-b.getX(),e=e.getY()-b.getY()),a.isStart=!0,a.frameCount=d,a.dX=c/a.frameCount,a.dY=e/a.frameCount;else return"mouse"==c?(c=Number(e.x),e=Number(e.y)):(e=Entry.container.getEntity(c),c= +e.getX(),e=e.getY()),b.setX(c),b.setY(e),b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY()),a.callReturn()}if(0!=a.frameCount)return b.setX(b.getX()+a.dX),b.setY(b.getY()+a.dY),a.frameCount--,b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY()),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.set_location_for_seconds(%1, %2)"]}},rotate_absolute:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator", +img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},null],type:"rotate_absolute"},paramsKeyMap:{VALUE:0},"class":"rotate_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setRotation(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_rotation(%1)"]}},rotate_relative:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"}, +null],type:"rotate_relative"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setRotation(d+b.getRotation());return a.callReturn()},syntax:{js:[],py:["Entry.add_rotation(%1)"]}},direction_absolute:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},null],type:"direction_absolute"},paramsKeyMap:{VALUE:0},"class":"rotate_absolute", +isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_direction(%1)"]}},direction_relative:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},null],type:"direction_relative"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d+ +b.getDirection());return a.callReturn()},syntax:{js:[],py:["Entry.add_direction(%1)"]}},move_to_angle:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},{type:"number",params:["10"]},null],type:"move_to_angle"},paramsKeyMap:{ANGLE:0,VALUE:1},"class":"move_rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a),c=a.getNumberValue("ANGLE", +a);b.setX(b.getX()+d*Math.cos((c-90)/180*Math.PI));b.setY(b.getY()-d*Math.sin((c-90)/180*Math.PI));b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move_degree(%1, %2)"]}},rotate_by_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["2"]},{type:"angle"},null],type:"rotate_by_time"}, +paramsKeyMap:{VALUE:0,ANGLE:1},"class":"rotate",isNotFor:[],func:function(b,a){function d(){b.setRotation(b.getRotation()+a.dAngle);a.frameCount--}if(!a.isStart){var c;c=a.getNumberValue("VALUE",a);var e=a.getNumberValue("ANGLE",a);a.isStart=!0;a.frameCount=Math.max(Math.floor(c*Entry.FPS),1);a.dAngle=e/a.frameCount;1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.add_rotation_for_seconds(%1, %2)"]}},direction_relative_duration:{color:"#A751E3", +skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"text",params:["2"]},{type:"angle"},null],type:"direction_relative_duration"},paramsKeyMap:{DURATION:0,AMOUNT:1},"class":"rotate",isNotFor:[],func:function(b,a){function d(){b.setDirection(b.getDirection()+a.dDirection);a.frameCount--}if(!a.isStart){var c;c=a.getNumberValue("DURATION",a);var e=a.getNumberValue("AMOUNT", +a);a.isStart=!0;a.frameCount=Math.max(Math.floor(c*Entry.FPS),1);a.dDirection=e/a.frameCount;1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;delete a.dDirection;return a.callReturn()},syntax:{js:[],py:["Entry.add_direction_for_seconds(%1, %2)"]}},neobot_sensor_value:{color:"#00979D",skeleton:"basic_string_field",fontColor:"#fff",statements:[],template:"%1 \uac12",params:[{type:"Dropdown",options:[["1\ubc88 \ud3ec\ud2b8","IN1"],["2\ubc88 \ud3ec\ud2b8","IN2"], +["3\ubc88 \ud3ec\ud2b8","IN3"],["\ub9ac\ubaa8\ucee8","IR"],["\ubc30\ud130\ub9ac","BAT"]],value:"IN1",fontSize:11}],events:{},def:{params:[null],type:"neobot_sensor_value"},paramsKeyMap:{PORT:0},"class":"neobot_value",isNotFor:["neobot"],func:function(b,a){var d=a.getStringField("PORT");return Entry.hw.portData[d]},syntax:{js:[],py:["Neobot.sensor_value(%1)"]}},neobot_sensor_convert_scale:{color:"#00979D",skeleton:"basic_string_field",fontColor:"#fff",statements:[],template:"%1 \uac12\uc758 \ubc94\uc704\ub97c %2 ~ %3 \uc5d0\uc11c %4 ~ %5 (\uc73c)\ub85c \ubcc0\ud658", +params:[{type:"Dropdown",options:[["1\ubc88 \ud3ec\ud2b8","IN1"],["2\ubc88 \ud3ec\ud2b8","IN2"],["3\ubc88 \ud3ec\ud2b8","IN3"],["\ub9ac\ubaa8\ucee8","IR"],["\ubc30\ud130\ub9ac","BAT"]],value:"IN1",fontSize:11},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"}],events:{},def:{params:[null,{type:"number",params:["0"]},{type:"number",params:["255"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"neobot_sensor_convert_scale"}, +paramsKeyMap:{PORT:0,OMIN:1,OMAX:2,MIN:3,MAX:4},"class":"neobot_value",isNotFor:["neobot"],func:function(b,a){var d=a.getStringField("PORT"),d=Entry.hw.portData[d],c=a.getNumberValue("OMIN",a),e=a.getNumberValue("OMAX",a),f=a.getNumberValue("MIN",a),g=a.getNumberValue("MAX",a);if(c>e)var h=c,c=e,e=h;f>g&&(h=f,f=g,g=h);d=(g-f)/(e-c)*(d-c);d+=f;d=Math.min(g,d);d=Math.max(f,d);return Math.round(d)}},neobot_left_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc67c\ucabd \ubaa8\ud130\ub97c %1 %2 \uc758 \uc18d\ub3c4\ub85c \ud68c\uc804 %3", params:[{type:"Dropdown",options:[["\uc55e\uc73c\ub85c","16"],["\ub4a4\ub85c","32"]],value:"16",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],value:"0",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,"15", -null],type:"neobot_right_motor"},paramsKeyMap:{DIRECTION:0,SPEED:1},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){var d=a.getNumberField("SPEED"),c=a.getNumberField("DIRECTION");Entry.hw.sendQueue.DCR=d+c;return a.callReturn()},syntax:{js:[],py:["Neobot.turn_right(%1, %2)"]}},neobot_stop_right_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc624\ub978\ucabd \ubaa8\ud130\ub97c \uc815\uc9c0 %1",params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{}, -def:{params:[null],type:"neobot_stop_right_motor"},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){Entry.hw.sendQueue.DCR=0;return a.callReturn()},syntax:{js:[],py:["Neobot.stop_right()"]}},neobot_all_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc591\ucabd \ubaa8\ud130\ub97c %1 %2\uc758 \uc18d\ub3c4\ub85c %3\ucd08 \ub3d9\uc548 \ud68c\uc804 %4",params:[{type:"Dropdown",options:[["\uc55e\uc73c\ub85c","1"],["\ub4a4\ub85c","2"],["\uc81c\uc790\ub9ac\uc5d0\uc11c \uc67c\ucabd \ub3cc\uae30", -"3"],["\uc81c\uc790\ub9ac\uc5d0\uc11c \uc624\ub978\ucabd \ub3cc\uae30","4"],["\uc67c\ucabd\uc73c\ub85c \ub3cc\uae30","5"],["\uc624\ub978\ucabd\uc73c\ub85c \ub3cc\uae30","6"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block", -accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:["1","15",{type:"number",params:["0"]}],type:"neobot_all_motor"},paramsKeyMap:{DIRECTION:0,SPEED:1,DURATION:2},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){if(a.isStart){if(1==a.timeFlag)return a;delete a.timeFlag;delete a.isStart;Entry.hw.sendQueue.DCL=0;Entry.hw.sendQueue.DCR=0;Entry.engine.isContinue=!1;return a.callReturn()}var d=a.getNumberField("SPEED"),c=a.getNumberField("DIRECTION"), -e=a.getNumberValue("DURATION");0>e&&(e=0);switch(c){case 1:Entry.hw.sendQueue.DCL=16+d;Entry.hw.sendQueue.DCR=16+d;break;case 2:Entry.hw.sendQueue.DCL=32+d;Entry.hw.sendQueue.DCR=32+d;break;case 3:Entry.hw.sendQueue.DCL=32+d;Entry.hw.sendQueue.DCR=16+d;break;case 4:Entry.hw.sendQueue.DCL=16+d;Entry.hw.sendQueue.DCR=32+d;break;case 5:Entry.hw.sendQueue.DCL=0;Entry.hw.sendQueue.DCR=16+d;break;case 6:Entry.hw.sendQueue.DCL=16+d,Entry.hw.sendQueue.DCR=0}if(0===e)return a.callReturn();a.isStart=!0;a.timeFlag= -1;setTimeout(function(){a.timeFlag=0},1E3*e);return a}},neobot_stop_all_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc591\ucabd \ubaa8\ud130\ub97c \uc815\uc9c0 %1",params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"neobot_stop_all_motor"},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){Entry.hw.sendQueue.DCL=0;Entry.hw.sendQueue.DCR=0;return a.callReturn()},syntax:{js:[],py:["Neobot.run_motor(%1, %2, %3, %4)"]}}, -neobot_set_servo:{color:"#00979D",skeleton:"basic",statements:[],template:"%1 \ud3ec\ud2b8\uc758 \uc11c\ubcf4\ubaa8\ud130\ub97c %2 \ub3c4 \uc774\ub3d9 %3",params:[{type:"Dropdown",options:[["OUT1","1"],["OUT2","2"],["OUT3","3"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"neobot_set_servo"},paramsKeyMap:{PORT:0,DEGREE:1},"class":"neobot_output", -isNotFor:["neobot"],func:function(b,a){var d=a.getNumberField("PORT"),c=a.getNumberValue("DEGREE");0>c?c=0:180c?c=0:255d.count)throw d.count++,new Entry.Utils.AsyncError;d.isStart=!1;c=Entry.hw.portData[d.data_default_address];d.data_default_address=void 0;return c},syntax:{js:[],py:["Robotis.opencm70_cm_custom_value(%1, %2)"]}},robotis_openCM70_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.robotis_cm_sound_detected,"CM_SOUND_DETECTED"],[Lang.Blocks.robotis_cm_sound_detecting,"CM_SOUND_DETECTING"],[Lang.Blocks.robotis_cm_user_button, -"CM_USER_BUTTON"]],value:"CM_SOUND_DETECTED",fontSize:11}],events:{},def:{params:[null],type:"robotis_openCM70_sensor_value"},paramsKeyMap:{SENSOR:0},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.executor.scope;if(!d.isStart){d.isStart=!0;d.count=0;var c=Entry.Robotis_openCM70.INSTRUCTION.READ,e=0,f=0,g=0,h=0,k=a.getStringField("SENSOR");"CM_SOUND_DETECTED"==k?(g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[0],h=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[1], -e=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[0],f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[1]):"CM_SOUND_DETECTING"==k?(g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[0],h=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[0],f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[1]):"CM_USER_BUTTON"==k&&(g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[0],h=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[1], -e=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[0],f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[1]);g+=0*h;Entry.Robotis_carCont.setRobotisData([[c,e,f,0,h]]);Entry.Robotis_carCont.update();d.data_default_address=g;throw new Entry.Utils.AsyncError;}if(2>d.count)throw d.count++,new Entry.Utils.AsyncError;d.isStart=!1;c=Entry.hw.portData[d.data_default_address];d.data_default_address=void 0;return c},syntax:{js:[],py:["Robotis.opencm70_sensor_value(%1)"]}},robotis_openCM70_aux_sensor_value:{color:"#00979D", -fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["3","PORT_3"],["4","PORT_4"],["5","PORT_5"],["6","PORT_6"]],value:"PORT_3",fontSize:11},{type:"Dropdown",options:[[Lang.Blocks.robotis_aux_servo_position,"AUX_SERVO_POSITION"],[Lang.Blocks.robotis_aux_ir,"AUX_IR"],[Lang.Blocks.robotis_aux_touch,"AUX_TOUCH"],[Lang.Blocks.robotis_aux_brightness,"AUX_BRIGHTNESS"],[Lang.Blocks.robotis_aux_hydro_themo_humidity,"AUX_HYDRO_THEMO_HUMIDITY"],[Lang.Blocks.robotis_aux_hydro_themo_temper, -"AUX_HYDRO_THEMO_TEMPER"],[Lang.Blocks.robotis_aux_temperature,"AUX_TEMPERATURE"],[Lang.Blocks.robotis_aux_ultrasonic,"AUX_ULTRASONIC"],[Lang.Blocks.robotis_aux_magnetic,"AUX_MAGNETIC"],[Lang.Blocks.robotis_aux_motion_detection,"AUX_MOTION_DETECTION"],[Lang.Blocks.robotis_aux_color,"AUX_COLOR"],[Lang.Blocks.robotis_aux_custom,"AUX_CUSTOM"]],value:"AUX_SERVO_POSITION",fontSize:11}],events:{},def:{params:[null,null],type:"robotis_openCM70_aux_sensor_value"},paramsKeyMap:{PORT:0,SENSOR:1},"class":"robotis_openCM70_cm", -isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.executor.scope;if(!d.isStart){d.isStart=!0;d.count=0;var c=Entry.Robotis_openCM70.INSTRUCTION.READ,e=0,f=0,g=0,h=a.getStringField("PORT"),k=a.getStringField("SENSOR"),l=0;"PORT_3"==h?l=2:"PORT_4"==h?l=3:"PORT_5"==h?l=4:"PORT_6"==h&&(l=5);"AUX_SERVO_POSITION"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[1]): -"AUX_IR"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[1]):"AUX_TOUCH"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[1]):"AUX_TEMPERATURE"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[1]): -"AUX_BRIGHTNESS"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[1]):"AUX_HYDRO_THEMO_HUMIDITY"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[1]):"AUX_HYDRO_THEMO_TEMPER"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[0], -g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[1]):"AUX_ULTRASONIC"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[1]):"AUX_MAGNETIC"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[1]): -"AUX_MOTION_DETECTION"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[1]):"AUX_COLOR"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[1]):"AUX_CUSTOM"==k&&(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1], -e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1]);f+=l*g;Entry.Robotis_carCont.setRobotisData([[c,f,e,0,g]]);Entry.Robotis_carCont.update();d.data_default_address=f;throw new Entry.Utils.AsyncError;}if(2>d.count)throw d.count++,new Entry.Utils.AsyncError;d.isStart=!1;c=Entry.hw.portData[d.data_default_address];d.data_default_address=void 0;return c},syntax:{js:[],py:["Robotis.opencm70_aux_sensor_value(%1, %2)"]}},robotis_openCM70_cm_buzzer_index:{color:"#00979D",skeleton:"basic",statements:[], -params:[{type:"Dropdown",options:[[Lang.General.note_a+"(0)","0"],[Lang.General.note_a+"#(1)","1"],[Lang.General.note_b+"(2)","2"],[Lang.General.note_c+"(3)","3"],[Lang.General.note_c+"#(4)","4"],[Lang.General.note_d+"(5)","5"],[Lang.General.note_d+"#(6)","6"],[Lang.General.note_e+"(7)","7"],[Lang.General.note_f+"(8)","8"],[Lang.General.note_f+"#(9)","9"],[Lang.General.note_g+"(10)","10"],[Lang.General.note_g+"#(11)","11"],[Lang.General.note_a+"(12)","12"],[Lang.General.note_a+"#(13)","13"],[Lang.General.note_b+ -"(14)","14"],[Lang.General.note_c+"(15)","15"],[Lang.General.note_c+"#(16)","16"],[Lang.General.note_d+"(17)","17"],[Lang.General.note_d+"#(18)","18"],[Lang.General.note_e+"(19)","19"],[Lang.General.note_f+"(20)","20"],[Lang.General.note_f+"#(21)","21"],[Lang.General.note_g+"(22)","22"],[Lang.General.note_g+"#(23)","23"],[Lang.General.note_a+"(24)","24"],[Lang.General.note_a+"#(25)","25"],[Lang.General.note_b+"(26)","26"],[Lang.General.note_c+"(27)","27"],[Lang.General.note_c+"#(28)","28"],[Lang.General.note_d+ -"(29)","29"],[Lang.General.note_d+"#(30)","30"],[Lang.General.note_e+"(31)","31"],[Lang.General.note_f+"(32)","32"],[Lang.General.note_f+"#(33)","33"],[Lang.General.note_g+"(34)","34"],[Lang.General.note_g+"#(35)","35"],[Lang.General.note_a+"(36)","36"],[Lang.General.note_a+"#(37)","37"],[Lang.General.note_b+"(38)","38"],[Lang.General.note_c+"(39)","39"],[Lang.General.note_c+"#(40)","40"],[Lang.General.note_d+"(41)","41"],[Lang.General.note_d+"#(42)","42"],[Lang.General.note_e+"(43)","43"],[Lang.General.note_f+ -"(44)","44"],[Lang.General.note_f+"#(45)","45"],[Lang.General.note_g+"(46)","46"],[Lang.General.note_g+"#(47)","47"],[Lang.General.note_a+"(48)","48"],[Lang.General.note_a+"#(49)","49"],[Lang.General.note_b+"(50)","50"],[Lang.General.note_c+"(51)","51"]],value:"0",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["1"]},null],type:"robotis_openCM70_cm_buzzer_index"},paramsKeyMap:{CM_BUZZER_INDEX:0, -CM_BUZZER_TIME:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.getField("CM_BUZZER_INDEX",a),c=a.getNumberValue("CM_BUZZER_TIME",a),e=Entry.Robotis_openCM70.INSTRUCTION.WRITE,f=0,g=0,h=0,k=0,l=0,f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_BUZZER_TIME[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_BUZZER_TIME[1],h=parseInt(10*c);50c&&(c=0);return Entry.Robotis_carCont.postCallReturn(a, -[[e,f+(d-1)*g,g,c]],Entry.Robotis_openCM70.delay)},syntax:{js:[],py:["Robotis.opencm70_aux_servo_position(%1, %2)"]}},robotis_openCM70_aux_led_module:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.robotis_common_port_3,"3"],[Lang.Blocks.robotis_common_port_4,"4"],[Lang.Blocks.robotis_common_port_5,"5"],[Lang.Blocks.robotis_common_port_6,"6"]],value:"3",fontSize:11},{type:"Dropdown",options:[[Lang.Blocks.robotis_cm_led_both+Lang.Blocks.robotis_common_off, -"0"],[Lang.Blocks.robotis_cm_led_right+Lang.Blocks.robotis_common_on,"1"],[Lang.Blocks.robotis_cm_led_left+Lang.Blocks.robotis_common_on,"2"],[Lang.Blocks.robotis_cm_led_both+Lang.Blocks.robotis_common_on,"3"]],value:"0",fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"robotis_openCM70_aux_led_module"},paramsKeyMap:{PORT:0,LED_MODULE:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.getField("PORT", -a),c=a.getField("LED_MODULE",a),e=Entry.Robotis_openCM70.INSTRUCTION.WRITE,f=0,g=0,f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_LED_MODULE[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_LED_MODULE[1];return Entry.Robotis_carCont.postCallReturn(a,[[e,f+(d-1)*g,g,c]],Entry.Robotis_openCM70.delay)},syntax:{js:[],py:["Robotis.opencm70_aux_led_module(%1, %2)"]}},robotis_openCM70_aux_custom:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.robotis_common_port_3, -"3"],[Lang.Blocks.robotis_common_port_4,"4"],[Lang.Blocks.robotis_common_port_5,"5"],[Lang.Blocks.robotis_common_port_6,"6"]],value:"3",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["0"]},null],type:"robotis_openCM70_aux_custom"},paramsKeyMap:{PORT:0,VALUE:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.getField("PORT",a),c=a.getNumberValue("VALUE"), -e=Entry.Robotis_openCM70.INSTRUCTION.WRITE,f=0,g=0,f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1];return Entry.Robotis_carCont.postCallReturn(a,[[e,f+(d-1)*g,g,c]],Entry.Robotis_openCM70.delay)},syntax:{js:[],py:["Robotis.opencm70_aux_custom(%1, %2)"]}},robotis_openCM70_cm_custom:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png", -size:12}],events:{},def:{params:[{type:"number",params:["0"]},{type:"number",params:["0"]},null],type:"robotis_openCM70_cm_custom"},paramsKeyMap:{ADDRESS:0,VALUE:1},"class":"robotis_openCM70_custom",isNotFor:["robotis_openCM70"],func:function(b,a){var d=Entry.Robotis_openCM70.INSTRUCTION.WRITE,c=0,e=0,c=a.getNumberValue("ADDRESS"),e=a.getNumberValue("VALUE");return Entry.Robotis_carCont.postCallReturn(a,[[d,c,65535d&&(d=0);createjs.Sound.setVolume(d);return a.callReturn()}, -syntax:{js:[],py:["Entry.add_volume(%1)"]}},sound_volume_set:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"sound_volume_set"},paramsKeyMap:{VALUE:0},"class":"sound_volume",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a)/100;1d&&(d=0);createjs.Sound.setVolume(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_volume(%1)"]}}, -sound_silent_all:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[null],type:"sound_silent_all"},"class":"sound_stop",isNotFor:[],func:function(b,a){createjs.Sound.stop();return a.callReturn()},syntax:{js:[],py:["Entry.stop_sound()"]}},get_sounds:{color:"#A4D01D",skeleton:"basic_string_field",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"sounds",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_SOUNDS}], -events:{},def:{params:[null],type:"get_sounds"},paramsKeyMap:{VALUE:0},func:function(b,a){return a.getStringField("VALUE")},syntax:{js:[],py:["%1get_sounds#"]}},sound_something_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},null],type:"sound_something_with_block"},paramsKeyMap:{VALUE:0},"class":"sound_play",isNotFor:[],func:function(b,a){var d=a.getStringValue("VALUE", -a);(d=b.parent.getSound(d))&&createjs.Sound.play(d.id);return a.callReturn()},syntax:{js:[],py:["Entry.play_sound(%1)"]}},sound_something_second_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds",id:"95dw"},{type:"number",params:["1"]},null],type:"sound_something_second_with_block"},paramsKeyMap:{VALUE:0,SECOND:1},"class":"sound_play", -isNotFor:[],func:function(b,a){var d=a.getStringValue("VALUE",a),c=a.getNumberValue("SECOND",a);(d=b.parent.getSound(d))&&createjs.Sound.play(d.id,{startTime:0,duration:1E3*c});return a.callReturn()},syntax:{js:[],py:["Entry.play_sound_for_seconds(%1, %2)"]}},sound_something_wait_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},null],type:"sound_something_wait_with_block"}, -paramsKeyMap:{VALUE:0},"class":"sound_wait",isNotFor:[],func:function(b,a){if(a.isPlay){if(1==a.playState)return a;delete a.playState;delete a.isPlay;return a.callReturn()}a.isPlay=!0;a.playState=1;var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d))createjs.Sound.play(d.id),setTimeout(function(){a.playState=0},1E3*d.duration);return a},syntax:{js:[],py:["Entry.play_sound_and_wait(%1)"]}},sound_something_second_wait_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block", -accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},{type:"number",params:["1"]},null],type:"sound_something_second_wait_with_block"},paramsKeyMap:{VALUE:0,SECOND:1},"class":"sound_wait",isNotFor:[],func:function(b,a){if(a.isPlay){if(1==a.playState)return a;delete a.isPlay;delete a.playState;return a.callReturn()}a.isPlay=!0;a.playState=1;var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d)){var c= -createjs.Sound.play(d.id),d=a.getNumberValue("SECOND",a);setTimeout(function(){c.stop();a.playState=0},1E3*d);c.addEventListener("complete",function(a){})}return a},syntax:{js:[],py:["Entry.play_sound_for_seconds_and_wait(%1, %2)"]}},sound_from_to:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},{type:"text", -params:["1"]},{type:"text",params:["10"]},null],type:"sound_from_to"},paramsKeyMap:{VALUE:0,START:1,END:2},"class":"sound_play",isNotFor:[],func:function(b,a){var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d)){var c=1E3*a.getNumberValue("START",a),e=1E3*a.getNumberValue("END",a);createjs.Sound.play(d.id,{startTime:Math.min(c,e),duration:Math.max(c,e)-Math.min(c,e)})}return a.callReturn()},syntax:{js:[],py:["Entry.play_sound_from_to_seconds(%1, %2, %3)"]}},sound_from_to_and_wait:{color:"#A4D01D", -skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},{type:"text",params:["1"]},{type:"text",params:["10"]},null],type:"sound_from_to_and_wait"},paramsKeyMap:{VALUE:0,START:1,END:2},"class":"sound_wait",isNotFor:[],func:function(b,a){if(a.isPlay){if(1==a.playState)return a;delete a.isPlay;delete a.playState;return a.callReturn()}a.isPlay= -!0;a.playState=1;var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d)){var c=1E3*a.getNumberValue("START",a),e=1E3*a.getNumberValue("END",a),f=Math.min(c,e),c=Math.max(c,e)-f;createjs.Sound.play(d.id,{startTime:f,duration:c});setTimeout(function(){a.playState=0},c)}return a},syntax:{js:[],py:["Entry.play_sound_from_to_seconds_and_wait(%1, %2, %3)"]}},when_run_button_click:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_play.png",size:17, -position:{x:0,y:-2}}],events:{},def:{params:[null],type:"when_run_button_click"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"start",syntax:{js:[],py:["def entry_event_start():"]}},press_some_key:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_keyboard.png",size:17,position:{x:0,y:-2}},{type:"Dropdown",options:[["q","81"],["w","87"],["e","69"],["r","82"],["a","65"],["s","83"],["d","68"],["\uc704\ucabd \ud654\uc0b4\ud45c", -"38"],["\uc544\ub798\ucabd \ud654\uc0b4\ud45c","40"],["\uc67c\ucabd \ud654\uc0b4\ud45c","37"],["\uc624\ub978\ucabd \ud654\uc0b4\ud45c","39"],["\uc5d4\ud130","13"],["\uc2a4\ud398\uc774\uc2a4","32"]],value:"81",fontSize:11},{type:"Indicator",img:"block_icon/start_03.png",size:12}],events:{},def:{params:[null,null,null]},paramsKeyMap:{VALUE:1},func:function(b,a){return a.callReturn()},syntax:{js:[],py:[""]}},when_some_key_pressed:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator", -img:"block_icon/start_icon_keyboard.png",size:17,position:{x:0,y:-2}},{type:"Keyboard",value:"81"}],events:{},def:{params:[null,"81"],type:"when_some_key_pressed"},paramsKeyMap:{VALUE:1},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"keyPress",syntax:{js:[],py:["def entry_event_key(%2):"]}},mouse_clicked:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null], -type:"mouse_clicked"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"mouse_clicked",syntax:{js:[],py:["def entry_event_mouse_down():"]}},mouse_click_cancled:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"mouse_click_cancled"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"mouse_click_cancled",syntax:{js:[], -py:["def entry_event_mouse_up():"]}},when_object_click:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"when_object_click"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"when_object_click",syntax:{js:[],py:["def entry_event_object_down():"]}},when_object_click_canceled:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator", -img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"when_object_click_canceled"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"when_object_click_canceled",syntax:{js:[],py:["def entry_event_object_up():"]}},when_some_key_click:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_keyboard.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null]},func:function(b, -a){return a.callReturn()},event:"keyPress",syntax:{js:[],py:["Entry.on_key_press_down(%1)"]}},when_message_cast:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_signal.png",size:17,position:{x:0,y:-2}},{type:"DropdownDynamic",value:null,menuName:"messages",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_START}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_messageRefs",b)}],viewDestroy:[function(b){var a=Entry.variableContainer; -a&&a.removeRef("_messageRefs",b)}]},def:{params:[null,null],type:"when_message_cast"},paramsKeyMap:{VALUE:1},"class":"message",isNotFor:["message"],func:function(b,a){return a.callReturn()},event:"when_message_cast",syntax:{js:[],py:["def entry_event_signal(%2):"]}},message_cast:{color:"#3BBD70",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"messages",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_START},{type:"Indicator",img:"block_icon/start_03.png",size:12}], -events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_messageRefs",b)}],viewDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_messageRefs",b)}]},def:{params:[null,null],type:"message_cast"},paramsKeyMap:{VALUE:0},"class":"message",isNotFor:["message"],func:function(b,a){var d=a.getField("VALUE",a),c=Entry.isExist(d,"id",Entry.variableContainer.messages_);if("null"==d||!c)throw Error("value can not be null or undefined");Entry.engine.raiseMessage(d)},syntax:{js:[], -py:["Entry.send_signal(%1)"]}},message_cast_wait:{color:"#3BBD70",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"messages",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_START},{type:"Indicator",img:"block_icon/start_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_messageRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_messageRefs",b)}]},def:{params:[null,null],type:"message_cast_wait"}, -paramsKeyMap:{VALUE:0},"class":"message",isNotFor:["message"],func:function(b,a){if(a.runningScript){for(var d=a.runningScript,c=d.length,e=0;ed.array_.length)throw Error("can not remove value from array");d.array_.splice(c-1,1);d.updateView();return a.callReturn()},syntax:{js:[],py:["%2.pop(%1)"]}},insert_value_to_list:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a= -Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[{type:"text",params:["10"]},null,{type:"text",params:["1"]},null],type:"insert_value_to_list"},paramsKeyMap:{DATA:0,LIST:1,INDEX:2},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getValue("DATA",a),e=a.getValue("INDEX",a),d=Entry.variableContainer.getList(d,b);if(!d.array_||isNaN(e)||0== -e||e>d.array_.length+1)throw Error("can not insert value to array");d.array_.splice(e-1,0,{data:c});d.updateView();return a.callReturn()},syntax:{js:[],py:["%2.insert(%3, %1)"]}},change_value_list_index:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a= -Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,{type:"text",params:["1"]},{type:"text",params:["10"]},null],type:"change_value_list_index"},paramsKeyMap:{LIST:0,INDEX:1,DATA:2},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getValue("DATA",a),e=a.getValue("INDEX",a),d=Entry.variableContainer.getList(d,b);if(!d.array_||isNaN(e)|| -e>d.array_.length)throw Error("can not insert value to array");d.array_[e-1].data=c;d.updateView();return a.callReturn()},syntax:{js:[],py:["%1[%2] = %3"]}},value_of_index_from_list:{color:"#E457DC",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.VARIABLE_value_of_index_from_list_1,color:"white"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Text",text:Lang.Blocks.VARIABLE_value_of_index_from_list_2, -color:"white"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.VARIABLE_value_of_index_from_list_3,color:"white"}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null,null,{type:"number",params:["1"]}],type:"value_of_index_from_list"},paramsKeyMap:{LIST:1,INDEX:3},"class":"list_element",isNotFor:["list","listNotExist"],func:function(b, -a){var d=a.getField("LIST",a),c=a.getValue("INDEX",a),d=Entry.variableContainer.getList(d,b),c=Entry.getListRealIndex(c,d);if(!d.array_||isNaN(c)||c>d.array_.length)throw Error("can not insert value to array");return d.array_[c-1].data},syntax:{js:[],py:["%2[%4]"]}},length_of_list:{color:"#E457DC",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.VARIABLE_length_of_list_1,color:"white"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE}, -{type:"Text",text:Lang.Blocks.VARIABLE_length_of_list_2,color:"white"}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null,null],type:"length_of_list"},paramsKeyMap:{LIST:1},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a);return Entry.variableContainer.getList(d,b).array_.length},syntax:{js:[],py:["len(%2)"]}}, -show_list:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null],type:"show_list"},paramsKeyMap:{LIST:0},"class":"list_visibility", -isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a);Entry.variableContainer.getList(d).setVisible(!0);return a.callReturn()},syntax:{js:[],py:["Entry.show_list(%1)"]}},hide_list:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs", -b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null],type:"hide_list"},paramsKeyMap:{LIST:0},"class":"list_visibility",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a);Entry.variableContainer.getList(d).setVisible(!1);return a.callReturn()},syntax:{js:[],py:["Entry.hide_list(%1)"]}},options_for_list:{color:"#E457DC",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["\uccab\ubc88\uc9f8", -"FIRST"],["\ub9c8\uc9c0\ub9c9","LAST"],["\ubb34\uc791\uc704","RANDOM"]],value:"FIRST",fontSize:11}],events:{},def:{params:[null]},paramsKeyMap:{OPERATOR:0},func:function(b,a){return a.getField("OPERATOR",a)},syntax:{js:[],py:[""]}},set_visible_answer:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.CALC_timer_visible_show,"SHOW"],[Lang.Blocks.CALC_timer_visible_hide,"HIDE"]],value:"SHOW",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Indicator", -img:"block_icon/variable_03.png",size:12}],events:{viewAdd:[function(b){Entry.container&&Entry.container.showProjectAnswer()}],viewDestroy:[function(b){Entry.container&&Entry.container.hideProjectAnswer(b)}]},def:{params:["HIDE",null],type:"set_visible_answer"},paramsKeyMap:{BOOL:0},"class":"ask",isNotFor:[],func:function(b,a){"HIDE"==a.getField("BOOL",a)?Entry.container.inputValue.setVisible(!1):Entry.container.inputValue.setVisible(!0);return a.callReturn()},syntax:{js:[],py:["Entry.answer_mode(%1)"]}}, -is_included_in_list:{color:"#E457DC",skeleton:"basic_boolean_field",statements:[],params:[{type:"Text",text:Lang.Blocks.VARIABLE_is_included_in_list_1,color:"white"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Text",text:Lang.Blocks.VARIABLE_is_included_in_list_2,color:"white"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.VARIABLE_is_included_in_list_3,color:"white"}],events:{dataAdd:[function(b){var a=Entry.variableContainer; -a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null,null,{type:"text",params:["10"]},null],type:"is_included_in_list"},paramsKeyMap:{LIST:1,DATA:3},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getStringValue("DATA",a),d=Entry.variableContainer.getList(d,b);if(!d)return!1;for(var d=d.array_,e=0,f=d.length;ek&&(k=Math.round(k-155),g=-k,h=0,Entry.dplay.vel_value=g);if(a.isStart){if(1==a.timeFlag)return Entry.hw.setDigitalPortValue(3,0),Entry.hw.setDigitalPortValue(5, -0),Entry.hw.setDigitalPortValue(6,0),Entry.hw.setDigitalPortValue(11,0),a;if(2==a.timeFlag)return Entry.hw.setDigitalPortValue(d,g),Entry.hw.setDigitalPortValue(c,h),Entry.hw.setDigitalPortValue(e,g),Entry.hw.setDigitalPortValue(f,h),delete a.isStart,delete a.timeFlag,Entry.engine.isContinue=!1,a.callReturn()}else{a.isStart=!0;a.timeFlag=1;var l=setTimeout(function(){a.timeFlag=2;Entry.dplay.removeTimeout(l)},50);Entry.dplay.timeouts.push(l);return a}},syntax:{js:[],py:["Dplay.dc_motor_speed(%1, %2)"]}}, -dplay_buzzer:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[],template:"\ub514\uc9c0\ud138 10\ubc88 \ubd80\uc800\ub97c %1 %2 %3 \ubc15\uc790\ub85c \uc5f0\uc8fc\ud558\uae30",params:[{type:"Dropdown",options:[["\ub3c4","1"],["\ub3c4#","2"],["\ub808","3"],["\ubbf8b","4"],["\ubbf8","5"],["\ud30c","6"],["\ud30c#","7"],["\uc194","8"],["\uc194#","9"],["\ub77c","10"],["\uc2dcb","11"],["\uc2dc","12"],["\ubb34\uc74c","100"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown", -options:[["1","1"],["2","2"],["3","3"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:["1","1",{type:"text",params:["0.5"]},null],type:"dplay_buzzer"},paramsKeyMap:{NOTE:0,OCTAVE:1,VALUE:2},"class":"dplay_set",isNotFor:["dplay"],func:function(b,a){if(a.isStart){if(1==a.timeFlag)return a;Entry.hw.setDigitalPortValue(10,100);delete a.isStart;delete a.timeFlag;Entry.engine.isContinue= -!1;return a.callReturn()}var d=a.getNumberField("NOTE",a),c=a.getNumberField("OCTAVE",a),e=a.getNumberValue("VALUE"),c=d+12*(c-1),e=6E4*e/60;a.isStart=!0;a.timeFlag=1;100==d?Entry.hw.setDigitalPortValue(10,100):Entry.hw.setDigitalPortValue(10,c);if(100q?(m=Math.round(q-155),g=-m,h=0,Entry.dplay.Left_value=g):0==q&&(h=g=0,Entry.dplay.Left_value=0));"2"==n&&(e=6,f=11,0q?(m=Math.round(q-155),k=-m,l=0,Entry.dplay.Right_value=k):0==q&&(l=k=0,Entry.dplay.Right_value=k));"3"==n&&(d=3,c=5,e=6,f=11,0q?(m=Math.round(q-155),g=-m,h=0,k=-m,l=0,Entry.dplay.Left_value=g,Entry.dplay.Right_value=k):0==q&&(l=k=h=g=0,Entry.dplay.Left_value=0,Entry.dplay.Right_value=0));if(a.isStart){if(1==a.timeFlag)return Entry.hw.setDigitalPortValue(3,0),Entry.hw.setDigitalPortValue(5,0),Entry.hw.setDigitalPortValue(6,0),Entry.hw.setDigitalPortValue(11,0),a;if(2==a.timeFlag)return Entry.hw.setDigitalPortValue(d,g),Entry.hw.setDigitalPortValue(c,h),Entry.hw.setDigitalPortValue(e,l),Entry.hw.setDigitalPortValue(f, -k),delete a.isStart,delete a.timeFlag,Entry.engine.isContinue=!1,a.callReturn()}else{a.isStart=!0;a.timeFlag=1;var r=setTimeout(function(){a.timeFlag=2;Entry.dplay.removeTimeout(r)},50);Entry.dplay.timeouts.push(r);return a}}},dplay_robot_speed_set:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[],template:"\uc624\ub978\ucabd \ubc14\ud034 %1 \uc67c\ucabd \ubc14\ud034 %2(\uc73c)\ub85c \uc815\ud558\uae30 %3",params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator", -img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["100"]},{type:"text",params:["100"]},null],type:"dplay_robot_speed_set"},paramsKeyMap:{R_VALUE:0,L_VALUE:1},"class":"dplay_robot",isNotFor:["dplay"],func:function(b,a){var d=0,c=0,e=0,f=0,g=0,g=0,g=a.getNumberValue("L_VALUE",a),g=Math.max(g,-100),g=Math.min(g,100);0g?(g=Math.round(g-155),d=-g,c=0,Entry.dplay.Left_value=d):0==g&&(c=d=0,Entry.dplay.Left_value= -0);g=a.getNumberValue("R_VALUE",a);g=Math.max(g,-100);g=Math.min(g,100);0g?(g=Math.round(g-155),e=-g,f=0,Entry.dplay.Right_value=e):0==g&&(f=e=0,Entry.dplay.Right_value=0);if(a.isStart){if(1==a.timeFlag)return Entry.hw.setDigitalPortValue(3,0),Entry.hw.setDigitalPortValue(5,0),Entry.hw.setDigitalPortValue(6,0),Entry.hw.setDigitalPortValue(11,0),a;if(2==a.timeFlag)return Entry.hw.setDigitalPortValue(3,d),Entry.hw.setDigitalPortValue(5,c), -Entry.hw.setDigitalPortValue(6,f),Entry.hw.setDigitalPortValue(11,e),delete a.isStart,delete a.timeFlag,Entry.engine.isContinue=!1,a.callReturn()}else{a.isStart=!0;a.timeFlag=1;var h=setTimeout(function(){a.timeFlag=2;Entry.dplay.removeTimeout(h)},50);Entry.dplay.timeouts.push(h);return a}},syntax:{js:[],py:["Dplay.robot_speed_sel(%1, %2)"]}},dplay_robot_stop:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[],template:"\ub85c\ubd07\uc744 \uc815\uc9c0\ud558\uae30 %1",params:[{type:"Indicator", -img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"dplay_robot_stop"},paramsKeyMap:{},"class":"dplay_robot",isNotFor:["dplay"],func:function(b,a){Entry.hw.setDigitalPortValue(3,0);Entry.hw.setDigitalPortValue(5,0);Entry.hw.setDigitalPortValue(11,0);Entry.hw.setDigitalPortValue(6,0);return a.callReturn()},syntax:{js:[],py:["Dplay.robot_stop()"]}},nemoino_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_sensor_number"}], -type:"nemoino_get_number_sensor_value"},"class":"arduino_value",syntax:{js:[],py:["Nemoino.sensor_value(%1)"]}},nemoino_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_port_number"}],type:"nemoino_get_digital_value"},"class":"arduino_value",syntax:{js:[],py:["Nemoino.digital_value(%1)"]}},nemoino_toggle_led:{parent:"arduino_toggle_led",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"nemoino_toggle_led"}, -"class":"arduino_set",syntax:{js:[],py:["Nemoino.toggle_led(%1)"]}},nemoino_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"nemoino_toggle_pwm"},"class":"arduino_set",syntax:{js:[],py:["Nemoino.toggle_pwm(%1, %2)"]}},nemoino_convert_scale:{parent:"arduino_convert_scale",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number"}]}, -{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"nemoino_convert_scale"},"class":"arduino",syntax:{js:[],py:["Nemoino.convert_scale(%1, %2, %3, %4, %5)"]}},sensorBoard_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_sensor_number"}],type:"sensorBoard_get_number_sensor_value"},"class":"arduino_value",syntax:{js:[],py:["hw.sensorBoard_get_number_sensor_value(%1)"]}}, -sensorBoard_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_port_number"}],type:"sensorBoard_get_digital_value"},"class":"arduino_value",syntax:{js:[],py:["hw.sensorBoard_get_digital_value(%1)"]}},sensorBoard_toggle_led:{parent:"arduino_toggle_led",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"sensorBoard_toggle_led"},"class":"arduino_set",syntax:{js:[],py:["hw.sensorBoard_toggle_led(%1)"]}},sensorBoard_toggle_pwm:{parent:"arduino_toggle_pwm", -isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"sensorBoard_toggle_pwm"},"class":"arduino_set",syntax:{js:[],py:["hw.sensorBoard_toggle_pwm(%1, %2)"]}},sensorBoard_convert_scale:{parent:"arduino_convert_scale",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number",id:"bl5e"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]}, -{type:"number",params:["100"]}],type:"sensorBoard_convert_scale"},"class":"arduino",syntax:{js:[],py:["hw.sensorBoard_convert_scale(%1, %2, %3, %4, %5)"]}},ardublock_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_sensor_number"}],type:"ardublock_get_number_sensor_value"},"class":"arduino_value"},ardublock_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_port_number"}], -type:"ardublock_get_digital_value"},"class":"arduino_value"},ardublock_toggle_led:{parent:"arduino_toggle_led",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"ardublock_toggle_led"},"class":"arduino_set"},ardublock_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"ardublock_toggle_pwm"},"class":"arduino_set"},ardublock_convert_scale:{parent:"arduino_convert_scale", -isNotFor:["ardublock"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"ardublock_convert_scale"},"class":"arduino"},joystick_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["joystick"],def:{params:[{type:"arduino_get_sensor_number"}],type:"joystick_get_number_sensor_value"},"class":"arduino_value"}, -joystick_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["joystick"],def:{params:[{type:"arduino_get_port_number"}],type:"joystick_get_digital_value"},"class":"arduino_value"},joystick_toggle_led:{parent:"arduino_toggle_led",isNotFor:["joystick"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"joystick_toggle_led"},"class":"arduino_set"},joystick_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["joystick"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text", -params:["255"]},null],type:"joystick_toggle_pwm"},"class":"arduino_set"},joystick_convert_scale:{parent:"arduino_convert_scale",isNotFor:["joystick"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"joystick_convert_scale"},"class":"arduino"},ebs_if:{parent:"_if",def:{type:"_if",params:[{type:"reach_something",params:[null, -"wall"]}]}},ebs_if2:{parent:"_if",def:{type:"_if",params:[{type:"reach_something",params:[null,"cwz5"]}]}},ai_move_right:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope","move"],params:[{type:"Image",img:"/img/assets/week/blocks/moveStep.png",size:24}],func:function(b,a){if(a.isStart){if(a.isAction)return Entry.STATIC.BREAK;delete a.isAction;delete a.isStart}else{a.isStart=!0;a.isAction=!0;Ntry.dispatchEvent("gridChange",function(){a.isAction=!1});Ntry.entityManager.getComponent(b.id, -Ntry.STATIC.SPACE_SHIP).direction=Ntry.STATIC.EAST;var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.GRID);Ntry.entityManager.addComponent(b.id,{type:Ntry.STATIC.ANIMATE,animateType:Ntry.STATIC.ROTATE_TO,animateValue:0});d.x++;return Entry.STATIC.BREAK}}},ai_move_up:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope","up"],params:[{type:"Image",img:"/img/assets/week/blocks/ai_move_up.png",size:24}],func:function(b,a){if(a.isStart){if(a.isAction)return a;delete a.isAction;delete a.isStart; -return a.callReturn()}a.isStart=!0;a.isAction=!0;Ntry.dispatchEvent("gridChange",function(){a.isAction=!1});Ntry.entityManager.getComponent(b.id,Ntry.STATIC.SPACE_SHIP).direction=Ntry.STATIC.NORTH;var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.GRID);Ntry.entityManager.addComponent(b.id,{type:Ntry.STATIC.ANIMATE,animateType:Ntry.STATIC.ROTATE_TO,animateValue:-45});d.x++;d.y--;return a}},ai_move_down:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope","down"],params:[{type:"Image", -img:"/img/assets/week/blocks/ai_move_down.png",size:24}],func:function(b,a){if(a.isStart){if(a.isAction)return a;delete a.isAction;delete a.isStart;return a.callReturn()}a.isStart=!0;a.isAction=!0;Ntry.dispatchEvent("gridChange",function(){a.isAction=!1});Ntry.entityManager.getComponent(b.id,Ntry.STATIC.SPACE_SHIP).direction=Ntry.STATIC.SOUTH;var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.GRID);Ntry.entityManager.addComponent(b.id,{type:Ntry.STATIC.ANIMATE,animateType:Ntry.STATIC.ROTATE_TO, +null],type:"neobot_left_motor"},paramsKeyMap:{DIRECTION:0,SPEED:1},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){var d=a.getNumberField("SPEED"),c=a.getNumberField("DIRECTION");Entry.hw.sendQueue.DCL=d+c;return a.callReturn()},syntax:{js:[],py:["Neobot.turn_left(%1, %2)"]}},neobot_stop_left_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc67c\ucabd \ubaa8\ud130\ub97c \uc815\uc9c0 %1",params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null], +type:"neobot_stop_left_motor"},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){Entry.hw.sendQueue.DCL=0;return a.callReturn()},syntax:{js:[],py:["Neobot.stop_left()"]}},neobot_right_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc624\ub978\ucabd \ubaa8\ud130\ub97c %1 %2 \uc758 \uc18d\ub3c4\ub85c \ud68c\uc804 %3",params:[{type:"Dropdown",options:[["\uc55e\uc73c\ub85c","16"],["\ub4a4\ub85c","32"]],value:"16",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown", +options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],value:"0",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,"15",null],type:"neobot_right_motor"},paramsKeyMap:{DIRECTION:0,SPEED:1},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){var d=a.getNumberField("SPEED"),c= +a.getNumberField("DIRECTION");Entry.hw.sendQueue.DCR=d+c;return a.callReturn()},syntax:{js:[],py:["Neobot.turn_right(%1, %2)"]}},neobot_stop_right_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc624\ub978\ucabd \ubaa8\ud130\ub97c \uc815\uc9c0 %1",params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"neobot_stop_right_motor"},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){Entry.hw.sendQueue.DCR=0;return a.callReturn()}, +syntax:{js:[],py:["Neobot.stop_right()"]}},neobot_all_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc591\ucabd \ubaa8\ud130\ub97c %1 %2\uc758 \uc18d\ub3c4\ub85c %3\ucd08 \ub3d9\uc548 \ud68c\uc804 %4",params:[{type:"Dropdown",options:[["\uc55e\uc73c\ub85c","1"],["\ub4a4\ub85c","2"],["\uc81c\uc790\ub9ac\uc5d0\uc11c \uc67c\ucabd \ub3cc\uae30","3"],["\uc81c\uc790\ub9ac\uc5d0\uc11c \uc624\ub978\ucabd \ub3cc\uae30","4"],["\uc67c\ucabd\uc73c\ub85c \ub3cc\uae30","5"],["\uc624\ub978\ucabd\uc73c\ub85c \ub3cc\uae30", +"6"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:["1","15",{type:"number",params:["0"]}],type:"neobot_all_motor"}, +paramsKeyMap:{DIRECTION:0,SPEED:1,DURATION:2},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){if(a.isStart){if(1==a.timeFlag)return a;delete a.timeFlag;delete a.isStart;Entry.hw.sendQueue.DCL=0;Entry.hw.sendQueue.DCR=0;Entry.engine.isContinue=!1;return a.callReturn()}var d=a.getNumberField("SPEED"),c=a.getNumberField("DIRECTION"),e=a.getNumberValue("DURATION");0>e&&(e=0);switch(c){case 1:Entry.hw.sendQueue.DCL=16+d;Entry.hw.sendQueue.DCR=16+d;break;case 2:Entry.hw.sendQueue.DCL=32+d; +Entry.hw.sendQueue.DCR=32+d;break;case 3:Entry.hw.sendQueue.DCL=32+d;Entry.hw.sendQueue.DCR=16+d;break;case 4:Entry.hw.sendQueue.DCL=16+d;Entry.hw.sendQueue.DCR=32+d;break;case 5:Entry.hw.sendQueue.DCL=0;Entry.hw.sendQueue.DCR=16+d;break;case 6:Entry.hw.sendQueue.DCL=16+d,Entry.hw.sendQueue.DCR=0}if(0===e)return a.callReturn();a.isStart=!0;a.timeFlag=1;setTimeout(function(){a.timeFlag=0},1E3*e);return a}},neobot_stop_all_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc591\ucabd \ubaa8\ud130\ub97c \uc815\uc9c0 %1", +params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"neobot_stop_all_motor"},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){Entry.hw.sendQueue.DCL=0;Entry.hw.sendQueue.DCR=0;return a.callReturn()},syntax:{js:[],py:["Neobot.run_motor(%1, %2, %3, %4)"]}},neobot_set_servo:{color:"#00979D",skeleton:"basic",statements:[],template:"%1 \ud3ec\ud2b8\uc758 \uc11c\ubcf4\ubaa8\ud130\ub97c %2 \ub3c4 \uc774\ub3d9 %3",params:[{type:"Dropdown",options:[["OUT1", +"1"],["OUT2","2"],["OUT3","3"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"neobot_set_servo"},paramsKeyMap:{PORT:0,DEGREE:1},"class":"neobot_output",isNotFor:["neobot"],func:function(b,a){var d=a.getNumberField("PORT"),c=a.getNumberValue("DEGREE");0>c?c=0:180c?c=0:255d.count)throw d.count++,new Entry.Utils.AsyncError;d.isStart=!1;c=Entry.hw.portData[d.data_default_address]; +d.data_default_address=void 0;return c},syntax:{js:[],py:["Robotis.opencm70_cm_custom_value(%1, %2)"]}},robotis_openCM70_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.robotis_cm_sound_detected,"CM_SOUND_DETECTED"],[Lang.Blocks.robotis_cm_sound_detecting,"CM_SOUND_DETECTING"],[Lang.Blocks.robotis_cm_user_button,"CM_USER_BUTTON"]],value:"CM_SOUND_DETECTED",fontSize:11}],events:{},def:{params:[null],type:"robotis_openCM70_sensor_value"}, +paramsKeyMap:{SENSOR:0},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.executor.scope;if(!d.isStart){d.isStart=!0;d.count=0;var c=Entry.Robotis_openCM70.INSTRUCTION.READ,e=0,f=0,g=0,h=0,k=a.getStringField("SENSOR");"CM_SOUND_DETECTED"==k?(g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[0],h=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[0],f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[1]): +"CM_SOUND_DETECTING"==k?(g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[0],h=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[0],f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[1]):"CM_USER_BUTTON"==k&&(g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[0],h=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[0],f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[1]); +g+=0*h;Entry.Robotis_carCont.setRobotisData([[c,e,f,0,h]]);Entry.Robotis_carCont.update();d.data_default_address=g;throw new Entry.Utils.AsyncError;}if(2>d.count)throw d.count++,new Entry.Utils.AsyncError;d.isStart=!1;c=Entry.hw.portData[d.data_default_address];d.data_default_address=void 0;return c},syntax:{js:[],py:["Robotis.opencm70_sensor_value(%1)"]}},robotis_openCM70_aux_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["3", +"PORT_3"],["4","PORT_4"],["5","PORT_5"],["6","PORT_6"]],value:"PORT_3",fontSize:11},{type:"Dropdown",options:[[Lang.Blocks.robotis_aux_servo_position,"AUX_SERVO_POSITION"],[Lang.Blocks.robotis_aux_ir,"AUX_IR"],[Lang.Blocks.robotis_aux_touch,"AUX_TOUCH"],[Lang.Blocks.robotis_aux_brightness,"AUX_BRIGHTNESS"],[Lang.Blocks.robotis_aux_hydro_themo_humidity,"AUX_HYDRO_THEMO_HUMIDITY"],[Lang.Blocks.robotis_aux_hydro_themo_temper,"AUX_HYDRO_THEMO_TEMPER"],[Lang.Blocks.robotis_aux_temperature,"AUX_TEMPERATURE"], +[Lang.Blocks.robotis_aux_ultrasonic,"AUX_ULTRASONIC"],[Lang.Blocks.robotis_aux_magnetic,"AUX_MAGNETIC"],[Lang.Blocks.robotis_aux_motion_detection,"AUX_MOTION_DETECTION"],[Lang.Blocks.robotis_aux_color,"AUX_COLOR"],[Lang.Blocks.robotis_aux_custom,"AUX_CUSTOM"]],value:"AUX_SERVO_POSITION",fontSize:11}],events:{},def:{params:[null,null],type:"robotis_openCM70_aux_sensor_value"},paramsKeyMap:{PORT:0,SENSOR:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.executor.scope; +if(!d.isStart){d.isStart=!0;d.count=0;var c=Entry.Robotis_openCM70.INSTRUCTION.READ,e=0,f=0,g=0,h=a.getStringField("PORT"),k=a.getStringField("SENSOR"),l=0;"PORT_3"==h?l=2:"PORT_4"==h?l=3:"PORT_5"==h?l=4:"PORT_6"==h&&(l=5);"AUX_SERVO_POSITION"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[1]):"AUX_IR"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[1], +e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[1]):"AUX_TOUCH"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[1]):"AUX_TEMPERATURE"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[1]):"AUX_BRIGHTNESS"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[1], +e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[1]):"AUX_HYDRO_THEMO_HUMIDITY"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[1]):"AUX_HYDRO_THEMO_TEMPER"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[1]): +"AUX_ULTRASONIC"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[1]):"AUX_MAGNETIC"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[1]):"AUX_MOTION_DETECTION"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[1], +e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[1]):"AUX_COLOR"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[1]):"AUX_CUSTOM"==k&&(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1]);f+=l*g;Entry.Robotis_carCont.setRobotisData([[c,f,e,0,g]]);Entry.Robotis_carCont.update(); +d.data_default_address=f;throw new Entry.Utils.AsyncError;}if(2>d.count)throw d.count++,new Entry.Utils.AsyncError;d.isStart=!1;c=Entry.hw.portData[d.data_default_address];d.data_default_address=void 0;return c},syntax:{js:[],py:["Robotis.opencm70_aux_sensor_value(%1, %2)"]}},robotis_openCM70_cm_buzzer_index:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.General.note_a+"(0)","0"],[Lang.General.note_a+"#(1)","1"],[Lang.General.note_b+"(2)","2"],[Lang.General.note_c+ +"(3)","3"],[Lang.General.note_c+"#(4)","4"],[Lang.General.note_d+"(5)","5"],[Lang.General.note_d+"#(6)","6"],[Lang.General.note_e+"(7)","7"],[Lang.General.note_f+"(8)","8"],[Lang.General.note_f+"#(9)","9"],[Lang.General.note_g+"(10)","10"],[Lang.General.note_g+"#(11)","11"],[Lang.General.note_a+"(12)","12"],[Lang.General.note_a+"#(13)","13"],[Lang.General.note_b+"(14)","14"],[Lang.General.note_c+"(15)","15"],[Lang.General.note_c+"#(16)","16"],[Lang.General.note_d+"(17)","17"],[Lang.General.note_d+ +"#(18)","18"],[Lang.General.note_e+"(19)","19"],[Lang.General.note_f+"(20)","20"],[Lang.General.note_f+"#(21)","21"],[Lang.General.note_g+"(22)","22"],[Lang.General.note_g+"#(23)","23"],[Lang.General.note_a+"(24)","24"],[Lang.General.note_a+"#(25)","25"],[Lang.General.note_b+"(26)","26"],[Lang.General.note_c+"(27)","27"],[Lang.General.note_c+"#(28)","28"],[Lang.General.note_d+"(29)","29"],[Lang.General.note_d+"#(30)","30"],[Lang.General.note_e+"(31)","31"],[Lang.General.note_f+"(32)","32"],[Lang.General.note_f+ +"#(33)","33"],[Lang.General.note_g+"(34)","34"],[Lang.General.note_g+"#(35)","35"],[Lang.General.note_a+"(36)","36"],[Lang.General.note_a+"#(37)","37"],[Lang.General.note_b+"(38)","38"],[Lang.General.note_c+"(39)","39"],[Lang.General.note_c+"#(40)","40"],[Lang.General.note_d+"(41)","41"],[Lang.General.note_d+"#(42)","42"],[Lang.General.note_e+"(43)","43"],[Lang.General.note_f+"(44)","44"],[Lang.General.note_f+"#(45)","45"],[Lang.General.note_g+"(46)","46"],[Lang.General.note_g+"#(47)","47"],[Lang.General.note_a+ +"(48)","48"],[Lang.General.note_a+"#(49)","49"],[Lang.General.note_b+"(50)","50"],[Lang.General.note_c+"(51)","51"]],value:"0",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["1"]},null],type:"robotis_openCM70_cm_buzzer_index"},paramsKeyMap:{CM_BUZZER_INDEX:0,CM_BUZZER_TIME:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.getField("CM_BUZZER_INDEX",a), +c=a.getNumberValue("CM_BUZZER_TIME",a),e=Entry.Robotis_openCM70.INSTRUCTION.WRITE,f=0,g=0,h=0,k=0,l=0,f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_BUZZER_TIME[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_BUZZER_TIME[1],h=parseInt(10*c);50c&&(c=0);return Entry.Robotis_carCont.postCallReturn(a,[[e,f+(d-1)*g,g,c]],Entry.Robotis_openCM70.delay)},syntax:{js:[],py:["Robotis.opencm70_aux_servo_position(%1, %2)"]}},robotis_openCM70_aux_led_module:{color:"#00979D", +skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.robotis_common_port_3,"3"],[Lang.Blocks.robotis_common_port_4,"4"],[Lang.Blocks.robotis_common_port_5,"5"],[Lang.Blocks.robotis_common_port_6,"6"]],value:"3",fontSize:11},{type:"Dropdown",options:[[Lang.Blocks.robotis_cm_led_both+Lang.Blocks.robotis_common_off,"0"],[Lang.Blocks.robotis_cm_led_right+Lang.Blocks.robotis_common_on,"1"],[Lang.Blocks.robotis_cm_led_left+Lang.Blocks.robotis_common_on,"2"],[Lang.Blocks.robotis_cm_led_both+ +Lang.Blocks.robotis_common_on,"3"]],value:"0",fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"robotis_openCM70_aux_led_module"},paramsKeyMap:{PORT:0,LED_MODULE:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.getField("PORT",a),c=a.getField("LED_MODULE",a),e=Entry.Robotis_openCM70.INSTRUCTION.WRITE,f=0,g=0,f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_LED_MODULE[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_LED_MODULE[1]; +return Entry.Robotis_carCont.postCallReturn(a,[[e,f+(d-1)*g,g,c]],Entry.Robotis_openCM70.delay)},syntax:{js:[],py:["Robotis.opencm70_aux_led_module(%1, %2)"]}},robotis_openCM70_aux_custom:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.robotis_common_port_3,"3"],[Lang.Blocks.robotis_common_port_4,"4"],[Lang.Blocks.robotis_common_port_5,"5"],[Lang.Blocks.robotis_common_port_6,"6"]],value:"3",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator", +img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["0"]},null],type:"robotis_openCM70_aux_custom"},paramsKeyMap:{PORT:0,VALUE:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.getField("PORT",a),c=a.getNumberValue("VALUE"),e=Entry.Robotis_openCM70.INSTRUCTION.WRITE,f=0,g=0,f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1];return Entry.Robotis_carCont.postCallReturn(a, +[[e,f+(d-1)*g,g,c]],Entry.Robotis_openCM70.delay)},syntax:{js:[],py:["Robotis.opencm70_aux_custom(%1, %2)"]}},robotis_openCM70_cm_custom:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"number",params:["0"]},{type:"number",params:["0"]},null],type:"robotis_openCM70_cm_custom"},paramsKeyMap:{ADDRESS:0,VALUE:1},"class":"robotis_openCM70_custom", +isNotFor:["robotis_openCM70"],func:function(b,a){var d=Entry.Robotis_openCM70.INSTRUCTION.WRITE,c=0,e=0,c=a.getNumberValue("ADDRESS"),e=a.getNumberValue("VALUE");return Entry.Robotis_carCont.postCallReturn(a,[[d,c,65535d&&(d=0);createjs.Sound.setVolume(d);return a.callReturn()},syntax:{js:[],py:["Entry.add_volume(%1)"]}},sound_volume_set:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"}, +{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"sound_volume_set"},paramsKeyMap:{VALUE:0},"class":"sound_volume",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a)/100;1d&&(d=0);createjs.Sound.setVolume(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_volume(%1)"]}},sound_silent_all:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/sound_03.png",size:12}], +events:{},def:{params:[null],type:"sound_silent_all"},"class":"sound_stop",isNotFor:[],func:function(b,a){createjs.Sound.stop();return a.callReturn()},syntax:{js:[],py:["Entry.stop_sound()"]}},get_sounds:{color:"#A4D01D",skeleton:"basic_string_field",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"sounds",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_SOUNDS}],events:{},def:{params:[null],type:"get_sounds"},paramsKeyMap:{VALUE:0},func:function(b,a){return a.getStringField("VALUE")}, +syntax:{js:[],py:["%1get_sounds#"]}},sound_something_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},null],type:"sound_something_with_block"},paramsKeyMap:{VALUE:0},"class":"sound_play",isNotFor:[],func:function(b,a){var d=a.getStringValue("VALUE",a);(d=b.parent.getSound(d))&&createjs.Sound.play(d.id);return a.callReturn()},syntax:{js:[],py:["Entry.play_sound(%1)"]}}, +sound_something_second_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds",id:"95dw"},{type:"number",params:["1"]},null],type:"sound_something_second_with_block"},paramsKeyMap:{VALUE:0,SECOND:1},"class":"sound_play",isNotFor:[],func:function(b,a){var d=a.getStringValue("VALUE",a),c=a.getNumberValue("SECOND",a);(d=b.parent.getSound(d))&& +createjs.Sound.play(d.id,{startTime:0,duration:1E3*c});return a.callReturn()},syntax:{js:[],py:["Entry.play_sound_for_seconds(%1, %2)"]}},sound_something_wait_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},null],type:"sound_something_wait_with_block"},paramsKeyMap:{VALUE:0},"class":"sound_wait",isNotFor:[],func:function(b,a){if(a.isPlay){if(1==a.playState)return a; +delete a.playState;delete a.isPlay;return a.callReturn()}a.isPlay=!0;a.playState=1;var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d))createjs.Sound.play(d.id),setTimeout(function(){a.playState=0},1E3*d.duration);return a},syntax:{js:[],py:["Entry.play_sound_and_wait(%1)"]}},sound_something_second_wait_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{}, +def:{params:[{type:"get_sounds"},{type:"number",params:["1"]},null],type:"sound_something_second_wait_with_block"},paramsKeyMap:{VALUE:0,SECOND:1},"class":"sound_wait",isNotFor:[],func:function(b,a){if(a.isPlay){if(1==a.playState)return a;delete a.isPlay;delete a.playState;return a.callReturn()}a.isPlay=!0;a.playState=1;var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d)){var c=createjs.Sound.play(d.id),d=a.getNumberValue("SECOND",a);setTimeout(function(){c.stop();a.playState=0},1E3*d);c.addEventListener("complete", +function(a){})}return a},syntax:{js:[],py:["Entry.play_sound_for_seconds_and_wait(%1, %2)"]}},sound_from_to:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},{type:"text",params:["1"]},{type:"text",params:["10"]},null],type:"sound_from_to"},paramsKeyMap:{VALUE:0,START:1,END:2},"class":"sound_play",isNotFor:[], +func:function(b,a){var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d)){var c=1E3*a.getNumberValue("START",a),e=1E3*a.getNumberValue("END",a);createjs.Sound.play(d.id,{startTime:Math.min(c,e),duration:Math.max(c,e)-Math.min(c,e)})}return a.callReturn()},syntax:{js:[],py:["Entry.play_sound_from_to_seconds(%1, %2, %3)"]}},sound_from_to_and_wait:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"}, +{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},{type:"text",params:["1"]},{type:"text",params:["10"]},null],type:"sound_from_to_and_wait"},paramsKeyMap:{VALUE:0,START:1,END:2},"class":"sound_wait",isNotFor:[],func:function(b,a){if(a.isPlay){if(1==a.playState)return a;delete a.isPlay;delete a.playState;return a.callReturn()}a.isPlay=!0;a.playState=1;var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d)){var c=1E3*a.getNumberValue("START", +a),e=1E3*a.getNumberValue("END",a),f=Math.min(c,e),c=Math.max(c,e)-f;createjs.Sound.play(d.id,{startTime:f,duration:c});setTimeout(function(){a.playState=0},c)}return a},syntax:{js:[],py:["Entry.play_sound_from_to_seconds_and_wait(%1, %2, %3)"]}},when_run_button_click:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_play.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"when_run_button_click"},"class":"event",isNotFor:[], +func:function(b,a){return a.callReturn()},event:"start",syntax:{js:[],py:["def entry_event_start():"]}},press_some_key:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_keyboard.png",size:17,position:{x:0,y:-2}},{type:"Dropdown",options:[["q","81"],["w","87"],["e","69"],["r","82"],["a","65"],["s","83"],["d","68"],["\uc704\ucabd \ud654\uc0b4\ud45c","38"],["\uc544\ub798\ucabd \ud654\uc0b4\ud45c","40"],["\uc67c\ucabd \ud654\uc0b4\ud45c","37"], +["\uc624\ub978\ucabd \ud654\uc0b4\ud45c","39"],["\uc5d4\ud130","13"],["\uc2a4\ud398\uc774\uc2a4","32"]],value:"81",fontSize:11},{type:"Indicator",img:"block_icon/start_03.png",size:12}],events:{},def:{params:[null,null,null]},paramsKeyMap:{VALUE:1},func:function(b,a){return a.callReturn()},syntax:{js:[],py:[""]}},when_some_key_pressed:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_keyboard.png",size:17,position:{x:0,y:-2}},{type:"Keyboard", +value:"81"}],events:{},def:{params:[null,"81"],type:"when_some_key_pressed"},paramsKeyMap:{VALUE:1},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"keyPress",syntax:{js:[],py:["def entry_event_key(%2):"]}},mouse_clicked:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"mouse_clicked"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()}, +event:"mouse_clicked",syntax:{js:[],py:["def entry_event_mouse_down():"]}},mouse_click_cancled:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"mouse_click_cancled"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"mouse_click_cancled",syntax:{js:[],py:["def entry_event_mouse_up():"]}},when_object_click:{color:"#3BBD70",skeleton:"basic_event", +statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"when_object_click"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"when_object_click",syntax:{js:[],py:["def entry_event_object_down():"]}},when_object_click_canceled:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null], +type:"when_object_click_canceled"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"when_object_click_canceled",syntax:{js:[],py:["def entry_event_object_up():"]}},when_some_key_click:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_keyboard.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null]},func:function(b,a){return a.callReturn()},event:"keyPress",syntax:{js:[],py:["Entry.on_key_press_down(%1)"]}}, +when_message_cast:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_signal.png",size:17,position:{x:0,y:-2}},{type:"DropdownDynamic",value:null,menuName:"messages",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_START}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_messageRefs",b)}],viewDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_messageRefs",b)}]},def:{params:[null,null],type:"when_message_cast"}, +paramsKeyMap:{VALUE:1},"class":"message",isNotFor:["message"],func:function(b,a){return a.callReturn()},event:"when_message_cast",syntax:{js:[],py:["def entry_event_signal(%2):"]}},message_cast:{color:"#3BBD70",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"messages",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_START},{type:"Indicator",img:"block_icon/start_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_messageRefs", +b)}],viewDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_messageRefs",b)}]},def:{params:[null,null],type:"message_cast"},paramsKeyMap:{VALUE:0},"class":"message",isNotFor:["message"],func:function(b,a){var d=a.getField("VALUE",a),c=Entry.isExist(d,"id",Entry.variableContainer.messages_);if("null"==d||!c)throw Error("value can not be null or undefined");Entry.engine.raiseMessage(d)},syntax:{js:[],py:["Entry.send_signal(%1)"]}},message_cast_wait:{color:"#3BBD70",skeleton:"basic", +statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"messages",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_START},{type:"Indicator",img:"block_icon/start_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_messageRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_messageRefs",b)}]},def:{params:[null,null],type:"message_cast_wait"},paramsKeyMap:{VALUE:0},"class":"message",isNotFor:["message"],func:function(b,a){if(a.runningScript){for(var d= +a.runningScript,c=d.length,e=0;ed.array_.length)throw Error("can not remove value from array"); +d.array_.splice(c-1,1);d.updateView();return a.callReturn()},syntax:{js:[],py:["%2.pop(%1)"]}},insert_value_to_list:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a= +Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[{type:"text",params:["10"]},null,{type:"text",params:["1"]},null],type:"insert_value_to_list"},paramsKeyMap:{DATA:0,LIST:1,INDEX:2},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getValue("DATA",a),e=a.getValue("INDEX",a),d=Entry.variableContainer.getList(d,b);if(!d.array_||isNaN(e)||0==e||e>d.array_.length+1)throw Error("can not insert value to array");d.array_.splice(e-1, +0,{data:c});d.updateView();return a.callReturn()},syntax:{js:[],py:["%2.insert(%3, %1)"]}},change_value_list_index:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a= +Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,{type:"text",params:["1"]},{type:"text",params:["10"]},null],type:"change_value_list_index"},paramsKeyMap:{LIST:0,INDEX:1,DATA:2},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getValue("DATA",a),e=a.getValue("INDEX",a),d=Entry.variableContainer.getList(d,b);if(!d.array_||isNaN(e)||e>d.array_.length)throw Error("can not insert value to array");d.array_[e-1].data=c;d.updateView(); +return a.callReturn()},syntax:{js:[],py:["%1[%2] = %3"]}},value_of_index_from_list:{color:"#E457DC",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.VARIABLE_value_of_index_from_list_1,color:"white"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Text",text:Lang.Blocks.VARIABLE_value_of_index_from_list_2,color:"white"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.VARIABLE_value_of_index_from_list_3, +color:"white"}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null,null,{type:"number",params:["1"]}],type:"value_of_index_from_list"},paramsKeyMap:{LIST:1,INDEX:3},"class":"list_element",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getValue("INDEX",a),d=Entry.variableContainer.getList(d,b),c=Entry.getListRealIndex(c, +d);if(!d.array_||isNaN(c)||c>d.array_.length)throw Error("can not insert value to array");return d.array_[c-1].data},syntax:{js:[],py:["%2[%4]"]}},length_of_list:{color:"#E457DC",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.VARIABLE_length_of_list_1,color:"white"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Text",text:Lang.Blocks.VARIABLE_length_of_list_2,color:"white"}],events:{dataAdd:[function(b){var a= +Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null,null],type:"length_of_list"},paramsKeyMap:{LIST:1},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a);return Entry.variableContainer.getList(d,b).array_.length},syntax:{js:[],py:["len(%2)"]}},show_list:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null, +menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null],type:"show_list"},paramsKeyMap:{LIST:0},"class":"list_visibility",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a);Entry.variableContainer.getList(d).setVisible(!0); +return a.callReturn()},syntax:{js:[],py:["Entry.show_list(%1)"]}},hide_list:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null, +null],type:"hide_list"},paramsKeyMap:{LIST:0},"class":"list_visibility",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a);Entry.variableContainer.getList(d).setVisible(!1);return a.callReturn()},syntax:{js:[],py:["Entry.hide_list(%1)"]}},options_for_list:{color:"#E457DC",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["\uccab\ubc88\uc9f8","FIRST"],["\ub9c8\uc9c0\ub9c9","LAST"],["\ubb34\uc791\uc704","RANDOM"]],value:"FIRST",fontSize:11}], +events:{},def:{params:[null]},paramsKeyMap:{OPERATOR:0},func:function(b,a){return a.getField("OPERATOR",a)},syntax:{js:[],py:[""]}},set_visible_answer:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.CALC_timer_visible_show,"SHOW"],[Lang.Blocks.CALC_timer_visible_hide,"HIDE"]],value:"SHOW",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{viewAdd:[function(b){Entry.container&& +Entry.container.showProjectAnswer()}],viewDestroy:[function(b){Entry.container&&Entry.container.hideProjectAnswer(b)}]},def:{params:["HIDE",null],type:"set_visible_answer"},paramsKeyMap:{BOOL:0},"class":"ask",isNotFor:[],func:function(b,a){"HIDE"==a.getField("BOOL",a)?Entry.container.inputValue.setVisible(!1):Entry.container.inputValue.setVisible(!0);return a.callReturn()},syntax:{js:[],py:["Entry.answer_mode(%1)"]}},is_included_in_list:{color:"#E457DC",skeleton:"basic_boolean_field",statements:[], +params:[{type:"Text",text:Lang.Blocks.VARIABLE_is_included_in_list_1,color:"white"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Text",text:Lang.Blocks.VARIABLE_is_included_in_list_2,color:"white"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.VARIABLE_is_included_in_list_3,color:"white"}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer; +a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null,null,{type:"text",params:["10"]},null],type:"is_included_in_list"},paramsKeyMap:{LIST:1,DATA:3},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getStringValue("DATA",a),d=Entry.variableContainer.getList(d,b);if(!d)return!1;for(var d=d.array_,e=0,f=d.length;ek&&(k=Math.round(k-155),g=-k,h=0,Entry.dplay.vel_value=g);if(a.isStart){if(1==a.timeFlag)return Entry.hw.setDigitalPortValue(3,0),Entry.hw.setDigitalPortValue(5,0),Entry.hw.setDigitalPortValue(6,0),Entry.hw.setDigitalPortValue(11,0),a;if(2==a.timeFlag)return Entry.hw.setDigitalPortValue(d,g),Entry.hw.setDigitalPortValue(c,h),Entry.hw.setDigitalPortValue(e,g),Entry.hw.setDigitalPortValue(f, +h),delete a.isStart,delete a.timeFlag,Entry.engine.isContinue=!1,a.callReturn()}else{a.isStart=!0;a.timeFlag=1;var l=setTimeout(function(){a.timeFlag=2;Entry.dplay.removeTimeout(l)},50);Entry.dplay.timeouts.push(l);return a}},syntax:{js:[],py:["Dplay.dc_motor_speed(%1, %2)"]}},dplay_buzzer:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[],template:"\ub514\uc9c0\ud138 10\ubc88 \ubd80\uc800\ub97c %1 %2 %3 \ubc15\uc790\ub85c \uc5f0\uc8fc\ud558\uae30",params:[{type:"Dropdown",options:[["\ub3c4", +"1"],["\ub3c4#","2"],["\ub808","3"],["\ubbf8b","4"],["\ubbf8","5"],["\ud30c","6"],["\ud30c#","7"],["\uc194","8"],["\uc194#","9"],["\ub77c","10"],["\uc2dcb","11"],["\uc2dc","12"],["\ubb34\uc74c","100"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown",options:[["1","1"],["2","2"],["3","3"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:["1","1", +{type:"text",params:["0.5"]},null],type:"dplay_buzzer"},paramsKeyMap:{NOTE:0,OCTAVE:1,VALUE:2},"class":"dplay_set",isNotFor:["dplay"],func:function(b,a){if(a.isStart){if(1==a.timeFlag)return a;Entry.hw.setDigitalPortValue(10,100);delete a.isStart;delete a.timeFlag;Entry.engine.isContinue=!1;return a.callReturn()}var d=a.getNumberField("NOTE",a),c=a.getNumberField("OCTAVE",a),e=a.getNumberValue("VALUE"),c=d+12*(c-1),e=6E4*e/60;a.isStart=!0;a.timeFlag=1;100==d?Entry.hw.setDigitalPortValue(10,100):Entry.hw.setDigitalPortValue(10, +c);if(100q?(m=Math.round(q-155),g=-m,h=0,Entry.dplay.Left_value=g):0==q&&(h=g=0,Entry.dplay.Left_value=0));"2"==n&&(e=6,f=11,0q?(m=Math.round(q-155),k=-m,l=0,Entry.dplay.Right_value=k):0==q&&(l=k=0,Entry.dplay.Right_value=k));"3"==n&&(d=3,c=5,e=6,f=11,0q?(m=Math.round(q-155),g=-m,h=0,k=-m,l=0,Entry.dplay.Left_value=g,Entry.dplay.Right_value=k):0==q&&(l=k=h=g=0,Entry.dplay.Left_value=0,Entry.dplay.Right_value=0));if(a.isStart){if(1==a.timeFlag)return Entry.hw.setDigitalPortValue(3,0),Entry.hw.setDigitalPortValue(5,0),Entry.hw.setDigitalPortValue(6, +0),Entry.hw.setDigitalPortValue(11,0),a;if(2==a.timeFlag)return Entry.hw.setDigitalPortValue(d,g),Entry.hw.setDigitalPortValue(c,h),Entry.hw.setDigitalPortValue(e,l),Entry.hw.setDigitalPortValue(f,k),delete a.isStart,delete a.timeFlag,Entry.engine.isContinue=!1,a.callReturn()}else{a.isStart=!0;a.timeFlag=1;var r=setTimeout(function(){a.timeFlag=2;Entry.dplay.removeTimeout(r)},50);Entry.dplay.timeouts.push(r);return a}}},dplay_robot_speed_set:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[], +template:"\uc624\ub978\ucabd \ubc14\ud034 %1 \uc67c\ucabd \ubc14\ud034 %2(\uc73c)\ub85c \uc815\ud558\uae30 %3",params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["100"]},{type:"text",params:["100"]},null],type:"dplay_robot_speed_set"},paramsKeyMap:{R_VALUE:0,L_VALUE:1},"class":"dplay_robot",isNotFor:["dplay"],func:function(b,a){var d=0,c=0,e=0,f=0,g=0,g=0,g=a.getNumberValue("L_VALUE", +a),g=Math.max(g,-100),g=Math.min(g,100);0g?(g=Math.round(g-155),d=-g,c=0,Entry.dplay.Left_value=d):0==g&&(c=d=0,Entry.dplay.Left_value=0);g=a.getNumberValue("R_VALUE",a);g=Math.max(g,-100);g=Math.min(g,100);0g?(g=Math.round(g-155),e=-g,f=0,Entry.dplay.Right_value=e):0==g&&(f=e=0,Entry.dplay.Right_value=0);if(a.isStart){if(1==a.timeFlag)return Entry.hw.setDigitalPortValue(3,0),Entry.hw.setDigitalPortValue(5, +0),Entry.hw.setDigitalPortValue(6,0),Entry.hw.setDigitalPortValue(11,0),a;if(2==a.timeFlag)return Entry.hw.setDigitalPortValue(3,d),Entry.hw.setDigitalPortValue(5,c),Entry.hw.setDigitalPortValue(6,f),Entry.hw.setDigitalPortValue(11,e),delete a.isStart,delete a.timeFlag,Entry.engine.isContinue=!1,a.callReturn()}else{a.isStart=!0;a.timeFlag=1;var h=setTimeout(function(){a.timeFlag=2;Entry.dplay.removeTimeout(h)},50);Entry.dplay.timeouts.push(h);return a}},syntax:{js:[],py:["Dplay.robot_speed_sel(%1, %2)"]}}, +dplay_robot_stop:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[],template:"\ub85c\ubd07\uc744 \uc815\uc9c0\ud558\uae30 %1",params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"dplay_robot_stop"},paramsKeyMap:{},"class":"dplay_robot",isNotFor:["dplay"],func:function(b,a){Entry.hw.setDigitalPortValue(3,0);Entry.hw.setDigitalPortValue(5,0);Entry.hw.setDigitalPortValue(11,0);Entry.hw.setDigitalPortValue(6,0);return a.callReturn()},syntax:{js:[], +py:["Dplay.robot_stop()"]}},nemoino_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_sensor_number"}],type:"nemoino_get_number_sensor_value"},"class":"arduino_value",syntax:{js:[],py:["Nemoino.sensor_value(%1)"]}},nemoino_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_port_number"}],type:"nemoino_get_digital_value"},"class":"arduino_value",syntax:{js:[],py:["Nemoino.digital_value(%1)"]}}, +nemoino_toggle_led:{parent:"arduino_toggle_led",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"nemoino_toggle_led"},"class":"arduino_set",syntax:{js:[],py:["Nemoino.toggle_led(%1)"]}},nemoino_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"nemoino_toggle_pwm"},"class":"arduino_set",syntax:{js:[],py:["Nemoino.toggle_pwm(%1, %2)"]}},nemoino_convert_scale:{parent:"arduino_convert_scale", +isNotFor:["nemoino"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"nemoino_convert_scale"},"class":"arduino",syntax:{js:[],py:["Nemoino.convert_scale(%1, %2, %3, %4, %5)"]}},sensorBoard_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_sensor_number"}], +type:"sensorBoard_get_number_sensor_value"},"class":"arduino_value",syntax:{js:[],py:["hw.sensorBoard_get_number_sensor_value(%1)"]}},sensorBoard_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_port_number"}],type:"sensorBoard_get_digital_value"},"class":"arduino_value",syntax:{js:[],py:["hw.sensorBoard_get_digital_value(%1)"]}},sensorBoard_toggle_led:{parent:"arduino_toggle_led",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_port_number"}, +null,null],type:"sensorBoard_toggle_led"},"class":"arduino_set",syntax:{js:[],py:["hw.sensorBoard_toggle_led(%1)"]}},sensorBoard_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"sensorBoard_toggle_pwm"},"class":"arduino_set",syntax:{js:[],py:["hw.sensorBoard_toggle_pwm(%1, %2)"]}},sensorBoard_convert_scale:{parent:"arduino_convert_scale",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_number_sensor_value", +params:[{type:"arduino_get_sensor_number",id:"bl5e"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"sensorBoard_convert_scale"},"class":"arduino",syntax:{js:[],py:["hw.sensorBoard_convert_scale(%1, %2, %3, %4, %5)"]}},ardublock_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_sensor_number"}],type:"ardublock_get_number_sensor_value"},"class":"arduino_value"}, +ardublock_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_port_number"}],type:"ardublock_get_digital_value"},"class":"arduino_value"},ardublock_toggle_led:{parent:"arduino_toggle_led",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"ardublock_toggle_led"},"class":"arduino_set"},ardublock_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text", +params:["255"]},null],type:"ardublock_toggle_pwm"},"class":"arduino_set"},ardublock_convert_scale:{parent:"arduino_convert_scale",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"ardublock_convert_scale"},"class":"arduino"},joystick_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["joystick"], +def:{params:[{type:"arduino_get_sensor_number"}],type:"joystick_get_number_sensor_value"},"class":"arduino_value"},joystick_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["joystick"],def:{params:[{type:"arduino_get_port_number"}],type:"joystick_get_digital_value"},"class":"arduino_value"},joystick_toggle_led:{parent:"arduino_toggle_led",isNotFor:["joystick"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"joystick_toggle_led"},"class":"arduino_set"},joystick_toggle_pwm:{parent:"arduino_toggle_pwm", +isNotFor:["joystick"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"joystick_toggle_pwm"},"class":"arduino_set"},joystick_convert_scale:{parent:"arduino_convert_scale",isNotFor:["joystick"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"joystick_convert_scale"},"class":"arduino"}, +ebs_if:{parent:"_if",def:{type:"_if",params:[{type:"reach_something",params:[null,"wall"]}]}},ebs_if2:{parent:"_if",def:{type:"_if",params:[{type:"reach_something",params:[null,"cwz5"]}]}},ai_move_right:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope","move"],params:[{type:"Image",img:"/img/assets/week/blocks/moveStep.png",size:24}],func:function(b,a){if(a.isStart){if(a.isAction)return Entry.STATIC.BREAK;delete a.isAction;delete a.isStart}else{a.isStart=!0;a.isAction=!0;Ntry.dispatchEvent("gridChange", +function(){a.isAction=!1});Ntry.entityManager.getComponent(b.id,Ntry.STATIC.SPACE_SHIP).direction=Ntry.STATIC.EAST;var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.GRID);Ntry.entityManager.addComponent(b.id,{type:Ntry.STATIC.ANIMATE,animateType:Ntry.STATIC.ROTATE_TO,animateValue:0});d.x++;return Entry.STATIC.BREAK}}},ai_move_up:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope","up"],params:[{type:"Image",img:"/img/assets/week/blocks/ai_move_up.png",size:24}],func:function(b,a){if(a.isStart){if(a.isAction)return a; +delete a.isAction;delete a.isStart;return a.callReturn()}a.isStart=!0;a.isAction=!0;Ntry.dispatchEvent("gridChange",function(){a.isAction=!1});Ntry.entityManager.getComponent(b.id,Ntry.STATIC.SPACE_SHIP).direction=Ntry.STATIC.NORTH;var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.GRID);Ntry.entityManager.addComponent(b.id,{type:Ntry.STATIC.ANIMATE,animateType:Ntry.STATIC.ROTATE_TO,animateValue:-45});d.x++;d.y--;return a}},ai_move_down:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope", +"down"],params:[{type:"Image",img:"/img/assets/week/blocks/ai_move_down.png",size:24}],func:function(b,a){if(a.isStart){if(a.isAction)return a;delete a.isAction;delete a.isStart;return a.callReturn()}a.isStart=!0;a.isAction=!0;Ntry.dispatchEvent("gridChange",function(){a.isAction=!1});Ntry.entityManager.getComponent(b.id,Ntry.STATIC.SPACE_SHIP).direction=Ntry.STATIC.SOUTH;var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.GRID);Ntry.entityManager.addComponent(b.id,{type:Ntry.STATIC.ANIMATE,animateType:Ntry.STATIC.ROTATE_TO, animateValue:45});d.x++;d.y++;return a}},ai_repeat_until_reach:{skeleton:"basic_loop",mode:"maze",color:"#498DEB",syntax:["BasicWhile","true"],statements:[{accept:"basic"}],params:[{type:"Image",img:"/img/assets/week/blocks/for.png",size:24}],func:function(){var b=this.block.statements[0];if(0!==b.getBlocks().length)return this.executor.stepInto(b)}},ai_if_else_1:{skeleton:"basic_double_loop",mode:"maze",color:"#498DEB",syntax:["BasicIf","front == 'stone'"],statements:[{accept:"basic"},{accept:"basic"}], params:[{type:"Image",img:"/img/assets/ntry/bitmap/ai/obstacle_1.png",size:24},{type:"Image",img:"/img/assets/week/blocks/for.png",size:24},{type:"LineBreak"}],func:function(b,a){if(a.isLooped)return delete a.isLooped,a.callReturn();var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.RADAR),c=this.block.statements,e=1;a.isLooped=!0;d.center.type==Ntry.STATIC.AI_METEO&&1==d.center.distance&&(e=0);this.executor.stepInto(c[e]);return Entry.STATIC.BREAK}},ai_boolean_distance:{skeleton:"basic_boolean_field", mode:"maze",color:"#2fc9f0",fontColor:"#fff",syntax:["Scope","radar_%1 %2 %3#"],params:[{type:"Dropdown",options:[[Lang.Menus.ai_above,"UP"],[Lang.Menus.ai_front,"RIGHT"],[Lang.Menus.ai_under,"DOWN"]],value:"RIGHT",fontSize:11},{type:"Dropdown",options:[[">","BIGGER"],[">=","BIGGER_EQUAL"],["=","EQUAL"],["<","SMALLER"],["<=","SMALLER_EQUAL"]],value:"BIGGER",fontSize:11},{type:"Block",accept:"string"}],func:function(b,a){var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.RADAR),c=this.block.params, @@ -2369,22 +2368,22 @@ paramsKeyMap:{VALUE:0},"class":"roduino_value",isNotFor:["roborobo_roduino"],fun "class":"roduino_value",isNotFor:["roborobo_roduino"],func:function(b,a){var d=a.getNumberValue("VALUE",a);Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_READ,d]);return Entry.hw.portData[d-2]}},roduino_get_color:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.roborobo_color_red,"red"],[Lang.Blocks.roborobo_color_green,"green"],[Lang.Blocks.roborobo_color_blue,"blue"],[Lang.Blocks.roborobo_color_yellow, "yellow"]],value:"red",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW}],events:{},def:{params:[null],type:"roduino_get_color"},paramsKeyMap:{VALUE:0},"class":"roduino_value",isNotFor:["roborobo_roduino"],func:function(b,a){var d=0,c=a.getField("VALUE",a),e=[Entry.hw.portData[Entry.Roborobo_Roduino.ColorPin[0]-2],Entry.hw.portData[Entry.Roborobo_Roduino.ColorPin[1]-2],Entry.hw.portData[Entry.Roborobo_Roduino.ColorPin[2]-2]];switch(c){case "red":1==e[0]&&0==e[1]&&0==e[2]&&(d=1);break;case "green":0== e[0]&&1==e[1]&&0==e[2]&&(d=1);break;case "blue":0==e[0]&&0==e[1]&&1==e[2]&&(d=1);break;case "yellow":1==e[0]&&1==e[1]&&1==e[2]&&(d=1)}return d}},roduino_set_digital:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.roborobo_on,"on"],[Lang.Blocks.roborobo_off,"off"]],value:"on",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"roduino_get_port_number"}, -null,null],type:"roduino_set_digital"},paramsKeyMap:{VALUE:0,OPERATOR:1},"class":"roduino_set",isNotFor:["roborobo_roduino"],func:function(b,a){var d=a.getNumberValue("VALUE",a),c=a.getField("OPERATOR");Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_WRITE,d,"on"==c?1:0]);return a.callReturn()}},roduino_motor:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.roborobo_motor1,"motor1"],[Lang.Blocks.roborobo_motor2,"motor2"]], +null,null],type:"roduino_set_digital"},paramsKeyMap:{VALUE:0,OPERATOR:1},"class":"roduino_set",isNotFor:["roborobo_roduino"],func:function(b,a){var d=a.getNumberValue("VALUE",a),c="on"==a.getField("OPERATOR")?1:0;Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_WRITE,d,c]);return a.callReturn()}},roduino_motor:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.roborobo_motor1,"motor1"],[Lang.Blocks.roborobo_motor2,"motor2"]], value:"motor1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown",options:[[Lang.Blocks.roborobo_motor_CW,"cw"],[Lang.Blocks.roborobo_motor_CCW,"ccw"],[Lang.Blocks.roborobo_motor_stop,"stop"]],value:"cw",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"roduino_motor"},paramsKeyMap:{MODE:0,OPERATOR:1},"class":"roduino_set",isNotFor:["roborobo_roduino"],func:function(b,a){var d= pin2=0,c=value2=0,d=a.getField("MODE"),c=a.getField("OPERATOR");"motor1"==d?(d=9,pin2=10):(d=11,pin2=12);"cw"==c?(c=1,value2=0):"ccw"==c?(c=0,value2=1):value2=c=0;Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.MOTOR,d,c,pin2,value2]);return a.callReturn()}},roduino_set_color_pin:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png", size:12}],events:{},def:{params:[{type:"number",params:["2"]},{type:"number",params:["3"]},{type:"number",params:["4"]},null],type:"roduino_set_color_pin"},paramsKeyMap:{RED:0,GREEN:1,BLUE:2},"class":"roduino_set",isNotFor:["roborobo_roduino"],func:function(b,a){var d=a.getNumberValue("RED",a),c=a.getNumberValue("GREEN",a),e=a.getNumberValue("BLUE",a);Entry.Roborobo_Roduino.ColorPin=[d,c,e];Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.COLOR,d,c,e]);return a.callReturn()}}, schoolkit_on_block:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"}],events:{},def:{params:[null],type:"schoolkit_on_block"},paramsKeyMap:{},"class":"schoolkit_value",isNotFor:["roborobo_schoolkit"],func:function(b,a){return"1"}},schoolkit_off_block:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"}],events:{},def:{params:[null],type:"schoolkit_off_block"},paramsKeyMap:{}, "class":"schoolkit_value",isNotFor:["roborobo_schoolkit"],func:function(b,a){return"0"}},schoolkit_get_out_port_number:{color:"#00979D",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["OUT1",2],["OUT2",3],["OUT3",4],["OUT4",5],["OUT5",6]],value:2,fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW}],events:{},def:{params:[null]},paramsKeyMap:{PORT:0},func:function(b,a){return a.getNumberField("PORT")}},schoolkit_get_in_port_number:{color:"#00979D",skeleton:"basic_string_field", statements:[],params:[{type:"Dropdown",options:[["IN1",7],["IN2",8],["IN3",9],["IN4",10],["IN5",11],["IN6",12],["IN7",13]],value:7,fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW}],events:{},def:{params:[null]},paramsKeyMap:{PORT:0},func:function(b,a){return a.getNumberField("PORT")}},schoolkit_set_output:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.roborobo_on,"on"],[Lang.Blocks.roborobo_off,"off"]],value:"on",fontSize:11, -arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"schoolkit_get_out_port_number"},null,null],type:"schoolkit_set_output"},paramsKeyMap:{VALUE:0,OPERATOR:1},"class":"schoolkit_set",isNotFor:["roborobo_schoolkit"],func:function(b,a){var d=a.getNumberValue("VALUE",a),c=a.getField("OPERATOR");Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_WRITE,d,"on"==c?1:0]);return a.callReturn()}},schoolkit_get_input_value:{color:"#00979D", +arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"schoolkit_get_out_port_number"},null,null],type:"schoolkit_set_output"},paramsKeyMap:{VALUE:0,OPERATOR:1},"class":"schoolkit_set",isNotFor:["roborobo_schoolkit"],func:function(b,a){var d=a.getNumberValue("VALUE",a),c="on"==a.getField("OPERATOR")?1:0;Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_WRITE,d,c]);return a.callReturn()}},schoolkit_get_input_value:{color:"#00979D", fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"}],events:{},def:{params:[{type:"schoolkit_get_in_port_number"}],type:"schoolkit_get_input_value"},paramsKeyMap:{VALUE:0},"class":"schoolkit_value",isNotFor:["roborobo_schoolkit"],func:function(b,a){var d=a.getNumberValue("VALUE",a);Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_READ,d]);return Entry.hw.portData[d-7]}},schoolkit_motor:{color:"#00979D",skeleton:"basic", statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.roborobo_motor1,"motor1"],[Lang.Blocks.roborobo_motor2,"motor2"]],value:"motor1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.roborobo_motor_CW,"cw"],[Lang.Blocks.roborobo_motor_CCW,"ccw"],[Lang.Blocks.roborobo_motor_stop,"stop"]],value:"cw",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{}, -def:{params:[null,{type:"number",params:["0"]},null,null],type:"schoolkit_motor"},paramsKeyMap:{MODE:0,VALUE:1,OPERATOR:2},"class":"schoolkit_set",isNotFor:["roborobo_schoolkit"],func:function(b,a){var d=0,d=a.getField("MODE"),c=a.getField("OPERATOR"),e=a.getNumberValue("VALUE"),d="motor1"==d?7:8;255e&&(e=0);"cw"==c?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,1,d,e]):"ccw"==c?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, -2,d,e]):"stop"==c&&Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,0,d,e]);return a.callReturn()}},schoolkit_set_servo_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"schoolkit_get_out_port_number"},{type:"number",params:["0"]},null],type:"schoolkit_set_servo_value"},paramsKeyMap:{PIN:0,VALUE:1},"class":"schoolkit_set", +def:{params:[null,{type:"number",params:["0"]},null,null],type:"schoolkit_motor"},paramsKeyMap:{MODE:0,VALUE:1,OPERATOR:2},"class":"schoolkit_set",isNotFor:["roborobo_schoolkit"],func:function(b,a){var d=0,c=0,d=a.getField("MODE"),e=a.getField("OPERATOR"),f=a.getNumberValue("VALUE"),d="motor1"==d?7:8;255f&&(f=0);"cw"==e?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,1,d,f]):"ccw"==e?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, +2,d,f]):"stop"==e&&Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,c,d,f]);return a.callReturn()}},schoolkit_set_servo_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"schoolkit_get_out_port_number"},{type:"number",params:["0"]},null],type:"schoolkit_set_servo_value"},paramsKeyMap:{PIN:0,VALUE:1},"class":"schoolkit_set", isNotFor:["roborobo_schoolkit"],func:function(b,a){var d=a.getNumberValue("PIN",a),c=a.getNumberValue("VALUE");0>c?c=0:180d&& @@ -2452,23 +2451,23 @@ e,g).isPass(f),a=!0),createjs.Sound.play("entryMagneting")):Entry.do("moveBlock" f?this.block.destroy(!1,!0):this.block.doDestroyBelow(!1)}b.setMagnetedBlock(null);a&&Entry.ConnectionRipple.setView(e.view).dispose()}this.destroyShadow();delete this.originPos;this.dominate()};b._updateCloseBlock=function(){var a=this.getBoard(),b;if(this._skeleton.magnets){for(var c in this.magnet)if(b="next"===c?this.getBoard().getNearestMagnet(this.x,this.y+this.getBelowHeight(),c):this.getBoard().getNearestMagnet(this.x,this.y,c))return a.setMagnetedBlock(b.view,c);a.setMagnetedBlock(null)}}; b.dominate=function(){this.block.getThread().view.dominate()};b.getSvgRoot=function(){for(var a=this.getBoard().svgBlockGroup,b=this.svgGroup;b.parentNode!==a;)b=b.parentNode;return b};b.getBoard=function(){return this._board};b._setBoard=function(){this._board=this._board.code.board};b.destroy=function(a){$(this.svgGroup).unbind(".blockViewMousedown");this._destroyObservers();var b=this.svgGroup;a?$(b).fadeOut(100,function(){b.remove()}):b.remove();this._contents.forEach(function(a){a.constructor!== Entry.Block&&a.destroy()});var c=this.block;a=c.events.viewDestroy;"workspace"==Entry.type&&a&&!this.isInBlockMenu&&a.forEach(function(a){Entry.Utils.isFunction(a)&&a(c)});this._schemaChangeEvent&&this._schemaChangeEvent.destroy()};b.getShadow=function(){this._shadow||(this._shadow=Entry.SVG.createElement(this.svgGroup.cloneNode(!0),{opacity:.5}),this.getBoard().svgGroup.appendChild(this._shadow));return this._shadow};b.destroyShadow=function(){this._shadow&&(this._shadow.remove(),delete this._shadow)}; -b._updateMagnet=function(){if(this._skeleton.magnets){var a=this._skeleton.magnets(this);a.next&&this._nextGroup.attr("transform","translate("+a.next.x+","+a.next.y+")");this.magnet=a;this.block.getThread().changeEvent.notify()}};b._updateBG=function(){if(this._board.dragBlock&&this._board.dragBlock.dragInstance){var a=this.svgGroup;if(this.magnet.next){if(a=this.magneting){var b=this._board.dragBlock.getShadow(),c=this.getAbsoluteCoordinate(),e;if("previous"===a)e=this.magnet.next,e="translate("+ -(c.x+e.x)+","+(c.y+e.y)+")";else if("next"===a){e=this.magnet.previous;var f=this._board.dragBlock.getBelowHeight();e="translate("+(c.x+e.x)+","+(c.y+e.y-f)+")"}$(b).attr({transform:e,display:"block"});this._clonedShadow=b;this.background&&(this.background.remove(),this.nextBackground.remove(),delete this.background,delete this.nextBackground);"previous"===a&&(a=this._board.dragBlock.getBelowHeight()+this.offsetY,this.originalHeight=this.offsetY,this.set({offsetY:a}))}else this._clonedShadow&&(this._clonedShadow.attr({display:"none"}), -delete this._clonedShadow),a=this.originalHeight,void 0!==a&&(this.background&&(this.background.remove(),this.nextBackground.remove(),delete this.background,delete this.nextBackground),this.set({offsetY:a}),delete this.originalHeight);(a=this.block.thread.changeEvent)&&a.notify()}else this.magneting?(a.attr({filter:"url(#entryBlockHighlightFilter_"+this.getBoard().suffix+")"}),a.addClass("outputHighlight")):(a.removeClass("outputHighlight"),a.removeAttr("filter"))}};b.addDragging=function(){this.svgGroup.addClass("dragging")}; -b.removeDragging=function(){this.svgGroup.removeClass("dragging")};b.addSelected=function(){this.svgGroup.addClass("selected")};b.removeSelected=function(){this.svgGroup.removeClass("selected")};b.getSkeleton=function(){return this._skeleton};b.getContentPos=function(){return this._skeleton.contentPos(this)};b.renderText=function(){this._startContentRender(Entry.Workspace.MODE_VIMBOARD)};b.renderBlock=function(){this._startContentRender(Entry.Workspace.MODE_BOARD)};b._updateOpacity=function(){this.svgGroup.attr({opacity:!1=== -this.visible?0:1});this.visible&&this._setPosition()};b._updateShadow=function(){this.shadow&&Entry.Utils.colorDarken(this._schema.color,.7)};b._setMovable=function(){this.movable=null!==this.block.isMovable()?this.block.isMovable():void 0!==this._skeleton.movable?this._skeleton.movable:!0};b._setReadOnly=function(){this.readOnly=null!==this.block.isReadOnly()?this.block.isReadOnly():void 0!==this._skeleton.readOnly?this._skeleton.readOnly:!1};b._setCopyable=function(){this.copyable=null!==this.block.isCopyable()? -this.block.isCopyable():void 0!==this._skeleton.copyable?this._skeleton.copyable:!0};b.bumpAway=function(a,b){var c=this;a=a||15;b?window.setTimeout(function(){c._moveBy(a,a,!1)},b):c._moveBy(a,a,!1)};b.bindPrev=function(a){if(a){if(this._toLocalCoordinate(a.view._nextGroup),(a=a.getNextBlock())&&a!==this.block){var b=this.block.getLastBlock();b.view.magnet.next?a.view._toLocalCoordinate(b.view._nextGroup):(a.view._toGlobalCoordinate(),a.separate(),a.view.bumpAway(null,100))}}else if(a=this.block.getPrevBlock())this._toLocalCoordinate(a.view._nextGroup), -(a=this.block.getNextBlock())&&a.view&&a.view._toLocalCoordinate(this._nextGroup)};b.getAbsoluteCoordinate=function(a){a=void 0!==a?a:this.dragMode;if(a===Entry.DRAG_MODE_DRAG)return{x:this.x,y:this.y};a=this.block.getThread().view.requestAbsoluteCoordinate(this);a.x+=this.x;a.y+=this.y;return a};b.getBelowHeight=function(){return this.block.getThread().view.requestPartHeight(this)};b._updateDisplay=function(){this.svgGroup.attr({display:!1===this.display?"none":"block"});this.display&&this._setPosition()}; -b._updateColor=function(){var a=this._schema.color;this.block.deletable===Entry.Block.DELETABLE_FALSE_LIGHTEN&&(a=Entry.Utils.colorLighten(a));this._fillColor=a;this._path.attr({fill:a});this._updateContents()};b._updateContents=function(){for(var a=0;a\s+/g,">").replace(/\s+(svgGroup)(defs)',h=this.svgGroup.getBoundingClientRect(),k=a?this.svgGroup:this.svgGroup.cloneNode(!0),l=this._skeleton.box(this),m=b?1:1.5,n=function(){var a=window.platform; -return a&&"windows"===a.name.toLowerCase()&&"7"===a.version[0]?!0:!1}()?.9:.95;-1<=+-x/".split(""),v=0;v\s+/g, +">").replace(/\s+(svgGroup)(defs)',h=this.svgGroup.getBoundingClientRect(),k=a?this.svgGroup:this.svgGroup.cloneNode(!0), +l=this._skeleton.box(this),m=b?1:1.5,n=function(){var a=window.platform;return a&&"windows"===a.name.toLowerCase()&&"7"===a.version[0]?!0:!1}()?.9:.95;-1<=+-x/".split(""),v=0;ve||c.splice(e,1)}};b.raiseEvent=function(a,b,c){a=this._eventMap[a];var e=[];if(void 0!==a){for(var f=0;fa&&(f=f+e+10,e=0,c=15);e=Math.max(e,k.width);l=c+15;h._moveTo(f-k.x,l,!1);c=c+k.height+15}}this.scroller.resizeScrollBar()};b.clear=function(){this.svgBlockGroup.remove();this.svgThreadGroup.remove()}; b.updateOffset=function(){this._offset=this.svg.getBoundingClientRect();var a=$(window),b=a.scrollTop(),a=a.scrollLeft(),c=this._offset;this.relativeOffset={top:c.top-b,left:c.left-a};this.btnWrapper&&this.btnWrapper.attr({transform:"translate("+(c.width/2-65)+","+(c.height-200)+")"})};b.generateButtons=function(){var a=this,b=this.svgGroup.elem("g");this.btnWrapper=b;var c=b.elem("text",{x:27,y:33,class:"entryFunctionButtonText"});c.textContent=Lang.Buttons.save;var e=b.elem("text",{x:102.5,y:33, class:"entryFunctionButtonText"});e.textContent=Lang.Buttons.cancel;var f=b.elem("circle",{cx:27.5,cy:27.5,r:27.5,class:"entryFunctionButton"}),b=b.elem("circle",{cx:102.5,cy:27.5,r:27.5,class:"entryFunctionButton"});$(f).bind("mousedown touchstart",function(){a.save()});$(c).bind("mousedown touchstart",function(){a.save()});$(b).bind("mousedown touchstart",function(){a.cancelEdit()});$(e).bind("mousedown touchstart",function(){a.cancelEdit()})};b.cancelEdit=function(){this.workspace.setMode(Entry.Workspace.MODE_BOARD, -"cancelEdit")};b.save=function(){this.workspace.setMode(Entry.Workspace.MODE_BOARD,"save")};b.generateCodeMagnetMap=function(){var a=this.code;if(a&&this.dragBlock)for(var b in this.dragBlock.magnet){var c=this._getCodeBlocks(a,b);c.sort(function(a,b){return a.point-b.point});c.unshift({point:-Number.MAX_VALUE,blocks:[]});for(var e=1;eg.point&&(g.blocks.push(h),l++,g=c[l],g););delete f.startBlock}f.endPoint=Number.MAX_VALUE; -c[e-1].endPoint=f.point}this._magnetMap[b]=c}};b._getCodeBlocks=function(a,b){var c=a.getThreads(),e=[],f;switch(b){case "previous":f=this._getNextMagnets;break;case "next":f=this._getPreviousMagnets;break;case "string":f=this._getFieldMagnets;break;case "boolean":f=this._getFieldMagnets;break;case "param":f=this._getOutputMagnets;break;default:return[]}for(var g=0;gc.endPoint)f=h+1;else{e=c.blocks;for(f=0;fh.point&&(h.blocks.push(k), +m++,h=e[m],h););delete g.startBlock}g.endPoint=Number.MAX_VALUE;e[f-1].endPoint=g.point}this._magnetMap[c]=e}}};b._getCodeBlocks=function(a,b){var c=a.getThreads(),e=[],f;switch(b){case "previous":f=this._getNextMagnets;break;case "next":f=this._getPreviousMagnets;break;case "string":case "boolean":f=this._getFieldMagnets;break;case "param":f=this._getOutputMagnets;break;default:return[]}for(var g=0;gc.endPoint)f=h+1;else{e=c.blocks;for(f=0;f 0) { - Entry.container.selectObject(this.getCurrentObjects()[0].id); - } else { - Entry.container.selectObject(); - } - } - else if (this.objects_.length && index === 0) - Entry.container.selectObject(this.getCurrentObjects()[0].id); + if (currentObjects.length) + this.selectObject(currentObjects[0].id); else { - Entry.container.selectObject(); + this.selectObject(); Entry.playground.flushPlayground(); } diff --git a/src/painter2.js b/src/painter2.js index 883a4ba178..7cad9ebec5 100644 --- a/src/painter2.js +++ b/src/painter2.js @@ -2,6 +2,7 @@ Entry.Painter2 = function(view) { this.view = view; + this.baseUrl = Entry.painterBaseUrl || '/lib/literallycanvas/lib/img'; this.file = { id: Entry.generateHash(), @@ -22,7 +23,7 @@ Entry.Painter2 = function(view) { p.initialize = function() { if (this.lc) return; - var imgURL = '/lib/literallycanvas/lib/img'; + var imgURL = this.baseUrl; var bgImage = new Image(); bgImage.src = imgURL + '/transparent-pattern.png'; this.lc = LC.init(this.view, { diff --git a/src/workspace/block.js b/src/workspace/block.js index c2bed63439..bfe91d6ea5 100644 --- a/src/workspace/block.js +++ b/src/workspace/block.js @@ -261,7 +261,7 @@ Entry.Block.DELETABLE_FALSE_LIGHTEN = 3; } else if (parent.constructor === Entry.FieldStatement) { nextBlock.replace(parent._valueBlock); } else nextBlock.view._toGlobalCoordinate(); - } else nextBlock.view && nextBlock.view.bindPrev(prevBlock); + } else nextBlock.view && nextBlock.view.bindPrev(prevBlock, true); } } if (!this.doNotSplice && thread.spliceBlock) thread.spliceBlock(this); diff --git a/src/workspace/block_view.js b/src/workspace/block_view.js index acb41d6c4d..75d075f36e 100644 --- a/src/workspace/block_view.js +++ b/src/workspace/block_view.js @@ -788,7 +788,7 @@ Entry.BlockView.pngMap = {}; return; var blockView = this; var svgGroup = blockView.svgGroup; - if (!this.magnet.next) {// field block + if (!(this.magnet.next || this.magnet.previous)) {// field block if (this.magneting) { svgGroup.attr({ filter: 'url(#entryBlockHighlightFilter_' + this.getBoard().suffix + ')' @@ -931,13 +931,16 @@ Entry.BlockView.pngMap = {}; } else that._moveBy(distance, distance, false); }; - p.bindPrev = function(prevBlock) { + p.bindPrev = function(prevBlock, isDestroy) { if (prevBlock) { this._toLocalCoordinate(prevBlock.view._nextGroup); var nextBlock = prevBlock.getNextBlock(); + if (nextBlock) if (nextBlock && nextBlock !== this.block) { var endBlock = this.block.getLastBlock(); - if (endBlock.view.magnet.next) + if (isDestroy) + nextBlock.view._toLocalCoordinate(prevBlock.view._nextGroup); + else if (endBlock.view.magnet.next) nextBlock.view._toLocalCoordinate(endBlock.view._nextGroup); else { nextBlock.view._toGlobalCoordinate(); @@ -1202,11 +1205,14 @@ Entry.BlockView.pngMap = {}; } }; - p.downloadAsImage = function() { + p.downloadAsImage = function(i) { this.getDataUrl().then(function(data) { var download = document.createElement('a'); download.href = data.src; - download.download = '엔트리 블록.png'; + var name = '엔트리 블록'; + if (i) + name += i; + download.download = name+'.png'; download.click(); }); }; diff --git a/src/workspace/board.js b/src/workspace/board.js index 553581fd7c..854265ba80 100644 --- a/src/workspace/board.js +++ b/src/workspace/board.js @@ -395,9 +395,18 @@ Entry.Board.DRAG_RADIUS = 5; p.generateCodeMagnetMap = function() { var code = this.code; - if (!code || !this.dragBlock) return; + var dragBlock = this.dragBlock; + if (!(code && dragBlock)) return; + + //reset magnetMap + this._magnetMap = {}; + + for (var targetType in dragBlock.magnet) { + if (targetType === 'next' && + dragBlock.block.getLastBlock().view.magnet.next === undefined) { + continue; + } - for (var targetType in this.dragBlock.magnet) { var metaData = this._getCodeBlocks(code, targetType); metaData.sort(function(a, b) {return a.point - b.point;}); @@ -441,8 +450,6 @@ Entry.Board.DRAG_RADIUS = 5; func = this._getPreviousMagnets; break; case "string": - func = this._getFieldMagnets; - break; case "boolean": func = this._getFieldMagnets; break; @@ -942,10 +949,29 @@ Entry.Board.DRAG_RADIUS = 5; text: Lang.Menus.save_as_image_all, enable: true, callback: function(){ - that.code.getThreads().forEach(function(t) { + var threads = that.code.getThreads(); + var images = []; + threads.forEach(function(t,i) { var topBlock = t.getFirstBlock(); if (!topBlock) return; - topBlock.view.downloadAsImage(); + console.log('threads.length=',threads.length); + if (threads.length > 1 && Entry.isOffline) { + topBlock.view.getDataUrl().then(function(data) { + images.push(data); + //console.log('add an image'); + if (images.length == threads.length) { + //console.log('images completely added'); + Entry.dispatchEvent( + 'saveBlockImages', + { images: images } + ); + } + + }); + } else { + topBlock.view.downloadAsImage(++i); + } + }); } }