-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom_babies_ja.m5b
1 lines (1 loc) · 44.2 KB
/
atom_babies_ja.m5b
1
{"category": "ATOM_Babies", "color": "#115f07", "blocks": ["__ATOM_Babies_initAtomBabies", "__ATOM_Babies_updateAtomBabies", "__ATOM_Babies_rgb", "__ATOM_Babies_showFace", "__ATOM_Babies_fillFace", "__ATOM_Babies_clearFace", "__ATOM_Babies_setAutoOrientation", "__ATOM_Babies_isAutoOrientation", "__ATOM_Babies_getOrientation", "__ATOM_Babies_setOrientation", "__ATOM_Babies_getOrientationNormal", "__ATOM_Babies_getOrientationRight", "__ATOM_Babies_getOrientationUpsideDown", "__ATOM_Babies_getOrientationLeft", "__ATOM_Babies_setOrientationNormal", "__ATOM_Babies_setOrientationRight", "__ATOM_Babies_setOrientationUpsideDown", "__ATOM_Babies_setOrientationLeft", "__ATOM_Babies_setFacePositionNormal", "__ATOM_Babies_setFacePositionRight", "__ATOM_Babies_setFacePositionDown", "__ATOM_Babies_setFacePositionLeft", "__ATOM_Babies_setFacePositionUp", "__ATOM_Babies_setFacePositionTop", "__ATOM_Babies_setFacePositionBottom", "__ATOM_Babies_openEyes", "__ATOM_Babies_closeEyes", "__ATOM_Babies_showCheeks", "__ATOM_Babies_clearCheeks", "__ATOM_Babies_startBlink", "__ATOM_Babies_stopBlink", "__ATOM_Babies_startBlinkWithFunction", "__ATOM_Babies_isBlinking", "__ATOM_Babies_getBlinkIntervalValues", "__ATOM_Babies_setDigit", "__ATOM_Babies_scrollDigits", "__ATOM_Babies_setChar", "__ATOM_Babies_scrollText", "__ATOM_Babies_getVersion"], "jscode": "// Block __ATOM_Babies_initAtomBabies\nvar __ATOM_Babies_initAtomBabies_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"ATOM Babiesを初期化する\"\n }\n ],\n \"message1\": \"%1 %2\",\n \"args1\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_eye_color\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_eye_color\"\n }\n ],\n \"message2\": \"%1 %2\",\n \"args2\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_cheek_color\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_cheek_color\"\n }\n ],\n \"message3\": \"%1 %2\",\n \"args3\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_background_color\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_background_color\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_initAtomBabies'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_initAtomBabies_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_initAtomBabies'] = function(block) {\n \nvar _eye_color = Blockly.Python.valueToCode(block, '_eye_color', Blockly.Python.ORDER_NONE);\nvar _cheek_color = Blockly.Python.valueToCode(block, '_cheek_color', Blockly.Python.ORDER_NONE);\nvar _background_color = Blockly.Python.valueToCode(block, '_background_color', Blockly.Python.ORDER_NONE);\nreturn `import _thread as _ab_t\nimport sys\nimport time\n\n_ab_const = {\n 'VERSION': \"v0.0.7\",\n 'MIN_LED_POS': 1,\n 'MAX_LED_POS': 25,\n 'LED_WIDTH': 5,\n 'EYE_POSITIONS': {\n 'POS_TOP': [2, 4],\n 'POS_UP': [7, 9],\n 'POS_NORMAL': [12, 14],\n 'POS_RIGHT': [11, 13],\n 'POS_LEFT': [13, 15],\n 'POS_DOWN': [17, 19],\n 'POS_BOTTOM': [22, 24],\n },\n 'CHEEK_POSITIONS': {\n 'POS_TOP': [6, 10],\n 'POS_UP': [11, 15],\n 'POS_NORMAL': [16, 20],\n 'POS_RIGHT': [19],\n 'POS_LEFT': [17],\n 'POS_DOWN': [21, 25],\n 'POS_BOTTOM': [],\n },\n 'ORIENTATIONS': {\n 'ORI_NORMAL': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25],\n 'ORI_RIGHT': [21, 16, 11, 6, 1, 22, 17, 12, 7, 2, 23, 18, 13, 8, 3, 24, 19, 14, 9, 4, 25, 20, 15, 10, 5],\n 'ORI_UPSIDE_DOWN': [25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],\n 'ORI_LEFT': [5, 10, 15, 20, 25, 4, 9, 14, 19, 24, 3, 8, 13, 18, 23, 2, 7, 12, 17, 22, 1, 6, 11, 16, 21],\n },\n 'DIGITS': [\n [2, 3, 4, 7, 9, 12, 14, 17, 19, 22, 23, 24],\n [3, 7, 8, 13, 18, 22, 23, 24],\n [2, 3, 4, 9, 12, 13, 14, 17, 22, 23, 24],\n [2, 3, 4, 9, 12, 13, 14, 19, 22, 23, 24],\n [2, 4, 7, 9, 12, 13, 14, 19, 24],\n [2, 3, 4, 7, 12, 13, 14, 19, 22, 23, 24],\n [2, 3, 4, 7, 12, 13, 14, 17, 19, 22, 23, 24],\n [2, 3, 4, 9, 14, 19, 24],\n [2, 3, 4, 7, 9, 12, 13, 14, 17, 19, 22, 23, 24],\n [2, 3, 4, 7, 9, 12, 13, 14, 19, 22, 23, 24],\n ],\n 'SYMBOLS': {\n '-' : [12, 13, 14],\n '.' : [23],\n '!' : [3, 8, 13, 23],\n },\n 'ALPHABETS': {\n 'a': [2, 3, 4, 9, 12, 13, 14, 17, 19, 22, 23, 24],\n 'A': [3, 7, 9, 12, 13, 14, 17, 19, 22, 24],\n 'e': [2, 3, 4, 6, 8, 12, 13, 14, 17, 22, 23, 24],\n 'E': [2, 3, 4, 7, 12, 13, 14, 17, 22, 23, 24],\n 'M': [2, 4, 7, 8, 9, 12, 14, 17, 19, 22, 24],\n 'r': [1, 6, 8, 9, 11, 12, 15, 16, 21],\n 'R': [2, 3, 7, 9, 12, 13, 17, 19, 22, 24],\n 's': [3, 4, 7, 12, 13, 14, 19, 22, 23],\n 'S': [2, 3, 4, 7, 12, 13, 14, 19, 22, 23, 24],\n 'x': [12, 14, 18, 22, 24],\n 'X': [2, 4, 7, 9, 13, 17, 19, 22, 24],\n 'y': [2, 4, 7, 9, 12, 13, 14, 19, 22, 23, 24],\n 'Y': [2, 4, 7, 9, 12, 13, 14, 19, 23],\n },\n 'BLINK_INTERVAL': {\n 'LOOP': 1,\n 'OPEN': 500,\n 'CLOSE': 100,\n 'INTERVAL': 1000,\n },\n 'DEFAULT_BLINK_INTERVAL_FUNCTION': '_ab_get_blink_interval',\n}\n_ab_const['CHAR_TYPES'] = [\n _ab_const['ALPHABETS'], _ab_const['SYMBOLS'], {str(d): v for d, v in enumerate(_ab_const['DIGITS'])}\n]\n\n_ab_lock = _ab_t.allocate_lock()\n\nif 'imu' not in sys.modules:\n import imu\n imu0 = imu.IMU()\n\ndef _ab_get_const(key, default=None):\n return _ab_const.get(key, default)\n\ndef _ab_get_rgb(r, g, b):\n return int('0x{:02x}{:02x}{:02x}'.format(r, g, b))\n\ndef _ab_get_version():\n return _ab_get_const('VERSION')\n\n_ab_global = {\n 'eye_color': ${_eye_color},\n 'cheek_color': ${_cheek_color},\n 'background_color': ${_background_color},\n 'position': 'POS_NORMAL',\n 'orientation': 'ORI_NORMAL',\n 'auto_orientation': True,\n 'gravity_threshold': 0.75,\n 'blink_thread_running': False,\n 'blink_running': False,\n 'blink_interval_function': _ab_get_const('DEFAULT_BLINK_INTERVAL_FUNCTION'),\n 'scroll_buffer': []\n}\n\n\ndef _ab_get_global(key):\n return _ab_global[key]\n\n\ndef _ab_set_global(key, val):\n _ab_global[key] = val\n\n\ndef _ab_get_led_position(orientation, position):\n return _ab_get_const('ORIENTATIONS')[orientation][position - 1]\n\n\ndef _ab_fill(color):\n with _ab_lock:\n rgb.setColorFrom(_ab_get_const('MIN_LED_POS'), _ab_get_const('MAX_LED_POS'), color) # type: ignore # noqa: F821\n\n\ndef _ab_set_color(pos, color, orientation):\n with _ab_lock:\n rgb.setColor(_ab_get_led_position(orientation, pos), color) # type: ignore # noqa: F821\n\n\ndef _ab_get_eye_position(pos):\n return _ab_get_const('EYE_POSITIONS')[pos]\n\n\ndef _ab_get_cheek_position(pos):\n return _ab_get_const('CHEEK_POSITIONS')[pos]\n\n\ndef _ab_set_eyes(pos, color, orientation):\n for _p in _ab_get_eye_position(pos):\n _ab_set_color(_p, color, orientation)\n\n\ndef _ab_set_cheeks(pos, color, orientation):\n for _p in _ab_get_cheek_position(pos):\n _ab_set_color(_p, color, orientation)\n\n\ndef _ab_set_face(pos, eye_color, cheek_color, orientation):\n _ab_set_eyes(pos, eye_color, orientation)\n _ab_set_cheeks(pos, cheek_color, orientation)\n\n\ndef _ab_show_face():\n _ab_fill(_ab_get_background_color())\n _ab_set_face(_ab_get_face_position(), _ab_get_eye_color(), _ab_get_cheek_color(), _ab_get_orientation())\n\n\ndef _ab_clear_face():\n _bg_color = _ab_get_background_color()\n _ab_set_face(_ab_get_face_position(), _bg_color, _bg_color, _ab_get_orientation())\n\n\ndef _ab_open_eyes():\n _ab_set_eyes(_ab_get_face_position(), _ab_get_eye_color(), _ab_get_orientation())\n\n\ndef _ab_close_eyes():\n _ab_set_eyes(_ab_get_face_position(), _ab_get_background_color(), _ab_get_orientation())\n\n\ndef _ab_set_eye_color(color):\n _ab_set_global('eye_color', color)\n\n\ndef _ab_get_eye_color():\n return _ab_get_global('eye_color')\n\n\ndef _ab_set_cheek_color(color):\n _ab_set_global('cheek_color', color)\n\n\ndef _ab_get_cheek_color():\n return _ab_get_global('cheek_color')\n\n\ndef _ab_set_background_color(color):\n _ab_set_global('background_color', color)\n\n\ndef _ab_get_background_color():\n return _ab_get_global('background_color')\n\n\ndef _ab_set_orientation(orientation):\n _ab_set_global('orientation', orientation)\n _ab_set_auto_orientation(False)\n\n\ndef _ab_get_orientation():\n return _ab_get_global('orientation')\n\n\ndef _ab_set_face_position(position):\n _ab_set_global('position', position)\n\n\ndef _ab_get_face_position():\n return _ab_get_global('position')\n\n\ndef _ab_is_ascii(s):\n return all(ord(c) < 128 for c in s)\n\n\ndef _ab_get_function_name(name):\n if _ab_is_ascii(name):\n return name\n else:\n return ''.join(['_{:02X}'.format(b) for b in name.encode()])\n\n\ndef _ab_blink_task():\n while _ab_get_global('blink_thread_running'):\n if _ab_get_global('blink_running'):\n _func = _ab_get_function_name(_ab_get_global('blink_interval_function'))\n _intervals = globals()[_func]()\n for _ in range(_intervals['LOOP']):\n time.sleep_ms(_intervals['OPEN'])\n _ab_close_eyes()\n time.sleep_ms(_intervals['CLOSE'])\n _ab_open_eyes()\n time.sleep_ms(_intervals['INTERVAL'])\n else:\n time.sleep_ms(1)\n\n\ndef _ab_set_blink_interval(interval):\n _ab_set_global('blink_interval', interval)\n\n\ndef _ab_start_blink(func=None):\n if not _ab_get_global('blink_thread_running'):\n _ab_set_global('blink_thread_running', True)\n _ab_t.start_new_thread(_ab_blink_task, ())\n _ab_set_global('blink_interval_function', func or '_ab_get_blink_interval')\n _ab_set_global('blink_running', True)\n\n\ndef _ab_stop_blink():\n _ab_set_global('blink_running', False)\n\n\ndef _ab_terminate_blink():\n _ab_set_global('blink_thread_running', False)\n\n\ndef _ab_get_blink_interval():\n return _ab_get_const('BLINK_INTERVAL')\n\n\ndef _ab_is_blinking():\n return _ab_get_global('blink_running')\n\ndef _ab_set_gravity_threshold(threshold):\n _ab_set_global('gravity_threshold', threshold)\n\ndef _ab_get_gravity_threshold():\n return _ab_get_global('gravity_threshold')\n\ndef _ab_detect_orientation():\n ax, ay, az = imu0.acceleration\n threshold = _ab_get_gravity_threshold()\n if ay >= threshold:\n return 'ORI_NORMAL'\n elif ax >= threshold:\n return 'ORI_RIGHT'\n elif ax <= -threshold:\n return 'ORI_LEFT'\n elif ay <= -threshold:\n return 'ORI_UPSIDE_DOWN'\n else:\n return _ab_get_global('orientation')\n\ndef _ab_is_auto_orientation():\n return _ab_get_global('auto_orientation')\n\ndef _ab_set_auto_orientation(auto_orientation):\n _ab_set_global('auto_orientation', auto_orientation)\n\ndef _ab_update_orientation():\n if _ab_is_auto_orientation():\n o = _ab_detect_orientation()\n if o != _ab_get_global('orientation'):\n _ab_set_global('orientation', o)\n return True\n return False\n\ndef _ab_update():\n return _ab_update_orientation()\n\ndef _ab_get_char_positions(c):\n for t in _ab_const['CHAR_TYPES']:\n if c in t:\n return t[c]\n else:\n return []\n\ndef _ab_get_scroll_buffer():\n return _ab_get_global('scroll_buffer')\n\ndef _ab_update_scroll_buffer(pos):\n _ab_get_scroll_buffer().append(pos)\n\ndef _ab_purge_scroll_buffer():\n w = _ab_get_const('LED_WIDTH')\n _ab_set_global('scroll_buffer',\n [p - 1 for p in _ab_get_global('scroll_buffer') if (p - 1) % w != 0])\n\ndef _ab_display_scroll_buffer(color, interval):\n _ab_update_orientation()\n for pos in _ab_get_scroll_buffer():\n _ab_set_color(pos, color, _ab_get_orientation())\n time.sleep_ms(interval)\n for pos in _ab_get_scroll_buffer():\n _ab_set_color(pos, _ab_get_background_color(), _ab_get_orientation())\n _ab_purge_scroll_buffer()\n\ndef _ab_set_char(c, color, orientation):\n for t in _ab_const['CHAR_TYPES']:\n if c in t:\n for pos in t[c]:\n _ab_set_color(pos, color, orientation)\n break\n\ndef _ab_scroll_text(text, color, interval):\n w = _ab_get_const('LED_WIDTH')\n for c in text:\n for x in range(1, w + 1):\n if c == ' ':\n _ab_display_scroll_buffer(color, interval)\n for p in _ab_get_char_positions(c):\n if p % w == x:\n _ab_update_scroll_buffer(w + w * ((p - 1) // w))\n _ab_display_scroll_buffer(color, interval)\n for x in range(1, w + 1):\n _ab_display_scroll_buffer(color, interval)\n\n\ndef _ab_set_digit(digit, color, orientation):\n if digit < 0 or digit > 9:\n return\n for pos in _ab_get_const('DIGITS')[digit]:\n _ab_set_color(pos, color, orientation)\n\ndef _ab_scroll_digits(digits, color, interval):\n _ab_scroll_text(str(digits), color, interval)\n\n_ab_update_orientation()\n`\n};\n// Block __ATOM_Babies_updateAtomBabies\nvar __ATOM_Babies_updateAtomBabies_json = {\n \"output\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"ATOM Babiesを更新する\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_updateAtomBabies'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_updateAtomBabies_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_updateAtomBabies'] = function(block) {\n \nreturn [`_ab_update()`, Blockly.Python.ORDER_CONDITIONAL]\n};\n// Block __ATOM_Babies_rgb\nvar __ATOM_Babies_rgb_json = {\n \"output\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"色を指定する\"\n }\n ],\n \"message1\": \"%1 %2\",\n \"args1\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_r\"\n },\n {\n \"type\": \"field_number\",\n \"value\": 0,\n \"name\": \"_r\"\n }\n ],\n \"message2\": \"%1 %2\",\n \"args2\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_g\"\n },\n {\n \"type\": \"field_number\",\n \"value\": 0,\n \"name\": \"_g\"\n }\n ],\n \"message3\": \"%1 %2\",\n \"args3\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_b\"\n },\n {\n \"type\": \"field_number\",\n \"value\": 0,\n \"name\": \"_b\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_rgb'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_rgb_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_rgb'] = function(block) {\n \nvar _r = block.getFieldValue('_r');\nvar _g = block.getFieldValue('_g');\nvar _b = block.getFieldValue('_b');\nreturn [`_ab_get_rgb(${_r}, ${_g}, ${_b})`, Blockly.Python.ORDER_CONDITIONAL]\n};\n// Block __ATOM_Babies_showFace\nvar __ATOM_Babies_showFace_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔を表示する\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_showFace'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_showFace_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_showFace'] = function(block) {\n \nreturn `_ab_show_face()\n`\n};\n// Block __ATOM_Babies_fillFace\nvar __ATOM_Babies_fillFace_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔を塗りつぶす\"\n }\n ],\n \"message1\": \"%1 %2\",\n \"args1\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_color\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_color\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_fillFace'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_fillFace_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_fillFace'] = function(block) {\n \nvar _color = Blockly.Python.valueToCode(block, '_color', Blockly.Python.ORDER_NONE);\nreturn `_ab_fill(${_color})\n`\n};\n// Block __ATOM_Babies_clearFace\nvar __ATOM_Babies_clearFace_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔を消す\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_clearFace'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_clearFace_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_clearFace'] = function(block) {\n \nreturn `_ab_clear_face()\n`\n};\n// Block __ATOM_Babies_setAutoOrientation\nvar __ATOM_Babies_setAutoOrientation_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"自動的に顔の向きを設定する\"\n }\n ],\n \"message1\": \"%1 %2\",\n \"args1\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_is_auto_orientation\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_is_auto_orientation\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setAutoOrientation'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setAutoOrientation_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setAutoOrientation'] = function(block) {\n \nvar _is_auto_orientation = Blockly.Python.valueToCode(block, '_is_auto_orientation', Blockly.Python.ORDER_NONE);\nreturn `_ab_set_auto_orientation(${_is_auto_orientation})\n`\n};\n// Block __ATOM_Babies_isAutoOrientation\nvar __ATOM_Babies_isAutoOrientation_json = {\n \"output\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"自動的に顔の向きを設定するか?\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_isAutoOrientation'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_isAutoOrientation_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_isAutoOrientation'] = function(block) {\n \nreturn [`_ab_is_auto_orientation()`, Blockly.Python.ORDER_CONDITIONAL]\n};\n// Block __ATOM_Babies_getOrientation\nvar __ATOM_Babies_getOrientation_json = {\n \"output\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の向きの取得\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_getOrientation'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_getOrientation_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_getOrientation'] = function(block) {\n \nreturn [`_ab_get_orientation()`, Blockly.Python.ORDER_CONDITIONAL]\n};\n// Block __ATOM_Babies_setOrientation\nvar __ATOM_Babies_setOrientation_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の向きを設定する\"\n }\n ],\n \"message1\": \"%1 %2\",\n \"args1\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_orientation\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_orientation\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setOrientation'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setOrientation_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setOrientation'] = function(block) {\n \nvar _orientation = Blockly.Python.valueToCode(block, '_orientation', Blockly.Python.ORDER_NONE);\nreturn `_ab_set_orientation(${_orientation})\n`\n};\n// Block __ATOM_Babies_getOrientationNormal\nvar __ATOM_Babies_getOrientationNormal_json = {\n \"output\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の向き:通常\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_getOrientationNormal'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_getOrientationNormal_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_getOrientationNormal'] = function(block) {\n \nreturn [`'ORI_NORMAL'`, Blockly.Python.ORDER_CONDITIONAL]\n};\n// Block __ATOM_Babies_getOrientationRight\nvar __ATOM_Babies_getOrientationRight_json = {\n \"output\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の向き:右\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_getOrientationRight'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_getOrientationRight_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_getOrientationRight'] = function(block) {\n \nreturn [`'ORI_RIGHT'`, Blockly.Python.ORDER_CONDITIONAL]\n};\n// Block __ATOM_Babies_getOrientationUpsideDown\nvar __ATOM_Babies_getOrientationUpsideDown_json = {\n \"output\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の向き:逆\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_getOrientationUpsideDown'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_getOrientationUpsideDown_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_getOrientationUpsideDown'] = function(block) {\n \nreturn [`'ORI_UPSIDE_DOWN'`, Blockly.Python.ORDER_CONDITIONAL]\n};\n// Block __ATOM_Babies_getOrientationLeft\nvar __ATOM_Babies_getOrientationLeft_json = {\n \"output\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の向き:左\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_getOrientationLeft'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_getOrientationLeft_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_getOrientationLeft'] = function(block) {\n \nreturn [`'ORI_LEFT'`, Blockly.Python.ORDER_CONDITIONAL]\n};\n// Block __ATOM_Babies_setOrientationNormal\nvar __ATOM_Babies_setOrientationNormal_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の向きを通常にする\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setOrientationNormal'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setOrientationNormal_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setOrientationNormal'] = function(block) {\n \nreturn `_ab_set_orientation('ORI_NORMAL')\n`\n};\n// Block __ATOM_Babies_setOrientationRight\nvar __ATOM_Babies_setOrientationRight_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の向きを右にする\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setOrientationRight'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setOrientationRight_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setOrientationRight'] = function(block) {\n \nreturn `_ab_set_orientation('ORI_RIGHT')\n`\n};\n// Block __ATOM_Babies_setOrientationUpsideDown\nvar __ATOM_Babies_setOrientationUpsideDown_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の向きを逆にする\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setOrientationUpsideDown'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setOrientationUpsideDown_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setOrientationUpsideDown'] = function(block) {\n \nreturn `_ab_set_orientation('ORI_UPSIDE_DOWN')\n`\n};\n// Block __ATOM_Babies_setOrientationLeft\nvar __ATOM_Babies_setOrientationLeft_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の向きを左にする\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setOrientationLeft'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setOrientationLeft_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setOrientationLeft'] = function(block) {\n \nreturn `_ab_set_orientation('ORI_LEFT')\n`\n};\n// Block __ATOM_Babies_setFacePositionNormal\nvar __ATOM_Babies_setFacePositionNormal_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の位置を通常にする\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setFacePositionNormal'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setFacePositionNormal_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setFacePositionNormal'] = function(block) {\n \nreturn `_ab_set_face_position('POS_NORMAL')\n`\n};\n// Block __ATOM_Babies_setFacePositionRight\nvar __ATOM_Babies_setFacePositionRight_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の位置を右にする\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setFacePositionRight'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setFacePositionRight_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setFacePositionRight'] = function(block) {\n \nreturn `_ab_set_face_position('POS_RIGHT')\n`\n};\n// Block __ATOM_Babies_setFacePositionDown\nvar __ATOM_Babies_setFacePositionDown_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の位置を下にする\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setFacePositionDown'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setFacePositionDown_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setFacePositionDown'] = function(block) {\n \nreturn `_ab_set_face_position('POS_DOWN')\n`\n};\n// Block __ATOM_Babies_setFacePositionLeft\nvar __ATOM_Babies_setFacePositionLeft_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の位置を左にする\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setFacePositionLeft'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setFacePositionLeft_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setFacePositionLeft'] = function(block) {\n \nreturn `_ab_set_face_position('POS_LEFT')\n`\n};\n// Block __ATOM_Babies_setFacePositionUp\nvar __ATOM_Babies_setFacePositionUp_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の位置を上にする\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setFacePositionUp'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setFacePositionUp_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setFacePositionUp'] = function(block) {\n \nreturn `_ab_set_face_position('POS_UP')\n`\n};\n// Block __ATOM_Babies_setFacePositionTop\nvar __ATOM_Babies_setFacePositionTop_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の位置を真上にする\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setFacePositionTop'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setFacePositionTop_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setFacePositionTop'] = function(block) {\n \nreturn `_ab_set_face_position('POS_TOP')\n`\n};\n// Block __ATOM_Babies_setFacePositionBottom\nvar __ATOM_Babies_setFacePositionBottom_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"顔の位置を真下にする\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setFacePositionBottom'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setFacePositionBottom_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setFacePositionBottom'] = function(block) {\n \nreturn `_ab_set_face_position('POS_BOTTOM')\n`\n};\n// Block __ATOM_Babies_openEyes\nvar __ATOM_Babies_openEyes_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"目を開ける\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_openEyes'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_openEyes_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_openEyes'] = function(block) {\n \nreturn `_ab_open_eyes()\n`\n};\n// Block __ATOM_Babies_closeEyes\nvar __ATOM_Babies_closeEyes_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"目を閉じる\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_closeEyes'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_closeEyes_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_closeEyes'] = function(block) {\n \nreturn `_ab_close_eyes()\n`\n};\n// Block __ATOM_Babies_showCheeks\nvar __ATOM_Babies_showCheeks_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"ほっぺを表示する\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_showCheeks'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_showCheeks_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_showCheeks'] = function(block) {\n \nreturn `_ab_set_cheeks(_ab_get_face_position(), _ab_get_cheek_color(), _ab_get_orientation())\n`\n};\n// Block __ATOM_Babies_clearCheeks\nvar __ATOM_Babies_clearCheeks_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"ほっぺを消す\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_clearCheeks'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_clearCheeks_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_clearCheeks'] = function(block) {\n \nreturn `_ab_set_cheeks(_ab_get_face_position(), _ab_get_background_color(), _ab_get_orientation())\n`\n};\n// Block __ATOM_Babies_startBlink\nvar __ATOM_Babies_startBlink_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"まばたきを始める\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_startBlink'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_startBlink_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_startBlink'] = function(block) {\n \nreturn `_ab_start_blink()\n`\n};\n// Block __ATOM_Babies_stopBlink\nvar __ATOM_Babies_stopBlink_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"まばたきを止める\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_stopBlink'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_stopBlink_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_stopBlink'] = function(block) {\n \nreturn `_ab_stop_blink()\n`\n};\n// Block __ATOM_Babies_startBlinkWithFunction\nvar __ATOM_Babies_startBlinkWithFunction_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"まばたきを始める\"\n }\n ],\n \"message1\": \"%1 %2\",\n \"args1\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_interval_function_name\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_interval_function_name\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_startBlinkWithFunction'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_startBlinkWithFunction_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_startBlinkWithFunction'] = function(block) {\n \nvar _interval_function_name = Blockly.Python.valueToCode(block, '_interval_function_name', Blockly.Python.ORDER_NONE);\nreturn `_ab_start_blink(${_interval_function_name})\n`\n};\n// Block __ATOM_Babies_isBlinking\nvar __ATOM_Babies_isBlinking_json = {\n \"output\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"まばたきしているか?\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_isBlinking'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_isBlinking_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_isBlinking'] = function(block) {\n \nreturn [`_ab_is_blinking()`, Blockly.Python.ORDER_CONDITIONAL]\n};\n// Block __ATOM_Babies_getBlinkIntervalValues\nvar __ATOM_Babies_getBlinkIntervalValues_json = {\n \"output\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"まばたきの設定値\"\n }\n ],\n \"message1\": \"%1 %2\",\n \"args1\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_loop\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_loop\"\n }\n ],\n \"message2\": \"%1 %2\",\n \"args2\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_open\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_open\"\n }\n ],\n \"message3\": \"%1 %2\",\n \"args3\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_close\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_close\"\n }\n ],\n \"message4\": \"%1 %2\",\n \"args4\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_interval\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_interval\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_getBlinkIntervalValues'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_getBlinkIntervalValues_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_getBlinkIntervalValues'] = function(block) {\n \nvar _loop = Blockly.Python.valueToCode(block, '_loop', Blockly.Python.ORDER_NONE);\nvar _open = Blockly.Python.valueToCode(block, '_open', Blockly.Python.ORDER_NONE);\nvar _close = Blockly.Python.valueToCode(block, '_close', Blockly.Python.ORDER_NONE);\nvar _interval = Blockly.Python.valueToCode(block, '_interval', Blockly.Python.ORDER_NONE);\nreturn [`{\n \"LOOP\": ${_loop},\n \"OPEN\": ${_open},\n \"CLOSE\": ${_close},\n \"INTERVAL\": ${_interval}\n}`, Blockly.Python.ORDER_CONDITIONAL]\n};\n// Block __ATOM_Babies_setDigit\nvar __ATOM_Babies_setDigit_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"数字を表示する\"\n }\n ],\n \"message1\": \"%1 %2\",\n \"args1\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_digit\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_digit\"\n }\n ],\n \"message2\": \"%1 %2\",\n \"args2\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_color\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_color\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setDigit'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setDigit_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setDigit'] = function(block) {\n \nvar _digit = Blockly.Python.valueToCode(block, '_digit', Blockly.Python.ORDER_NONE);\nvar _color = Blockly.Python.valueToCode(block, '_color', Blockly.Python.ORDER_NONE);\nreturn `_ab_set_digit(${_digit}, ${_color}, _ab_get_orientation())\n`\n};\n// Block __ATOM_Babies_scrollDigits\nvar __ATOM_Babies_scrollDigits_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"数値をスクロール表示する\"\n }\n ],\n \"message1\": \"%1 %2\",\n \"args1\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_digits\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_digits\"\n }\n ],\n \"message2\": \"%1 %2\",\n \"args2\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_color\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_color\"\n }\n ],\n \"message3\": \"%1 %2\",\n \"args3\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_interval_ms\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_interval_ms\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_scrollDigits'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_scrollDigits_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_scrollDigits'] = function(block) {\n \nvar _digits = Blockly.Python.valueToCode(block, '_digits', Blockly.Python.ORDER_NONE);\nvar _color = Blockly.Python.valueToCode(block, '_color', Blockly.Python.ORDER_NONE);\nvar _interval_ms = Blockly.Python.valueToCode(block, '_interval_ms', Blockly.Python.ORDER_NONE);\nreturn `_ab_scroll_digits(${_digits}, ${_color}, ${_interval_ms})\n`\n};\n// Block __ATOM_Babies_setChar\nvar __ATOM_Babies_setChar_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"文字を表示する\"\n }\n ],\n \"message1\": \"%1 %2\",\n \"args1\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_char\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_char\"\n }\n ],\n \"message2\": \"%1 %2\",\n \"args2\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_color\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_color\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_setChar'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_setChar_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_setChar'] = function(block) {\n \nvar _char = Blockly.Python.valueToCode(block, '_char', Blockly.Python.ORDER_NONE);\nvar _color = Blockly.Python.valueToCode(block, '_color', Blockly.Python.ORDER_NONE);\nreturn `_ab_set_char(${_char}, ${_color}, _ab_get_orientation())\n`\n};\n// Block __ATOM_Babies_scrollText\nvar __ATOM_Babies_scrollText_json = {\n \"previousStatement\": null,\n \"nextStatement\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"文字列をスクロール表示する\"\n }\n ],\n \"message1\": \"%1 %2\",\n \"args1\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_text\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_text\"\n }\n ],\n \"message2\": \"%1 %2\",\n \"args2\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_color\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_color\"\n }\n ],\n \"message3\": \"%1 %2\",\n \"args3\": [\n {\n \"type\": \"field_label\",\n \"text\": \"_interval_ms\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"_interval_ms\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_scrollText'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_scrollText_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_scrollText'] = function(block) {\n \nvar _text = Blockly.Python.valueToCode(block, '_text', Blockly.Python.ORDER_NONE);\nvar _color = Blockly.Python.valueToCode(block, '_color', Blockly.Python.ORDER_NONE);\nvar _interval_ms = Blockly.Python.valueToCode(block, '_interval_ms', Blockly.Python.ORDER_NONE);\nreturn `_ab_scroll_text(${_text}, ${_color}, ${_interval_ms})\n`\n};\n// Block __ATOM_Babies_getVersion\nvar __ATOM_Babies_getVersion_json = {\n \"output\": null,\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"バージョンの取得\"\n }\n ],\n \"colour\": \"#115f07\"\n};\nwindow['Blockly'].Blocks['__ATOM_Babies_getVersion'] = {\n init: function() {\n this.jsonInit(__ATOM_Babies_getVersion_json);\n }\n};\n\nwindow['Blockly'].Python['__ATOM_Babies_getVersion'] = function(block) {\n \nreturn [`_ab_get_version()`, Blockly.Python.ORDER_CONDITIONAL]\n};\n"}