Showing the essence of programming in 20 minutes to schoolkids - how?

Andreas Raab Andreas.Raab at gmx.de
Wed Feb 20 15:24:17 UTC 2002


Hi Cees,

Doing it in twenty minutes is _really_ hard. But I think it might be
doable. Here's what I would try: I'd tell the kids that people come to
you and ask you to solve a problem using a computer. As an example, some
company might ask you to make a computer control a robo-car so that it
stays on the road. Depending on how much time you really have you could
either prepare the machines with a sketch of the road and the car or you
could have the kids draw it (it takes time though, since you'd have to
explain the painting system first and it's not accurately to the point
since you're no car designer).

The natural answer to the problem is to "put the car on the road and
make sure it stays there". Putting the car on the road is simple (you
just do it) but how do we make sure it stays there? Well, we need
something that tells us if the car's on the road or not. So we need a
sensor (which should be drawn with the car). Then we need to "write a
program" that makes sure the car stays on the road. So you get into a
viewer (which you have hopefully localized for this exercise ;-) and
drag out an empty script. Drag in a test tile. Now the question is "is
there some test that tells us if the car is on the road or not" and yes,
there is (color sees). You take it out and drop it into the test tile.
Since the "color sees" test requires arguments you use the color of the
sensor and the color of the road to build the test. The test now
represents the question "is the car on the road?".

So what do we need to do if the car _is_ on the road? Well, first of all
nothing, so we ignore it. What do we need to do if the car is _not_ on
the road? Well, we need to turn to get back on the road. At this point,
you can just grab a turn tile and drop it into the "no" part of the
test. Okay, so that should do it, right? Let's test it. [You should
probably have a button on the screen that just does a "forward by"
script so the kids don't have to worry about even more complexity]. You
set your script to ticking (since the car is on the road nothing will
happen) and make the car go. The kids will see that if the car goes off
the road it will turn, but not correctly - once it crossed the road it
will turn around and go the other way. So what's wrong here? Well, it
seems like if we _only_ turn when the car is not on the road we're not
really following it. Can we try to make it follow just one side of the
road?! Well we can - just by turning towards the "off-road" direction
when we are on the road. So we also need to turn when we are on the road
- just in the opposite direction. Drag out another turn tile and give it
a negative number (not sure if that's good though in this age group -
you might consider adding a "turn left" and "turn right" tile for the
demo) and drop it into the "yes" part. Now we test again. And voila! It
works. You just wrote a program for your client that makes the car
follow the road.

And that's what you do. Solving problems by using computers.

I think you could do the above with the kids. Assuming that they have
been exposed to computers before (e.g., that they know how to click,
drag, and type) it should be possible to get it done within twenty
minutes.

Cheers,
  - Andreas

PS. If you need any help in staging this let me know. I'd be happy to
assist.

> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org 
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On 
> Behalf Of Cees de Groot
> Sent: Wednesday, February 20, 2002 2:36 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: Showing the essence of programming in 20 minutes to 
> schoolkids - how?
> 
> 
> Sorry for the long title :-).
> 
> My kids' school (basisschool/grundschule/6-12 years) has a yearly
> school party/fair, always with some nice theme, and this 
> year's theme is
> "what do you want to become when you grow up?". As part of the theme,
> they are asking parents to chat with the kids about their 
> jobs. The format is
> groups of ~8 kids, you get around twenty minutes with each group.
> 
> My wife has an easy one - as a dentist's assistant she only 
> needs so show up
> with some scary equipment, hand all the kids a mirror to 
> inspect each other's
> teeth, and that's it. 
> 
> But how (with a couple - how many? - computers at hand 
> running Squeak) do
> you explain to kids of, say, 8 years old the essence of a computer 
> programmer's job?
> 
> -- 
> Cees de Groot               http://www.cdegroot.com     
> <cg at cdegroot.com>
> GnuPG 1024D/E0989E8B 0016 F679 F38D 5946 4ECD  1986 F303 937F 
> E098 9E8B
> 





More information about the Squeak-dev mailing list