Y5/6 LQ: How do I use procedures in LOGO?

  • Start your program with “reset”
  • Break you picture up into small pieces that you can program.  (DECOMPOSE it)
  • Pick one piece and write the code for it
    • write a bit, test it, DEBUG it – keep going
  • Write “TO procedure_name” at the beginning and “END” at the end of your code for that piece – this makes it into a PROCEDURE.
  • You have now taught your computer how to do it and in your code, you just need to type “procedure_name” (choose a name that tells you or anyone else reading your code what it is)

 

Simplify – Try this activity to put LOGO code in the right order to make a procedure:  procedure reorder

VARIABLES

If you want to repeat your piece in different ways, eg different sized circles, you can use a variable in your procedure.  It’s a bit like “fd” needs a number with it to tell it how far to go.

  • to dot :size
  • circle :size
  • end

Then when you write “dot” in your program, you need to give it a number, which will be its size, eg dot 40