Please enable JavaScript to use CodeHS


Intro to Programming with Karel the Dog (Ace)

Lessons

  1. Introduction to Programming

    1. 1.1 Introduction to Programming With Karel

    2. Description

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

    3. Objective

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

    4. 1.2 More Basic Karel

    5. Description

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

    6. Objective

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

    7. 1.3 Karel Can't Turn Right

    8. Description

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

    9. Objective

      Use Karel and commands to introduce students to functions.

    10. 1.4 What is a Computer?

    11. 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.

    12. 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

  2. Functions

    1. 2.1 Functions in Karel

    2. 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.

    3. Objective

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

    4. 2.2 More Practice with Functions

    5. 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.

    6. 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

    7. 2.3 The Start Function

    8. Description

      All programs start by ?calling? the start function.

    9. 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.

    10. 2.4 Top Down Design and Decomposition in Karel

    11. 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.

    12. 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

  3. Super Karel and For Loops

    1. 3.1 Commenting Your Code

    2. 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.

    3. 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

    4. 3.2 Super Karel

    5. 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.

    6. 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)

    7. 3.3 For Loops

    8. 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
      }
      
    9. 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

    10. 3.4 More Practice with For Loops

    11. 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.

    12. 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

  4. If Statements

    1. 4.1 If Statements

    2. 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.
    3. 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

    4. 4.2 If/Else Statements

    5. Description

      In this lesson we take a look at more conditional statements, more specifically if/else statements. If/else statements let us do one thing if a condition is true, and something else otherwise.

      We write if/else statements like this:

      if(frontIsClear()) {
          // code to execute if front is clear
      } else {
          // code to execute otherwise
      }
      
    6. Objective

      Students will be able to…
      * Explain the purpose of an If/Else statement
      * Create If/Else statements to solve new types of problems
      * Identify when an If/Else statement is appropriate to be used

    7. 4.3 More Practice

    8. Description

      This lesson is more practice with if statements and if / else statements.

      In this lesson we take a look at more conditional statements, more specifically if/else statements. If/else statements let us do one thing if a condition is true, and something else otherwise.

      We write if/else statements like this:

      if(frontIsClear()) {
          // code to execute if front is clear
      } else {
          // code to execute otherwise
      }
      
    9. Objective

      Students will be able to…
      * Explain the purpose of an If/Else statement
      * Create If/Else statements to solve new types of problems
      * Identify when an If/Else statement is appropriate to be used

  5. While Loops

    1. 5.1 While Loops in Karel

    2. Description

      In this lesson we introduce a new type of loop: while loops. While loops allow Karel to repeat code while a certain condition is true. While loops allow us to create general solutions to problems that will work on multiple Karel worlds, rather than just one.

    3. Objective

      Students will be able to…
      * Explain the purpose of a while loop
      * Create while loops to repeat code while a condition is true
      * Utilize while loops to solve new types of problems
      * Test their solutions on different Karel worlds

    4. 5.2 More Practice with While Loops

    5. Description

      In this lesson we’ll practice solving more problems with while loops.

      While loops allow Karel to repeat code while a certain condition is true. While loops allow us to create general solutions to problems that will work on multiple Karel worlds, rather than just one.

    6. Objective

      Students will be able to…
      * Explain the purpose of a while loop
      * Create while loops to repeat code while a condition is true
      * Utilize while loops to solve new types of problems
      * Test their solutions on different Karel worlds

  6. Control Structures

    1. 6.1 Control Structures Example

    2. Description

      In this lesson we take a look at control structures. Some control structures allow us to ask questions: if, if / else statements. Other control structures allow us to repeat code like for loops and while loops. Basically, control structures allow us to control the way the commands execute.

    3. Objective

      Students will be able to…
      * Identify the different control structures we can use to modify the flow of control through a program
      * Combine control structures to solve complicated problems
      * Choose the proper control structure for a given problem

    4. 6.2 More Karel Examples and Testing

    5. 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.

    6. Objective

      Students will be able to…
      * Analyze a solution to a problem and explain why it works
      * Use control structures to create general solutions that work on all Karel worlds

    7. 6.3 How to Indent Your Code

    8. 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.

    9. Objective

      Students will be able to…
      * Explain why it is important to indent code
      * Identify proper indentation
      * Modify a program to have proper indentation
      * Write programs with proper indentation

    10. 6.4 Ultra Karel

    11. Description
    12. Objective
  7. Karel Challenges

    1. 7.1 Karel Challenges

    2. Description

      It’s time to put it all together! Students have learned all of Karel’s abilities, and have practiced writing programs to solve Karel problems. In this lesson, students will synthesize all of the skills and concepts learned in the Karel unit to solve increasingly challenging Karel puzzles.

    3. Objective

      Students will be able to…
      * Define a problem in their own words and plan out a solution to the problem
      * Break a large problem down into smaller pieces and solve each of the pieces, then use these solutions as building blocks to solve the larger problem
      * Utilize the proper control structures to create general solutions that solve multiple Karel worlds
      * Write clear and readable code using control structures, functions, decomposition, and comments

  8. Final Project

    1. 8.1 Final Project

    2. Description

      In this unit, you’ll get to combine all of the new skills you’ve learned to create your own project from scratch!

    3. Objective

      Students will synthesize concepts and skills learned in the course to create their own final project.
      Students will scope their project (eliminate features that aren’t necessary) so that it fits in the timeframe allotted.
      Students will present their project to their classmates and talk about how the project was developed.

  9. Extra Karel Practice

    1. 9.1 Extra Karel Practice

    2. Description
    3. Objective
  10. Extra Karel Challenges

    1. 10.1 Extra Karel Puzzles

    2. Description
    3. Objective
  11. Basic Javascript and Graphics

    1. 11.1 Hello World

    2. Description
    3. Objective
    4. 11.2 Variables

    5. Description
    6. Objective
    7. 11.3 User Input

    8. Description
    9. Objective
    10. 11.4 Basic Math in JavaScript

    11. Description
    12. Objective
    13. 11.5 Using Graphics in JavaScript

    14. Description
    15. Objective
    16. 11.6 Booleans

    17. Description
    18. Objective
    19. 11.7 Logical Operators

    20. Description
    21. Objective
    22. 11.8 Comparison Operators

    23. Description
    24. Objective
    25. 11.9 If Statements

    26. Description
    27. Objective
    28. 11.10 For Loops in JavaScript

    29. Description
    30. Objective
    31. 11.11 General For Loops

    32. Description
    33. Objective
    34. 11.12 For Loop Practice

    35. Description
    36. Objective
    37. 11.13 Random Numbers

    38. Description
    39. Objective
    40. 11.14 While Loops

    41. Description
    42. Objective
    43. 11.15 Loop and a Half

    44. Description
    45. Objective
    46. 11.16 Functions and Parameters 1

    47. Description
    48. Objective
    49. 11.17 Functions and Parameters 2

    50. Description
    51. Objective
    52. 11.18 Functions and Parameters 3

    53. Description
    54. Objective
    55. 11.19 Functions and Return Values 1

    56. Description
    57. Objective
    58. 11.20 Functions and Return Values 2

    59. Description
    60. Objective
    61. 11.21 Local Variables and Scope

    62. Description
    63. Objective
    64. 11.22 Basic JavaScript and Graphics Challenges

    65. Description
    66. Objective
  12. Karel Multiple Choice Exam

    1. 12.1 Karel Exam

    2. Description
    3. Objective
  13. Karel Syntax Introduction