INTRODUCTION TO PROGRAMMING WITH KAREL THE
DOG | TOP SCORES MADE SIMPLE | TRUSTED TEST
SOLUTIONS!
Who/What is Karel? Answer: Karel is a dog who listens to your commands
What do you do with Karel? Answer: You move Karel around the world and put
down tennis balls
Karel Commands Answer: move();
turnLeft();
putBall();
takeBall();
Commands have Answer: No spaces
Exact capitalization
(); at end
Rows in Karel's world are called Answer: Streets
Columns in karel's world are called Answer: Avenues
If Karel is facing North and the code
turnLeft();
turnLeft();
runs; which direction is Karel facing now? Answer: South
1
APPHIA - Crafted with Care and Precision for Academic Excellence.
, If Karel starts at Street 1 and Avenue 3 facing East, what street (row) and avenue
(column) will Karel be on after this code runs?
move();
move();
move();
turnLeft();
move(); Answer: Street 2 and Avenue 6
What is a function? Answer: A function is a way to teach Karel a new word
Writing turnRight Answer: functiuon turnRight(){
turnLeft();
turnLeft();
turnLeft();
}
Why use functions? Answer: Functions allow us to break down our program into
smaller parts, and make the program easier to understand
Defining a function Answer: Specifying the instructions for a new action
Calling a function Answer: Causing the action to actually happen
Defining turnAround() Answer: functiuon turnAround(){
turnLeft();
turnLeft();
}
2
APPHIA - Crafted with Care and Precision for Academic Excellence.
DOG | TOP SCORES MADE SIMPLE | TRUSTED TEST
SOLUTIONS!
Who/What is Karel? Answer: Karel is a dog who listens to your commands
What do you do with Karel? Answer: You move Karel around the world and put
down tennis balls
Karel Commands Answer: move();
turnLeft();
putBall();
takeBall();
Commands have Answer: No spaces
Exact capitalization
(); at end
Rows in Karel's world are called Answer: Streets
Columns in karel's world are called Answer: Avenues
If Karel is facing North and the code
turnLeft();
turnLeft();
runs; which direction is Karel facing now? Answer: South
1
APPHIA - Crafted with Care and Precision for Academic Excellence.
, If Karel starts at Street 1 and Avenue 3 facing East, what street (row) and avenue
(column) will Karel be on after this code runs?
move();
move();
move();
turnLeft();
move(); Answer: Street 2 and Avenue 6
What is a function? Answer: A function is a way to teach Karel a new word
Writing turnRight Answer: functiuon turnRight(){
turnLeft();
turnLeft();
turnLeft();
}
Why use functions? Answer: Functions allow us to break down our program into
smaller parts, and make the program easier to understand
Defining a function Answer: Specifying the instructions for a new action
Calling a function Answer: Causing the action to actually happen
Defining turnAround() Answer: functiuon turnAround(){
turnLeft();
turnLeft();
}
2
APPHIA - Crafted with Care and Precision for Academic Excellence.