-{"dom_code": "<xml xmlns=\"http://www.w3.org/1999/xhtml\"><block type=\"controls_whileUntil\" id=\"8\" inline=\"false\" x=\"43\" y=\"-64\"><field name=\"MODE\">WHILE</field><value name=\"BOOL\"><block type=\"logic_boolean\" id=\"9\"><field name=\"BOOL\">TRUE</field></block></value><statement name=\"DO\"><block type=\"variables_set\" id=\"10\" inline=\"true\"><field name=\"VAR\">faccia_x</field><value name=\"VALUE\"><block type=\"coderbot_adv_findFace\" id=\"11\"></block></value><next><block type=\"text_print\" id=\"12\" inline=\"false\"><value name=\"TEXT\"><block type=\"variables_get\" id=\"13\"><field name=\"VAR\">faccia_x</field></block></value><next><block type=\"controls_if\" id=\"14\" inline=\"false\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"15\" inline=\"true\"><field name=\"OP\">GTE</field><value name=\"A\"><block type=\"variables_get\" id=\"16\"><field name=\"VAR\">faccia_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"17\"><field name=\"NUM\">0</field></block></value></block></value><statement name=\"DO0\"><block type=\"controls_if\" id=\"18\" inline=\"false\"><mutation elseif=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\" id=\"19\" inline=\"true\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"variables_get\" id=\"20\"><field name=\"VAR\">faccia_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"21\"><field name=\"NUM\">45</field></block></value></block></value><statement name=\"DO0\"><block type=\"coderbot_adv_move\" id=\"22\" inline=\"true\"><field name=\"ACTION\">LEFT</field><value name=\"SPEED\"><block type=\"math_number\" id=\"23\"><field name=\"NUM\">80</field></block></value><value name=\"ELAPSE\"><block type=\"math_arithmetic\" id=\"45\" inline=\"true\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"math_arithmetic\" id=\"46\" inline=\"true\"><field name=\"OP\">MINUS</field><value name=\"A\"><block type=\"math_number\" id=\"48\"><field name=\"NUM\">50</field></block></value><value name=\"B\"><block type=\"variables_get\" id=\"47\"><field name=\"VAR\">faccia_x</field></block></value></block></value><value name=\"B\"><block type=\"math_number\" id=\"49\"><field name=\"NUM\">100.1</field></block></value></block></value></block></statement><value name=\"IF1\"><block type=\"logic_compare\" id=\"25\" inline=\"true\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"variables_get\" id=\"26\"><field name=\"VAR\">faccia_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"27\"><field name=\"NUM\">55</field></block></value></block></value><statement name=\"DO1\"><block type=\"coderbot_adv_move\" id=\"28\" inline=\"true\"><field name=\"ACTION\">RIGHT</field><value name=\"SPEED\"><block type=\"math_number\" id=\"29\"><field name=\"NUM\">80</field></block></value><value name=\"ELAPSE\"><block type=\"math_arithmetic\" id=\"43\" inline=\"true\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"math_arithmetic\" id=\"38\" inline=\"true\"><field name=\"OP\">MINUS</field><value name=\"A\"><block type=\"variables_get\" id=\"34\"><field name=\"VAR\">faccia_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"39\"><field name=\"NUM\">50</field></block></value></block></value><value name=\"B\"><block type=\"math_number\" id=\"44\"><field name=\"NUM\">100.1</field></block></value></block></value></block></statement></block></statement></block></next></block></next></block></statement></block></xml>", "code": "faccia_x = None\n\n\nwhile True:\n get_prog_eng().check_end()\n faccia_x = get_cam().find_face()\n get_cam().set_text(faccia_x)\n if faccia_x >= 0:\n if faccia_x < 45:\n get_bot().left(speed=80, elapse=(50 - faccia_x) / 100.1)\n elif faccia_x > 55:\n get_bot().right(speed=80, elapse=(faccia_x - 50) / 100.1)\n", "name": "face"}
0 commit comments