Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: MWcybercourse@xxxxxxxxxxxxxxx
Subject: Re: What works? what doesn't?
From: WendyPetti@xxxx
Date: Tue, 17 Apr 2001 08:32:24 EDT

In a message dated 4/17/01 1:03:41 AM Eastern Daylight Time, 
edwinp13@xxxx writes:

> I would like to capitalize on these kids' fascination and 
> show them how to program more complex structures. I'm thinking up 
> and testing several programs that I'll pre-load on the iMacs to show 
> more advanced features. I would like to be able to direct my efforts 
> towards those type of approaches that you know has a greater chance 
> of re-directing these kids from their present fixations.

Edwin, first of all I would recommend NOT pre-loading programs. You can 
tantalize kids if you want by preloading a project on ONE computer, but I 
rarely do that, either. Kids are accustomed to being shown things, but since 
it is so easy to create their own impressive effects with a few minutes of 
simple coding, I think they should just keep building their own projects with 
your guidance but without sneak previews.

There are at least three motivations that appeal to kids for creating 
procedures:
1) A command in the command center is lost when you close the project, while 
a procedure is preserved, of course, so you can recreate your effects easily 
if you have saved a procedure.
2) If you create a button with the procedure name, then it becomes a 
one-click operation to reactivate a procedure. I often would have my 
students create a second button named "cg" (or it could be called "eraser" or 
whatever, as long as they write a related procedure --

to eraser
cg
end

3) Once you set up a simple procedure, it is easy to create jazzier 
procedures built around the original procedure. 

You could begin by showing them another way to build a spirograph, and you 
could include a variable controlled by a slider:

to triangle
repeat 3 [fd 100 rt 120]
end

to spirograph
repeat howmany? [triangle rt 360 / howmany?
end

(... I wrote the preceding and the following without remembering that you are 
not using MicroWorlds with your classes. I do not know the capabilities of 
Terrapin in regard to buttons and sliders. But since you have written to the 
MicroWorlds cybercourse folks, I am going to answer you with a MicroWorlds 
environment:)

Make a "spirograph" button. Make a slider called "howmany?" and set its 
range from maybe 3 to 180 or however many they want.

Now start weaving in other variables. In the triangle procedure, replace "fd 
100" with "fd length" and make a "length" slider with a range from maybe 10 
to 200.

How about having each triangle drawn in a different color?

to spirograph
repeat howmany? [setc color + 1 triangle rt 360 / howmany?
end

or how about drawing different spirographs layered on top of each other, each 
layer with triangles of a different size and color? Then you would need a 
slider to control the color:

to spirograph
repeat howmany? [setc color? fd length triangle rt 360 / howmany?
end

and make a slider called "color?" with a range from 0 to 139. (Remember that 
a slider cannot have the same name as a primitive, and "color" is already a 
primitive, which is why I add the question mark. Keep variable names 8 
letters or fewer, because the slider, at least on PCs, only shows about 8 
letters.

And then you could also control the thickness of the pen:

to spirograph
repeat howmany? [setc color? setpensize howthick triangle rt 360 / howmany?]
end

And then it would be nice to control the number of sides in each polygon with 
a slider, too:

to polygon
repeat #sides [fd length rt 360 / #sides
end

to spirograph
repeat howmany? [setc color? setpensize howthick polygon rt 360 / howmany?]
end

and make a "#sides" slider with a range from maybe 3 to 20. Usually 20 sides 
begins to closely resemble a circle unless your side length is substantial.

If you don't have sliders in your Terrapin environment then you end up with 
something more like this:

to spirograph :howmany? :color? :howthick 
... and you would have to control the side length and number of sides also 
within that procedure since you wouldn't have slider control over the polygon 
procedure... so you might have this (and do notice that now we need the colon 
symbol not just for every variable in the procedure name but also within the 
procedure itself):

to spirograph :howmany? :color? :howthick :length :#sides
repeat :howmany? [setc :color? setpensize :howthick repeat :#sides [fd 
:length rt 360 / :#sides] rt 360 / :howmany?]
end

and in the command center you might supply a command such as this:

spirograph 30 51 3 100 4

which would drawn 30 squares of pen thickness 3 in color 51 (light green in 
MicroWorlds, anyhow).

This gets rather confusing since the kids will have to supply five reasonable 
variable inputs after typing "spirograph," and they won't be able to use a 
spirograph button, but back in our Logowriter days before MicroWorlds, I did 
have my third-graders control up to five variables at once in this fashion. 
(We didn't control pen thickness but we did weave sound pitches into the 
procedure so that, perhaps, a tone gets higher and higher as the design is 
drawn.) To make it easier for my kids to keep track of meaningful values to 
input for each variable, I might post a chart on the wall listing the 
variable names in order with their appropriate ranges under each name.

Using buttons and sliders and MicroWorlds, the sequence I've outlined above 
can be done in one lesson with second-graders, and it is highly motivating 
for them to see the ever-growing variety of effects they can control with the 
additional sliders.

I jumped into this sequence without talking about how I introduce the concept 
of variables in the first place, though. I would hold up an empty cup -- 
paper or styrofoam -- and write a variable name on it. I would say, "A 
variable name is like an empty cup. We need to put one thing in the cup. 
Sometimes we put a number in the cup. Sometimes we might put a word in the 
cup. Or we might put a list. Whatever we put in the cup, that is the value 
of the variable." I would then say that today we are using variables which 
are looking for numbers. And then I might have a little pile of popsicle 
sticks with a number written on the end of each one, and I'd ask a child to 
choose a popsicle stick to place in the cup. Then I'd say, for instance, 
"Now the variable 'length' has the value: 50" (or whatever). We'd take out 
that stick and choose another. I would make the point that we just put one 
stick (one value) in the cup for each variable. And I would tell them that 
if we are going to control a variable from the command center rather than 
with a slider, then we need to remember to provide a value for each variable 
that we've set up in the procedure name. For instance, if we want to control 
the size of a square from the command center, we might create this procedure:

to square :length
repeat 4 [fd :length rt 90]
end

Then if we just type "square" in the command center, we will get a message,

"square needs more inputs"

because when we include the :length after the word "square" in the 
procedure name, we are setting up a variable and we need to remember to give 
this variable a value when we call this procedure. It is an empty cup 
looking for a number stick. So we might write

square 100

(square 60, or whatever).

Of course, when you use sliders, you don't need to keep track of how many 
variable inputs to supply when calling the procedure, because whether or not 
you change the values on the sliders, they are set to SOME value at all 
times. If you forget to create a slider to go with each variable, however, 
then you will get the error message about "____ needs more inputs."

Sorry that this has become rather rambly!

Wendy


  • Previous by thread: What works? what doesn't?
  • Next by thread: a name for the online course

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2008