Please enable JavaScript to use CodeHS

Intro to Programming with Karel the Dog (Español)

Description

Students are introduced to CodeHS and how Karel the Dog can be given a set of instructions to perform a simple task.

Objective

Introduce students to Karel and explain the commands she can be given.

Description

Students will learn about Karel’s ‘World’ and the ways that Karel can interact with it.

Objective

To introduce students to Karel’s world and more of the commands that we can teach Karel

Description

Karel can learn new words or commands through the use of functions. This is called defining a functions. Defining functions has syntax rules.

Objective

Use Karel and commands to introduce students to functions.

Description

When was the first computer made? What did it look like, and what was it used for? In this lesson, students will learn about the creation and evolution of computing machines that now permeate our day-to-day life.

Objective

Students will be able to…
* Discuss the question “What is a Computer?” with their peers
* Identify important historical events in the development of modern computers
* Describe the role computers play in their lives

Description

Functions are used to teach Karel a word or command. Using functions allow us to break down our program into smaller pieces and make it easier to understand.

Objective

Help students understand what functions are for and how using them improves programs.

Description

Functions are used to teach Karel a word or command. Using functions allow us to break down our program into smaller pieces and make it easier to understand.

Objective

Students will be able to…
* Create their own functions
* Utilize functions to create higher order programs that go beyond the basic toolbox of Karel commands
* Debug programs that use functions incorrectly

Description

All programs start by ?calling? the start function.

Objective

Students gain a deeper understanding of functions. Students can explain the importance of writing readable code, and can analyze and compare the readability of different programs. Students can use the start function to make their programs more readable.

Description

Top down design and Decomposition are the processes of breaking down a program into functions into smaller parts to avoid repeated code and make our program more readable.

Objective

Students will be able to…
* Break a large problem down into smaller pieces
* Write methods to solve each smaller problem
* Solve a complicated problem using Top Down Design
* Identify good and poor decomposition

Description

Comments give notes to the reader to explain what your code is doing. Two types of comments that can utilized are preconditions and postconditions. Preconditions are assumptions we make about what is true before a function is called in our program. Postconditions are what should be true after a function is called in our program.

Objective

Students will be able to…
* Explain the preconditions and postconditions of a function
* Create clear and readable comments in their code that help the reader understand the code
* Explain the purpose of comments

Description

Introducing Super Karel! Since commands like turnRight() and turnAround() are so commonly used, we shouldn’t have to define them in every single program. They should come prepackaged with the Karel library. This is where SuperKarel comes in. SuperKarel is just like Karel, except SuperKarel already knows how to turnRight and turnAround, so we don’t have to define those methods ourselves anymore.

Objective

Students will be able to…
* Write programs that use SuperKarel instead of Karel
* Utilize the new toolbox of commands that SuperKarel provides over Karel
* Read documentation to understand how to use a library (SuperKarel is an example of this)

Description

This lesson teaches students how to use for loops in their programs. The for loop allows you to repeat a specific part of code a fixed number of times.

We write for loops like this:

for(var i = 0; i < 4; i++)
{
    // Code to be repeated 4 times
}
Objective

Students will be able to…
* Create for loops to repeat code a fixed number of times
* Explain when a for loop would be a useful tool
* Utilize for loops to write programs that would be difficult / impossible without loops

Description

This lesson gives students more practice creating and debugging for loops. The for loop allows you to repeat a specific part of code a fixed number of times.

Objective

Students will be able to…
* Create for loops to repeat code a fixed number of times
* Debug programs with incorrect for loop usage
* Explain when a for loop should be used

Description
  • A condition is a function that returns a true/false answer.
  • JavaScript uses if statements as a way to make decisions and execute specific code. If statements are helpful in writing code that can be used in different situations.
Objective

Students will be able to…
* Use conditions to gather information about Karel’s world (is the front clear, is Karel facing north, etc)
* Create if statements to only execute code if a certain condition is true

Description

If and if/else statements allow Karel to handle different types of worlds and allow us to solve more general problems.

Objective

Students will be able to understand when to execute code if a condition is true or otherwise

Description

While loops allow us to repeat a section of code as long some condition is true.

Objective

Students will be able to

Description

Control structures (like loops and if statements) are useful in building programs that can be applied in various Karel worlds. This lesson is designed to test students? knowledge of control structures in preparation for the upcoming Karel challenges.

Description

Indentation is especially important when using multiple loops, functions, and if statements to show the structure of the code. The indentation gives you a good visual way to see what commands are inside vs. outside of a loop or if statement.