Error
Errors:
Grader Results
Pass | Test | Message | |
---|---|---|---|
- | Test results will show here. | - |
Errors:
Karel goes back to clean up the street she adopted once a week for the next three weeks. Each time she finds that there is less litter!
Write one program that has Karel clean up the litter regardless of which week it is. Start with the program you wrote for the Litter Pick Up Level 2 activity. Then, revise your program to include some if statements that help Karel react to the different amounts of litter each week.
Make sure to test your program against all three worlds!
Debugging Tips
- Basic Commands:
- Use the error message to identify where your mistake is.
- Check that you correctly spelled the command.
- Check that you included the parentheses.
- Ensure all commands are all the way to the left - there are no spaces before the command.
- For Loops and If Statements:
- Check that you included the colon.
- Check your indentation. If you press “enter “after the colon, the editor should automatically indent for you.
- If you need to adjust your indentation, use the “tab” key.
Ending World
Karel's Built in Commands
Karel Commands
|
|
|
|
|
UltraKarel
UltraKarel Commands
|
UltraKarel Conditions
|
|
Color
Random
Functions
Writing a Function
Writing a function is like teaching karel a new word.
Naming Functions: You can name your functions whatever you want, but you can't have spaces in the function name.
Remember that commands in functions must be indented one level
Calling a Function
You call a function to tell the computer to actually carry out the new command.
Conditional Statements
Remember that comands in conditional statements must be indented one level.If statements
If/Else statements
Example of if statements
Karel Conditions
Don't forget the()
at the end!
|
|