Skip to content

Instantly share code, notes, and snippets.

@joenash
Created December 2, 2021 14:52
Show Gist options
  • Save joenash/5deb41465886767819d1dd2f5222141b to your computer and use it in GitHub Desktop.
Save joenash/5deb41465886767819d1dd2f5222141b to your computer and use it in GitHub Desktop.
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id=":w6Kji|o+o2pwogEyu(m">movesList</variable><variable id="Z#kX:xQF~vG2*P=xGMEY">moves</variable><variable id="ef;bZ.Mq5OabLEo(x2{z">boardWidth</variable><variable id="^h]e!c(CEKL*OQgQ#=V2">firstValidMove</variable><variable id="j@g5It[~2@Y}DI%)#AG,">returnedMove</variable><variable id="jMgDi3I2gIHpASe`i@0j">boardHeight</variable><variable id="Gj(/~G^{36JQYM(b5j=V">gameState</variable><variable id="B;z78Pi0PlA:AF.3iYss">snakeX</variable><variable id="Sr.Q2E#wIPikBmA|INwA">snakeY</variable></variables><block type="procedures_defreturn" id="31FaeZ(5,p~xtAT^2i%N" x="-667" y="21"><field name="NAME">your snake</field><comment pinned="false" h="80" w="160">Describe this function...</comment><statement name="STACK"><block type="variables_set" id="78,h3;;r)n4x|xaD:4zm"><field name="VAR" id="Z#kX:xQF~vG2*P=xGMEY">moves</field><value name="VALUE"><block type="lists_create_with" id="A2~1u0e(Zn`_y2@{5xY="><mutation items="4"></mutation><value name="ADD0"><block type="logic_boolean" id="gGCcAp+bS:}M[``!En/@"><field name="BOOL">TRUE</field><comment pinned="false" h="80" w="160">up</comment></block></value><value name="ADD1"><block type="logic_boolean" id="Mz2;TrF((l|qb9#c!BgZ"><field name="BOOL">TRUE</field><comment pinned="false" h="80" w="160">down</comment></block></value><value name="ADD2"><block type="logic_boolean" id="btXjW_{%fRWou^V)T+d5"><field name="BOOL">TRUE</field><comment pinned="false" h="80" w="160">left
</comment></block></value><value name="ADD3"><block type="logic_boolean" id="~UWnY`C^857@.,G}._g%"><field name="BOOL">TRUE</field><comment pinned="false" h="80" w="160">right
</comment></block></value></block></value><next><block type="variables_set" id="[=LE5e^jy@EQMRhbO}rs"><field name="VAR" id="Z#kX:xQF~vG2*P=xGMEY">moves</field><value name="VALUE"><block type="procedures_callreturn" id="kqUf9pnB;~oI|D3=yMgF"><mutation name="avoidWalls"><arg name="movesList"></arg></mutation><value name="ARG0"><block type="variables_get" id="6C_C_A}fEN5-n|%EPG/}"><field name="VAR" id="Z#kX:xQF~vG2*P=xGMEY">moves</field></block></value></block></value></block></next></block></statement><value name="RETURN"><block type="procedures_callreturn" id="e[E5Cv*s{JNoy%8E0woS"><mutation name="parseMoves"><arg name="movesList"></arg></mutation><value name="ARG0"><block type="variables_get" id="B4%3j,.Z8eVZ7|aF+qPQ"><field name="VAR" id="Z#kX:xQF~vG2*P=xGMEY">moves</field></block></value></block></value></block><block type="procedures_defreturn" id="UNPOe_x1Nh]}^(?vf}EI" x="23" y="15"><mutation><arg name="movesList" varid=":w6Kji|o+o2pwogEyu(m"></arg></mutation><field name="NAME">avoidWalls</field><comment pinned="false" h="80" w="160">Describe this function...</comment><statement name="STACK"><block type="variables_set" id="/yZYDZ@lT4uh$W7:g2bp"><field name="VAR" id="ef;bZ.Mq5OabLEo(x2{z">boardWidth</field><value name="VALUE"><block type="dig" id="ehY`Iu%a20k$M20,z_ZA"><value name="object"><block type="variables_get" id="*.V#).J%~io5a1MaIsJX"><field name="VAR" id="Gj(/~G^{36JQYM(b5j=V">gameState</field></block></value><value name="property_list"><block type="lists_create_with" id="[NFmW#rohss0XDel:hM,"><mutation items="2"></mutation><value name="ADD0"><block type="text" id="@9-pDRx6=K+BZtcu#oRG"><field name="TEXT">board</field></block></value><value name="ADD1"><block type="text" id="!t1PAt@KECrcsCx9HnY)"><field name="TEXT">width</field></block></value></block></value></block></value><next><block type="variables_set" id="7b`~xR2)|ezg40AR6d/X"><field name="VAR" id="jMgDi3I2gIHpASe`i@0j">boardHeight</field><value name="VALUE"><block type="dig" id="YVzSyt3+Vt7qx-2b.(1N"><value name="object"><block type="variables_get" id="GP([*I8{#]:dj%+1Y;xm"><field name="VAR" id="Gj(/~G^{36JQYM(b5j=V">gameState</field></block></value><value name="property_list"><block type="lists_create_with" id="G_x*s-Zfb9P+X?`T}~l3"><mutation items="2"></mutation><value name="ADD0"><block type="text" id="zTNh@DB/3UUTCDk|Dn:p"><field name="TEXT">board</field></block></value><value name="ADD1"><block type="text" id="/wdiSqlfExzO:y_PL]mJ"><field name="TEXT">height</field></block></value></block></value></block></value><next><block type="variables_set" id="WMrahNOD+{6#B4?rc0Dr"><field name="VAR" id="B;z78Pi0PlA:AF.3iYss">snakeX</field><value name="VALUE"><block type="dig" id="~qAod0crI@68^7{$^F`h"><value name="object"><block type="variables_get" id="0#,|;7eg;(#Y)2i%Vopv"><field name="VAR" id="Gj(/~G^{36JQYM(b5j=V">gameState</field></block></value><value name="property_list"><block type="lists_create_with" id="rxULJs}Qo|A`IibRoZwT"><mutation items="3"></mutation><value name="ADD0"><block type="text" id="A1R8Z0cZ6j{009%8ae@e"><field name="TEXT">you</field></block></value><value name="ADD1"><block type="text" id="~c2Yro[!WxS0oQCv;Hpw"><field name="TEXT">head</field></block></value><value name="ADD2"><block type="text" id=";co=JPix]eH_#Ml[EzH#"><field name="TEXT">x</field></block></value></block></value></block></value><next><block type="variables_set" id="e/*c2/!y+s2ywH~-,H{/"><field name="VAR" id="Sr.Q2E#wIPikBmA|INwA">snakeY</field><value name="VALUE"><block type="dig" id="F5/fk*1BgE%tgMfQwi#."><value name="object"><block type="variables_get" id="NK)uR+[UFD`0d++]Eze-"><field name="VAR" id="Gj(/~G^{36JQYM(b5j=V">gameState</field></block></value><value name="property_list"><block type="lists_create_with" id="N{utCc^pDJU]cC82E~c-"><mutation items="3"></mutation><value name="ADD0"><block type="text" id="I2d~J*E)@^lb{jXfUE%n"><field name="TEXT">you</field></block></value><value name="ADD1"><block type="text" id="zx[!e8Qjxh$,-$0jyy[+"><field name="TEXT">head</field></block></value><value name="ADD2"><block type="text" id="N!F~Pan,B9(.33h|xaF^"><field name="TEXT">y</field></block></value></block></value></block></value><next><block type="controls_if" id="]96kt0O)QE*tcq:X-k(-"><value name="IF0"><block type="logic_compare" id="*/1x`fy[SL-9*z+J;/I1"><field name="OP">GTE</field><value name="A"><block type="variables_get" id="5c^C.h-jb!aCQ0]Of=q7"><field name="VAR" id="B;z78Pi0PlA:AF.3iYss">snakeX</field></block></value><value name="B"><block type="math_arithmetic" id="gtyEC|9S#uUoJ2]iqfvz"><field name="OP">MINUS</field><value name="A"><block type="variables_get" id="*sM{Epao::$KD.z{!WOf"><field name="VAR" id="ef;bZ.Mq5OabLEo(x2{z">boardWidth</field></block></value><value name="B"><block type="math_number" id="~j,t8rN.lP$MtE+!4r3X"><field name="NUM">1</field></block></value></block></value></block></value><statement name="DO0"><block type="lists_setIndex" id=")5xquLDW7r~F7/1zB/ZO"><mutation at="true"></mutation><field name="MODE">SET</field><field name="WHERE">FROM_START</field><value name="LIST"><block type="variables_get" id="qx$^P6??/kD3%{a64%e?"><field name="VAR" id=":w6Kji|o+o2pwogEyu(m">movesList</field></block></value><value name="AT"><block type="math_number" id="5[|*{$iDriBDyrIvg7@m"><field name="NUM">4</field></block></value><value name="TO"><block type="logic_boolean" id="v%I!A`[r;cqhrm,|dB:J"><field name="BOOL">FALSE</field></block></value></block></statement><next><block type="controls_if" id="/eSZ$m}O[?uTayGvPX`O"><value name="IF0"><block type="logic_compare" id="B3kYYy2+8WXWB%E.OvO~"><field name="OP">LTE</field><value name="A"><block type="variables_get" id="4.FHRGyeKFOkGtzlHDk["><field name="VAR" id="B;z78Pi0PlA:AF.3iYss">snakeX</field></block></value><value name="B"><block type="math_number" id=",|SqE#s:|5ELR!1B9|yn"><field name="NUM">0</field></block></value></block></value><statement name="DO0"><block type="lists_setIndex" id="2c#[b{W_-zWGUWY@),EE"><mutation at="true"></mutation><field name="MODE">SET</field><field name="WHERE">FROM_START</field><value name="LIST"><block type="variables_get" id="j5-RXr!umZa-[J?=|8-M"><field name="VAR" id=":w6Kji|o+o2pwogEyu(m">movesList</field></block></value><value name="AT"><block type="math_number" id="8;WX6vR/mcRcpt)KT0QC"><field name="NUM">3</field></block></value><value name="TO"><block type="logic_boolean" id="r!|eobnpk3xKmf6iw=Zm"><field name="BOOL">FALSE</field></block></value></block></statement><next><block type="controls_if" id="@t,U#U)FhL8^uP%Ey/Rh"><value name="IF0"><block type="logic_compare" id="PJ5sa|s*q4cyw1[e]?ky"><field name="OP">GTE</field><value name="A"><block type="variables_get" id="W53,s9+g8!ys^E}x`EAj"><field name="VAR" id="Sr.Q2E#wIPikBmA|INwA">snakeY</field></block></value><value name="B"><block type="math_arithmetic" id="*3u`l~jR7!2HcXA7Z=AI"><field name="OP">MINUS</field><value name="A"><block type="variables_get" id="][ZlsOw~5b]JH_BOaLX:"><field name="VAR" id="jMgDi3I2gIHpASe`i@0j">boardHeight</field></block></value><value name="B"><block type="math_number" id="=`gzq$+_S:+IMkgk#Ni$"><field name="NUM">1</field></block></value></block></value></block></value><statement name="DO0"><block type="lists_setIndex" id="K+krWD04nyPW8qjVo2ow"><mutation at="true"></mutation><field name="MODE">SET</field><field name="WHERE">FROM_START</field><value name="LIST"><block type="variables_get" id="M7d^=B;gd6KnUy3bIY)a"><field name="VAR" id=":w6Kji|o+o2pwogEyu(m">movesList</field></block></value><value name="AT"><block type="math_number" id="234,$Dx{kEKIPTavg7EV"><field name="NUM">1</field></block></value><value name="TO"><block type="logic_boolean" id="ZrJT_SwPYPffGrB:j_F%"><field name="BOOL">FALSE</field></block></value></block></statement><next><block type="controls_if" id="e;bbOx.`|#%FqUm#R_$D"><value name="IF0"><block type="logic_compare" id="K@mThI:i_qP96xx$D1$y"><field name="OP">LTE</field><value name="A"><block type="variables_get" id="e9iSuh%PIIX*D7^`M++T"><field name="VAR" id="Sr.Q2E#wIPikBmA|INwA">snakeY</field></block></value><value name="B"><block type="math_number" id=")*/PwZR3#;LlH0i7_vNl"><field name="NUM">0</field></block></value></block></value><statement name="DO0"><block type="lists_setIndex" id="$X/AVEKe-mc,qX$NDx1)"><mutation at="true"></mutation><field name="MODE">SET</field><field name="WHERE">FROM_START</field><value name="LIST"><block type="variables_get" id="z5DM7bt.o=),|[4_vBQY"><field name="VAR" id=":w6Kji|o+o2pwogEyu(m">movesList</field></block></value><value name="AT"><block type="math_number" id="rsZ*`/YkLmpvR2Kw^rQ!"><field name="NUM">2</field></block></value><value name="TO"><block type="logic_boolean" id="rpxnX.=/b[nh2]JAuh8@"><field name="BOOL">FALSE</field></block></value></block></statement><next><block type="console_log" id="@oExlKT0D^8R?)d9N02D"><value name="object"><block type="variables_get" id="sBwr,UEL%=}w`N^CY3_A"><field name="VAR" id=":w6Kji|o+o2pwogEyu(m">movesList</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement><value name="RETURN"><block type="variables_get" id="9Y55NGqT#80R)m$@_]I`"><field name="VAR" id=":w6Kji|o+o2pwogEyu(m">movesList</field></block></value></block><block type="procedures_defreturn" id="Lq!A0bS#f#NPlaxnqDKJ" x="-695" y="293"><mutation><arg name="movesList" varid=":w6Kji|o+o2pwogEyu(m"></arg></mutation><field name="NAME">parseMoves</field><comment pinned="false" h="80" w="160">Describe this function...</comment><statement name="STACK"><block type="variables_set" id=".3!$0vg[Cya-aXO{9vMj"><field name="VAR" id="^h]e!c(CEKL*OQgQ#=V2">firstValidMove</field><value name="VALUE"><block type="lists_indexOf" id="j0A-6GfD[$}frqUh(|:a"><field name="END">FIRST</field><value name="VALUE"><block type="variables_get" id="eLjaSntP[R(NX7/Q50$%"><field name="VAR" id=":w6Kji|o+o2pwogEyu(m">movesList</field></block></value><value name="FIND"><block type="logic_boolean" id="mKGMIax4{xtth6q{vPQD"><field name="BOOL">TRUE</field></block></value></block></value><next><block type="controls_if" id="_,9C~3*wPYu%8!c^4ffw"><value name="IF0"><block type="logic_compare" id=";A,Cm0+0|N42iJvAz3Dq"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="06VAlQ0e}cD#4L9E=YDX"><field name="VAR" id="^h]e!c(CEKL*OQgQ#=V2">firstValidMove</field></block></value><value name="B"><block type="math_number" id="G2+x%I8ZikvWigDF;.FX"><field name="NUM">1</field></block></value></block></value><statement name="DO0"><block type="variables_set" id="-zw%#3z%_W_t9|}+h/T/"><field name="VAR" id="j@g5It[~2@Y}DI%)#AG,">returnedMove</field><value name="VALUE"><block type="text" id="M;TqFdgPj4Z,Ab~uaG|}"><field name="TEXT">up</field></block></value></block></statement><next><block type="controls_if" id="R+uWXT}Q#tDT!#@e}U@^"><value name="IF0"><block type="logic_compare" id="t[N*hydrG:!%#0u3D9Em"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="h|{~X#i^ul86Gv#VGSm:"><field name="VAR" id="^h]e!c(CEKL*OQgQ#=V2">firstValidMove</field></block></value><value name="B"><block type="math_number" id="L4IwO/0Ci64q+t/6G?3c"><field name="NUM">2</field></block></value></block></value><statement name="DO0"><block type="variables_set" id="XjSba!TNQ3u_tgjUb?$+"><field name="VAR" id="j@g5It[~2@Y}DI%)#AG,">returnedMove</field><value name="VALUE"><block type="text" id="CQ0?|=flky?V*:K8^l=n"><field name="TEXT">down</field></block></value></block></statement><next><block type="controls_if" id="(kp,8gJ^_z5S/cl$T)@)"><value name="IF0"><block type="logic_compare" id="e,E9nx0A*r16+G]Da,uu"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="8aw^wMXL/V(X~x-*}@g:"><field name="VAR" id="^h]e!c(CEKL*OQgQ#=V2">firstValidMove</field></block></value><value name="B"><block type="math_number" id="FdVOX|;qt;R0srg.2Q2X"><field name="NUM">3</field></block></value></block></value><statement name="DO0"><block type="variables_set" id="eiS)3JT$}50:@%dAoRe1"><field name="VAR" id="j@g5It[~2@Y}DI%)#AG,">returnedMove</field><value name="VALUE"><block type="text" id="3^sn{_EZl,j#krr7MhEq"><field name="TEXT">left</field></block></value></block></statement><next><block type="controls_if" id="wwM~{pmXBd.ti.Swk+B5"><value name="IF0"><block type="logic_compare" id="QF%y6i!`EZWl786}aR3p"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="{c_Kw1onk[x)kcxCDS]l"><field name="VAR" id="^h]e!c(CEKL*OQgQ#=V2">firstValidMove</field></block></value><value name="B"><block type="math_number" id="TgQTdZ?!vP%(|DL[Y%5]"><field name="NUM">4</field></block></value></block></value><statement name="DO0"><block type="variables_set" id="Ld_C0sd1Sqr[jFYSMTD-"><field name="VAR" id="j@g5It[~2@Y}DI%)#AG,">returnedMove</field><value name="VALUE"><block type="text" id="8zt+OQU}XM[VMWjK|rE#"><field name="TEXT">right</field></block></value></block></statement></block></next></block></next></block></next></block></next></block></statement><value name="RETURN"><block type="variables_get" id="X=S:FCxQ4H--gSZTp-8N"><field name="VAR" id="j@g5It[~2@Y}DI%)#AG,">returnedMove</field></block></value></block><block type="procedures_callreturn" id=":;2-P7MS1G|{n@BDE;L9" x="191" y="1353"><mutation name="your snake"></mutation></block></xml>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment