[Squeakland] Copying from one project to another?

Bert Freudenberg bert at impara.de
Thu Oct 27 16:18:47 PDT 2005

Am 27.10.2005 um 22:30 schrieb Mark Engelberg:

>> BTW, pretty much every feature you have asked about so far are  
>> things we've
>> put in the system to experiment with but are not generally used  
>> with children.
>> Cheers,
>> Alan
> I assure you that my questions are child-driven, although filtered
> through my own programming experience.
> Consider an example from this morning:
> My son wants to know how to set up a series of "waypoints", and
> program a car to drive (one step at a time) from one waypoint, to the
> next, and so on.
> I think about the problem, and as a programmer, I know that one
> sensible way to program this is to put the waypoints in some sort of
> list or array.  Then you could, for example, have a variable that
> stores an index into the array, for the waypoint which is the car's
> current destination.  The car's script says to advance toward the
> current destination, and upon reaching the destination, to advance the
> variable to the next waypoint in the list.  What does it do when
> getting to the end of the list?  Well, you could experiment with
> looping back to the beginning of the list, or traversing the list in
> reverse order, or just stopping.

Of course, you as a programmer are thinking in terms of data  
structures. Etoys is restricted in that area, but rich in ways to  
make objects do what you want.

For example, in contrast to any other programming environment I could  
think of, in Etoys it's actually easier to make the car follow a  
painted road that connects your waypoints!

> But then I realize that I have no idea whether etoys has any concept
> of lists or arrays.  So I get on this list and say, "Hey guys, is
> there any way to manipulate a list of objects in etoys?"  (Is there?)

Yes - get a "holder" from the supplies flap and drop your objects in  

> So of course, my son isn't the one specifically asking whether it is
> possible to make lists of objects.  He doesn't have the conceptual
> framework to ask his question in that way.  But he has a problem he
> wants to solve, and I'm trying to help solve it.
> The more I know about etoys, and the full scope of what it is capable
> of, the better I'll be able to answer my son's questions about, "How
> do I....?"
> I appreciate all the help I've gotten so far, and look forward to
> learning more about this fascinating system.

I'm sometimes surprised myself about what kinds of solutions evolve  
when you really start to think in terms of objects.

Like, again, your car and the waypoints. Isn't it much more natural  
to make a waypoint direct the car to itself, and when the car reaches  
it, turn to the next? Nothing to explain about lists, worry about  
wrap over etc., just this point and the next.

I've just made such a project:


Mind you, this version uses much more advanced concepts than a simple  
follow-the-road script would have. It activates and freezes scripts,  
and uses connectors to, well, connect waypoints. Still, I somehow  
like this solution :)

- Bert -

More information about the Squeakland mailing list