Karel 1.3.2 - repairTheStreet

PHOTO EMBED

Thu Aug 11 2022 10:09:04 GMT+0000 (Coordinated Universal Time)

Saved by @bibberhug

void repairTheStreet(){
    
    repeat(9){
        turnRight();
        
        if(frontIsClear()){
            moveForward();
            dropBeeper();
            turnAround();
            moveForward();
            turnRight();
            moveForward();    
        }
        else{
            turnLeft();
            moveForward();
        }
    }
    
    turnRight();
    
    if(frontIsClear()){
        moveForward();
        dropBeeper();
        turnAround();
        moveForward();
        turnRight();    
    }
    else{
        turnLeft();
    }
}
content_copyCOPY