void jumpTheHurdles(){ while(!onBeeper()){ if(frontIsClear()){moveForward();} //checking if still not on beeper, then go another round if(!onBeeper()){ turnLeft(); while(!rightIsClear()) { moveForward(); } turnRight(); moveForward(); turnRight(); while(frontIsClear()) { moveForward(); } turnLeft();} } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter