To edit the maze click on a square while holding shift to set white or ctrl to set black.
//Step the Bilby advance(1); //step forwards showsense(); if(sense(0) == 0){ //front sensor black? if (edge == 2){ //blocked right for(i = 1;i<21;i++){ rotate(1); //turn left showsense(); } //a }else{ for(i = 1;i<21;i++){ rotate(-1); //turn right showsense(); } //b }; edge = 0; }else{ if(sense(1)== 0){ //left sensor black edge = 1; rotate(-1); rotate(-1) //turn right }else{ if(sense(2) == 0){ //right sensor black edge = 2; }; rotate (1); //turn left }; }; if(running){setTimeout('steppit();',50);} else{document.panels.doit.value="Run Bilby";};
//Reset Bilby theta = 3.1416 / 40; dd = .05; sinTheta = Math.sin(theta); cosTheta = Math.cos(theta); sb = -1; //bilby sin cb = 0; //bilby cos xb = .5; //Initial bilby x measured in 'squares' yb = 15.5; edge=0; xs = new Array( 0, -.51, .51); //Sensor positions ys = new Array(.5, .4, .4 );