-{"dom_code": "<xml xmlns=\"http://www.w3.org/1999/xhtml\"><block type=\"controls_whileUntil\" id=\"22\" inline=\"false\" x=\"31\" y=\"32\"><field name=\"MODE\">WHILE</field><value name=\"BOOL\"><block type=\"logic_boolean\" id=\"30\"><field name=\"BOOL\">TRUE</field></block></value><statement name=\"DO\"><block type=\"variables_set\" id=\"33\" inline=\"true\"><field name=\"VAR\">path_ahead</field><value name=\"VALUE\"><block type=\"coderbot_adv_pathAhead\" id=\"40\"></block></value><next><block type=\"text_print\" id=\"65\" inline=\"false\"><value name=\"TEXT\"><block type=\"text_join\" id=\"97\" inline=\"false\"><mutation items=\"2\"></mutation><value name=\"ADD0\"><block type=\"text\" id=\"81\"><field name=\"TEXT\">path ahead: </field></block></value><value name=\"ADD1\"><block type=\"variables_get\" id=\"98\"><field name=\"VAR\">path_ahead</field></block></value></block></value><next><block type=\"controls_if\" id=\"12\" inline=\"false\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"variables_get\" id=\"45\"><field name=\"VAR\">path_ahead</field></block></value><statement name=\"DO0\"><block type=\"coderbot_adv_move\" id=\"117\" inline=\"true\"><field name=\"ACTION\">FORWARD</field><value name=\"SPEED\"><block type=\"math_number\" id=\"118\"><field name=\"NUM\">100</field></block></value><value name=\"ELAPSE\"><block type=\"math_number\" id=\"119\"><field name=\"NUM\">-1</field></block></value></block></statement><statement name=\"ELSE\"><block type=\"coderbot_adv_move\" id=\"120\" inline=\"true\"><field name=\"ACTION\">RIGHT</field><value name=\"SPEED\"><block type=\"math_number\" id=\"121\"><field name=\"NUM\">20</field></block></value><value name=\"ELAPSE\"><block type=\"math_number\" id=\"122\"><field name=\"NUM\">-1</field></block></value></block></statement></block></next></block></next></block></statement></block></xml>", "code": "path_ahead = None\n\n\nwhile True:\n get_prog_eng().check_end()\n path_ahead = get_cam().path_ahead()\n get_cam().set_text(str('path ahead: ') + str(path_ahead))\n if path_ahead:\n get_bot().forward(speed=100, elapse=-1)\n else:\n get_bot().right(speed=20, elapse=-1)\n", "name": "path_ahead"}
0 commit comments