var mineGui_mine=false,mineGui_curmap,mineGui_curndx,mineGui_moves="";var mineGui_movesBackup=[];var mineGui_customNdx=1;var mineGui_canvas=true;var mineGui_imgSources={sprites:"sprites.png"};var mineGui_spriteOffset={R:5,"#":7,"*":6,"\\":2,L:3,O:4,".":0," ":1,A:8,B:9,C:10,D:11,E:12,F:13,G:14,H:15,I:16,"1":17,"2":18,"3":19,"4":20,"5":21,"6":22,"7":23,"8":24,"9":25};var mineGui_images={};var mineGui_imagesNeed=0;function mineGui_loadImg(b,c){var a;++mineGui_imagesNeed;mineGui_images[b]=a=new Image();a.onload=function(){if(0==--mineGui_imagesNeed){mineGui_show()}};a.src=c}function mineGui_start(){var b=document.getElementById("mineGui");var e=document.getElementById("mineGui_selectMap");var c=document.getElementById("mineGui_moves");var a=document.getElementById("mineGui_data");var f={L:1,U:1,R:1,D:1,A:1,W:1};var d;document.getElementById("mineGui_addData").onclick=mineGui_addCustomMap;e.onchange=function(){var l=e.options[e.selectedIndex].text;mineGui_setMap(mineMaps[l],e.selectedIndex);e.blur()};var g=function(){if(c.value==mineGui_moves){return}mineGui_moves="";var k=c.value.toUpperCase(),l;for(l=0;l0){e.selectedIndex--;e.onchange()}break;case 34:if(e.selectedIndex+10){document.getElementById("mineGui_mineMapWater").textContent=b.splice(-c).join("\n")}else{document.getElementById("mineGui_mineMapWater").textContent=""}document.getElementById("mineGui_mineMapDry").textContent=b.join("\n");document.getElementById("mineGui_moves").value=mineGui_moves;var a="";switch(mineGui_mine.state){case Mine.ALIVE:a="Still mining";break;case Mine.LOST:a="Robot broken - "+mineGui_mine.reason;break;case Mine.ABORTED:a="Aborted";break;case Mine.WON:a="Won - "+mineGui_mine.reason;break}document.getElementById("mineGui_meta").textContent=mineGui_mine.metaText();document.getElementById("mineGui_state").textContent=a;document.getElementById("mineGui_score").textContent=mineGui_mine.score;document.getElementById("mineGui_scoreMoves").textContent=mineGui_mine.moves;document.getElementById("mineGui_scoreLambdas").textContent=mineGui_mine.found_lambdas;document.getElementById("mineGui_belowWater").textContent=mineGui_mine.moves_below_water};