LESSON 3

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

VOCAB:

Term Definition
Define a Function Defining a function means to teach the computer a new command and explain what it should do when receiving that command.
Call a Function Calling a function actually gives the command, so the computer will run the code for that function.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:Do:  1.2.2 More Basic Karel Quiz
  2. WATCH:  1.3.1 Karel Can’t Turn Right
  3. Do:  1.3.3 Tower and Turn Right–experiment!
  4. Do:  1.3.4 Slide Karel–show me
  5. Do:  1.3.5 Fireman Karel
  6. Did you get it?!  1.3.6 Karel Turns Right Badge
  7. If time permits: Rewrite previous exercises using functions.
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. What are functions?
    2. Why are functions useful?
    3. Write out a function for an everyday activity that you perform, for example:
      function eatSandwich(){bring sandwich to mouth;bite down;chew;}

LESSON 4

GOAL: 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.

VOCAB:

Term Definition
Define a Function Defining a function means to teach the computer a new command and explain what it should do when receiving that command.
Call a Function Calling a function actually gives the command, so the computer will run the code for that function.
Curly Bracket An open curly bracket is { and a close curly bracket is }
Function body The part of a function that contains the commands

DO THE FOLLOWING IN THIS ORDER:

  1. REVIEW:
    1. Get the Karel Can’t Turn Right handout from your teacher & complete it–show me before moving on
    2. Get the What’s Wrong with This Function? handout from your teacher & complete it–show me before moving on
    3. Do:  1.3.2 Karel Can’t Turn Right Quiz
  2. Do the Dancing with Functions class activity–get the handout from your teacher
  3. Watch:  1.4.1 Functions in Karel
  4. Do & experiment:  1.4.3 Turn Around
  5. Do & show me:  1.4.4 Pancakes
  6. Do & show me:  1.4.5 Mario Karel
  7. If time permits: Create an original Sandbox program that defines and calls a minimum of 4 (four) functions.
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. Why are functions important?
    2. How do functions change how we think about our programs?

Leave a comment

Your email address will not be published. Required fields are marked *