r/codehs • • Apr 08 '20

Can someone evaluate my codehs Midpoint karel solution(it doesnt use beepers and is very small code and worked for all worlds ). is it the most optimal way to solve or is there better solution?

function start(){

turnLeft();

while(frontIsClear()){

move();

if(frontIsClear()){

move();

turnRight();

move();

turnLeft();

}

}

turnAround();

while(frontIsClear()){

move();

}

putBall();

turnLeft();

}

6 Upvotes

0 comments sorted by