Apr 13, 2025
turnRight(); as a command, but it results in an error as Karel only understands the turnLeft command.turnRight Functionfunction followed by the name of the function, turnRight.function turnRight() {
// function body
}
turnRight, the body consists of turning left three times:
turnLeft();
turnLeft();
turnLeft();
turnRight Function:
turnRight in the Code:
turnRight(); wherever needed in the code.turnRight, reset and run the program.