Error
Errors:
Want more? See our full documentation!
Super Karel's Built in Commands
Commands
|
|
|
|
|
|
|
|
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 each open bracket { must match with a close bracket }
Conditional Statements
If Statements
Remember that each open bracket { must match with a close bracket }Example of if statements
Karel Conditions
Don't forget the()
at the end
|
|
Loops
Remember that each open bracket { must match with a close bracket }While Loops
Example of while loops
For Loops
Note: you can use both "let" and "var" in your for loops (they are two types of JavaScript variables). Use whichever you have been taught in your course.Example of for loops
You can have multiple statements or function calls in a for loop.
Use for-loops when you want to repeat something a fixed number of times.
Use while-loops when you want to repeat something as long as a condition is true.
Comments
Comments
Slides and Notes
No slides available for this video
Import Code from Assignment
Collaborate on this sandbox program!
Admin Only. Not visible to customers
A collaborative program is a program you can work on with a partner or group of people. The program shows up in all of your sandbox pages, and when any of you save code, it will save it for each person.
Current Collaborators:
Embed Your Code On an HTML Page
Want to use your CodeHS code outside of CodeHS? Use this embed code to get started.
How to Use
Version 1: On Your Computer
- Create a file called
codehs.html
on your desktop - Put the html below into the codehs.html file and save it
- Now double click the file to open it in a web browser
Version 2: Online
- Create a file called
codehs.html
on your desktop - Put the html below into the codehs.html file and save it
- Upload this file to the internet
- Visit your web page