Error
Errors:
This program has Karel walk down the street and pick up litter as she goes. You can change the world to see how Karel’s cleanups are impacting the amount of litter from week to week. Notice how the if statement enables Karel to use the same program to clean up her community even when the litter is in different places!
Exploration Questions:
- How does changing the world impact the program?
- What happens when you move the first
move()
command to inside of the if statement? - What happens when you change the number inside the for loop?
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!
|
|