Files
mixly3/boards/default/micropython_robot/examples/O60xUtcmy977/A9tynPWYUIFr.mix
2024-07-21 09:30:11 +08:00

1 line
13 KiB
XML

<xml version="Mixly 2.0 rc4" board="Python Robot@飞乙"><block type="controls_whileUntil" id="g;$:Hz44d0bpPx)2m^3w" x="-2150" y="-615"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="N=b82B34a*:,H0Nv[C5M"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="nNfbe=QLrs8h;kq8pHCP"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="AEd8FhZGQ|T}?DTT_7fx"><value name="btn"><shadow type="pins_button" id="5zQA_rMd~=b?#z7!B$0k"><field name="PIN">button_a</field></shadow></value></block></value><statement name="DO0"><block type="storage_fileopen" id="iJFC=j};yWfZ9`VT,;v["><field name="MODE">w</field><value name="FILENAME"><shadow type="text" id="}tBHUA#c-o}gv_b,{uWC"><field name="TEXT">/test.txt</field></shadow></value><value name="FILE"><shadow type="variables_get" id="m$@qj)gQ?FthjEo:tFp!"><field name="VAR">f</field></shadow></value><next><block type="controls_forEach" id="@1YFzn0$]=:gdWRD]$D1"><value name="LIST"><shadow type="list_many_input" id="DhL8Ta~,^)Q!)6yDWxHj"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id="+AOd]a!O2{c{;bwB,cIK"><value name="FROM"><shadow type="math_number" id="WAGqcC!zdGR}B{HmUw2i"><field name="NUM">0</field></shadow></value><value name="TO"><shadow type="math_number" id="hbV;8D.Zn6[285iK`Uc#"><field name="NUM">100</field></shadow></value><value name="STEP"><shadow type="math_number" id="hb;G+:K,-MRod`tA!6Ke"><field name="NUM">1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id="b3y[0_6tlmQ+R6.1MX;C"><field name="VAR">x</field></shadow></value><statement name="DO"><block type="variables_set" id="nMGuLSiCx|j?#vlKox`t"><field name="VAR">d</field><value name="VALUE"><block type="sensor_sound" id="Je=L#J4*t-etpjOp`D$J"></block></value><next><block type="controls_forEach" id="V.sFky(7/C;1H.m$Q]lY"><value name="LIST"><shadow type="list_many_input" id="Duizk*WNo3rhME?=g(j_"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id="3Bs1yi@!KxO8uG9kq6QK"><value name="FROM"><shadow type="math_number" id="F$!=SOidcMVJ9Z{COVu-"><field name="NUM">11</field></shadow></value><value name="TO"><shadow type="math_number" id="=]k)Gtrpw=mub(kKy/y]"><field name="NUM">5</field></shadow><block type="text_to_number" id="=)uT$KJ.^=t8F$W48;bR"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="R6GO_$`{U`}h0Mo8x_eL"><field name="VAR">x</field></shadow><block type="math_map" id="tQN!DGuCYK^yv)rTRh]v"><value name="NUM"><shadow type="math_number" id="-*Y@/_Xv7`69ppElx:dE"><field name="NUM">50</field></shadow><block type="variables_get" id="v.f#.wOM:?jvC?[na$j~"><field name="VAR">d</field></block></value><value name="fromLow"><shadow type="math_number" id="}x9H8o3ID(oYPGqPX;-1"><field name="NUM">0</field></shadow></value><value name="fromHigh"><shadow type="math_number" id="njkOWuk96IST@D@W0PY~"><field name="NUM">10000</field></shadow></value><value name="toLow"><shadow type="math_number" id="2-K][1DYaVe-jDiie,sC"><field name="NUM">11</field></shadow></value><value name="toHigh"><shadow type="math_number" id="`Z7M|oj_Kp855oG13izg"><field name="NUM">0</field></shadow></value></block></value></block></value><value name="STEP"><shadow type="math_number" id="JG.H7]+;@[2Zc$_8]$aV"><field name="NUM">-1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id="6BIKUso-bT:Sy/|ocm;U"><field name="VAR">i</field></shadow></value><statement name="DO"><block type="display_bright_point" id="U!#4Hzk!bLo{qhtP}B6}"><value name="x"><shadow type="pins_exlcdh" id="yti9gs}OSP2puKA(clS/"><field name="PIN">11</field></shadow></value><value name="y"><shadow type="pins_exlcdv" id="nx7]*dYH#KFEg{N9YGgt"><field name="PIN">0</field></shadow><block type="variables_get" id="G{fI~}.*KfHn#YVjFi?J"><field name="VAR">i</field></block></value><value name="STAT"><shadow type="display_onoff" id="k2x?K2a_[G~45pUvdN}C"><field name="ONOFF">ON</field></shadow></value></block></statement><next><block type="display_shift" id="81j/pdOj8v@)Sbu4OUU{"><field name="OP">shift_left</field><value name="val"><shadow type="math_number" id="i]xnurGaS6L8_]h__Id^"><field name="NUM">1</field></shadow></value><next><block type="storage_file_write" id="CbI;X1}kFawqgq(@u=;="><value name="data"><shadow type="text" id="+EZ].[5#8V7`hKA)OObo"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="sm///s)FO-HH$R*J3.vQ"><value name="VAR"><shadow type="variables_get" id="4H4hQx[C}2~V_yp3F#=Y"><field name="VAR">x</field></shadow><block type="text_to_number" id=")8u5O8vDB~HtezufL70t"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="tfo6K9,JX*+eb7ujlWVp"><field name="VAR">x</field></shadow><block type="variables_get" id="`H=(*O{]OdrG?V!U0PC}"><field name="VAR">d</field></block></value></block></value></block></value><value name="FILE"><shadow type="variables_get" id="lm2rdh,Ut^6?PVt2iHFK"><field name="VAR">f</field></shadow></value><next><block type="storage_file_write" id=",1gWu#|x)mhM,Fa_,$mh"><value name="data"><shadow type="text" id=";F@!$0hpT:t/zUvQFgv6"><field name="TEXT">Mixly</field></shadow><block type="ascii_to_char" id="Hen~P!3QO;gEgj1)/=Y~"><value name="VAR"><shadow type="math_number" id="fBh9OO9C[[k{R3b{UEsV"><field name="NUM">10</field></shadow></value></block></value><value name="FILE"><shadow type="variables_get" id=";`0_`$!v!q_[^)`9,(-B"><field name="VAR">f</field></shadow></value></block></next></block></next></block></next></block></next></block></statement><next><block type="storage_close_file" id="Vi6s|!RE;UT@K$7!r`so"><value name="FILE"><shadow type="variables_get" id="=I/c5{H$6;9]Q;Qa3Yrr"><field name="VAR">f</field></shadow></value></block></next></block></next></block></statement><next><block type="controls_if" id="((k}(AylklL]XEhItreK"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="h^D6O~M$Jdb6U9.`DAE:"><value name="btn"><shadow type="pins_button" id="~uNY6cPWdQ[F0TzezTa0"><field name="PIN">button_b</field></shadow></value></block></value><statement name="DO0"><block type="controls_try_finally" id="*Iqn3WA?cBQlChz3bXL#"><mutation elseif="1"></mutation><statement name="try"><block type="storage_fileopen" id="Xi.|qVGLyo6~m!jNMK1!"><field name="MODE">r</field><value name="FILENAME"><shadow type="text" id="@!xxtWLKcGJ(U*4@6c?V"><field name="TEXT">/test.txt</field></shadow></value><value name="FILE"><shadow type="variables_get" id="hu*Ck7?7g)o`8r[VjZ9Q"><field name="VAR">f</field></shadow></value><next><block type="controls_forEach" id="Gb{1nR]=R1bXS/T9sTtu"><value name="LIST"><shadow type="list_many_input" id="5QGucKL-,R5c+_Ah:I?i"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id="Gir$9CClabg]UgE^d#Mb"><value name="FROM"><shadow type="math_number" id="(`QN4?FdrYVkfkJ4@|5f"><field name="NUM">0</field></shadow></value><value name="TO"><shadow type="math_number" id="4|oV{Q#dbbqp50n@#`5S"><field name="NUM">100</field></shadow></value><value name="STEP"><shadow type="math_number" id="oBc9.gXUC:eknJ2X#DIt"><field name="NUM">1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id="z8`ZJ32BV={/wXH8t[I{"><field name="VAR">x</field></shadow></value><statement name="DO"><block type="variables_set" id="A6EP;Mt!E,WueF0~=5Y@"><field name="VAR">s</field><value name="VALUE"><block type="storage_get_contents_without_para" id="wb1CY~4X=SR$R^?g.qKo"><field name="MODE">readline</field><value name="FILE"><shadow type="variables_get" id="WyEkuqf3;kzm!/y,h[0|"><field name="VAR">f</field></shadow></value></block></value><next><block type="controls_if" id="q4dn4,4)`5k/#1^#Z6hi"><value name="IF0"><block type="variables_get" id="OVvFd|~6uSqOu?c}.+Fv"><field name="VAR">s</field></block></value><statement name="DO0"><block type="variables_set" id="HFZL@;@r7Yi~{?yEsqil"><field name="VAR">d</field><value name="VALUE"><block type="text_to_number" id="j1tUi-EbQ6GU9n9S-J45"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="A/BhE)c$opT?0ypM|;#."><field name="VAR">x</field></shadow><block type="variables_get" id="kRhJ}osa;K}jN9x#:@7~"><field name="VAR">s</field></block></value></block></value><next><block type="controls_forEach" id=".0nbBT;GiVXi:sxFi;)B"><value name="LIST"><shadow type="list_many_input" id="q6:sT1l7O@h/HsA#$I_`"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id="]wEw6(Y]_[Uh;wRYd)+Z"><value name="FROM"><shadow type="math_number" id="5z4m*]zsm5c^Ucgu}?82"><field name="NUM">11</field></shadow></value><value name="TO"><shadow type="math_number" id="Gl.`8;qnm=#sIv@N]#P0"><field name="NUM">5</field></shadow><block type="text_to_number" id="seo:01(k@yqM!Y5~)$z~"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id=")8(]z;8?50p_|E[(Ro.Q"><field name="VAR">x</field></shadow><block type="math_map" id="L@}AawEQIWnxBP,Cs4,k"><value name="NUM"><shadow type="math_number" id="A,l#@z.8s@gF{{){(ou*"><field name="NUM">50</field></shadow><block type="variables_get" id="/U{YK3kJW_L{5RM|?Qv)"><field name="VAR">d</field></block></value><value name="fromLow"><shadow type="math_number" id="Bzljy^F.wRE~O^tRJj-!"><field name="NUM">0</field></shadow></value><value name="fromHigh"><shadow type="math_number" id="E?Y=59/JYgf14JrJpDY|"><field name="NUM">10000</field></shadow></value><value name="toLow"><shadow type="math_number" id="tr[UaV!rF~IzC_d#DOGl"><field name="NUM">11</field></shadow></value><value name="toHigh"><shadow type="math_number" id="F`14(_-L?KBpi,]C[n+P"><field name="NUM">0</field></shadow></value></block></value></block></value><value name="STEP"><shadow type="math_number" id="fQr|.i+qWRQly.7Y42tD"><field name="NUM">-1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id="re:=lXGkFfDF3Uyj7vx}"><field name="VAR">i</field></shadow></value><statement name="DO"><block type="display_bright_point" id=";U2J?kWl4Kh/,.T@(8}7"><value name="x"><shadow type="pins_exlcdh" id="^;/GUSOo@}P[TXQ.F#zP"><field name="PIN">11</field></shadow></value><value name="y"><shadow type="pins_exlcdv" id="!+{:OqoAldDhATEGeDsW"><field name="PIN">0</field></shadow><block type="variables_get" id=",[O_sQ]rjc5!kr|h,x)r"><field name="VAR">i</field></block></value><value name="STAT"><shadow type="display_onoff" id="F.qge2uF-u3+|Op+r0pa"><field name="ONOFF">ON</field></shadow></value></block></statement><next><block type="display_shift" id="R5/DcxLqTJf17#:+$mOk"><field name="OP">shift_left</field><value name="val"><shadow type="math_number" id="s7X`P)uCcq|BCnmmI|{l"><field name="NUM">1</field></shadow></value></block></next></block></next></block></statement></block></next></block></statement><next><block type="storage_close_file" id="[wL?.MY.8l.upnE:R^tx"><value name="FILE"><shadow type="variables_get" id="nQhG]rVb,YCYa)(oHPq_"><field name="VAR">f</field></shadow></value></block></next></block></next></block></statement><value name="IF1"><shadow type="factory_block_return" id="I`vSDK(bDFVJbDMzQ!Z!"><field name="VALUE">Exception as e</field></shadow></value><statement name="DO1"><block type="system_print" id="P07!;s(mm6qn{_C^zj2f"><value name="VAR"><block type="variables_get" id="ZT0FtMRrEC?a.@`8J5V_"><field name="VAR">e</field></block></value></block></statement></block></statement></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IGZlaXlpCmZyb20gZmVpeWkgaW1wb3J0IG9uYm9hcmRfc291bmQKZnJvbSBtaXhweSBpbXBvcnQgbWF0aF9tYXAKZnJvbSBmZWl5aSBpbXBvcnQgb25ib2FyZF9tYXRyaXgKaW1wb3J0IG1hY2hpbmUKCgp3aGlsZSBUcnVlOgogICAgaWYgZmVpeWkuYnV0dG9uX2Eud2FzX3ByZXNzZWQoKToKICAgICAgICBmID0gb3BlbignL3Rlc3QudHh0JywgJ3cnKQogICAgICAgIGZvciB4IGluIHJhbmdlKDAsIDEwMCwgMSk6CiAgICAgICAgICAgIGQgPSBvbmJvYXJkX3NvdW5kLnJlYWQoKQogICAgICAgICAgICBmb3IgaSBpbiByYW5nZSgxMSwgaW50KChtYXRoX21hcChkLCAwLCAxMDAwMCwgMTEsIDApKSksIC0xKToKICAgICAgICAgICAgICAgIG9uYm9hcmRfbWF0cml4LnBpeGVsKGludCgxMSksIGludChpKSwgMSkKICAgICAgICAgICAgICAgIG9uYm9hcmRfbWF0cml4LnNob3coKQogICAgICAgICAgICBvbmJvYXJkX21hdHJpeC5zaGlmdF9sZWZ0KDEpCiAgICAgICAgICAgIGYud3JpdGUoc3RyKGludChkKSkpCiAgICAgICAgICAgIGYud3JpdGUoY2hyKDEwKSkKICAgICAgICBmLmNsb3NlKCkKICAgIGlmIGZlaXlpLmJ1dHRvbl9iLndhc19wcmVzc2VkKCk6CiAgICAgICAgdHJ5OgogICAgICAgICAgICBmID0gb3BlbignL3Rlc3QudHh0JywgJ3InKQogICAgICAgICAgICBmb3IgeCBpbiByYW5nZSgwLCAxMDAsIDEpOgogICAgICAgICAgICAgICAgcyA9IGYucmVhZGxpbmUoKQogICAgICAgICAgICAgICAgaWYgczoKICAgICAgICAgICAgICAgICAgICBkID0gaW50KHMpCiAgICAgICAgICAgICAgICAgICAgZm9yIGkgaW4gcmFuZ2UoMTEsIGludCgobWF0aF9tYXAoZCwgMCwgMTAwMDAsIDExLCAwKSkpLCAtMSk6CiAgICAgICAgICAgICAgICAgICAgICAgIG9uYm9hcmRfbWF0cml4LnBpeGVsKGludCgxMSksIGludChpKSwgMSkKICAgICAgICAgICAgICAgICAgICAgICAgb25ib2FyZF9tYXRyaXguc2hvdygpCiAgICAgICAgICAgICAgICAgICAgb25ib2FyZF9tYXRyaXguc2hpZnRfbGVmdCgxKQogICAgICAgICAgICBmLmNsb3NlKCkKICAgICAgICBleGNlcHQgRXhjZXB0aW9uIGFzIGU6CiAgICAgICAgICAgIHByaW50KGUpCg==</code>