| Problem Type | The Pattern to Use | | :--- | :--- | | | for(let i = 0; i < 5; i++) //action | | Do something until a wall | while(frontIsClear()) move(); | | Do something until a ball is present | while(noBallsPresent()) move(); | | Put a ball in every empty spot | if(noBallsPresent()) putBall(); | | Turn right | turn_left(); turn_left(); turn_left(); |
move(); Use code with caution. Copied to clipboard Core Karel Concepts & FAQ codehs all answers karel top
You’ve just started your coding journey. You open CodeHS, and there he is: a little dog named Karel. Your teacher says, "Move Karel to the top shelf," or "Pick up the newspaper." | Problem Type | The Pattern to Use