[Squeakland] getting code from a .txt file into a script
Alan Kay
Alan.Kay at squeakland.org
Tue Mar 23 09:12:56 PST 2004
Hi Gary --
You are between two different worlds. The etoys part of Squeak has
been artificially restricted and carefully designed to make it easier
for children to make *etoys* using various kinds of media. There is a
fair amount of design thought and testing in those decisions, and
some of these are reflected in Kim's and BJ's book "Powerful Ideas in
the Classroom". My strongest advice is to work through these projects.
(For example, you say "This is an etoy. How do I point it at the car
object?" But it isn't an etoy. In an etoy you get an object by
drawing or from one of the parts bins, get its halo, and click on the
light blue "viewer" button, to open its viewer on the right hand side
of the screen. This viewer holds all the phrases that have meaning to
your object, and these phrases are already "pointed to the object".
If you make scripts from these phrases, they will work. This is how
etoys are programmed in the world of the child.)
Trying to do "other things" is quite possible, but I wouldn't advise
trying to do it in etoys. The full blown Squeak can run the gamut
from the very simple to writing its own OS, so it ranges from about 5
years old to Computer Science PhD projects. For example, it is quite
easy to implement LOGO or any other language system in Squeak -- but
there is still a fair amount of work and thought involved.
For most users, including many experts, it is the UI that determines
in their minds just what they think they can do and whether they
think they will like the experience. The UI in the full blown Squeak
is *not* set up for children, and the first thing to do here if you
wish to go your own way, is to make a suitable UI environment for
children that gives them access to your ideas in a way that works for
them. This is quite a design and testing task, but is definitely
doable. However, if this is not done, then the children wind up with
the worst of both worlds.
BTW, the best way to get children attracted to any of this stuff is
to first get them to make a project of their own -- such as the
"Drive a Car" project in etoys. There is a certain kinesthetic and
visceral satisfaction to making things on the computer, especially
things that involve programming. This is what the kids need to
experience first and foremost. Showing them what other children have
done should come later.
Best wishes,
Alan
At 10:34 AM -0600 3/23/04, Gary Frederick wrote:
>Howdy,
>
>Mitchell, David [CC] wrote:
>>
>>The Squeakland image hides the File List (or it seems that way to
>>me). So, I have to do a little trick to reveal it:
>>
>>Middle-click on the desktop to show the halos.
>>Click the menu halo (red) to show the world menu.
>>Click "desktop menu..." to show (another, different) world menu.
>>Click "open..." to show the open... menu.
>>Click "file list" to open the file list.
>>Use the tree to navigate to the directory containing the .txt file.
>>Select the file in the top-right pane.
>>In the lower pane, select the code (probably all of it).
>>Right-click and choose "do it" (or press Alt+d or Command+d or...).
>
>Thanks!
>
>>
>>All text in squeak is do-able. When I give Squeak presentations, I
>>often select my presentation text and do-it (even TrueType text,
>>which doesn't have "do it" on its menu supports alt+d). Also, you
>>can browse Smalltalk web sites in Scamper and evaluate expressions
>>right out of the browser pane.
>
>This will do it. And it's agreat suggestion I will follow up with.
>
>Now all I have to do is find out how to "do it". ;-) When I tried
>it, Squeak told me it did not understand what I wanted it to do.
>
>This is an etoy. How do I point at the car object?
>
>I had
> self forward: 100
>I did it and it did not know what self was (I think)
>
>I then tried putting in the car
> Car forward: 100
>and it did not know how to #forward
>
>How do I reference an object in an etoy?
>
>Sorry for the basic questions. I have no time to look today and want
>to show the kids tomorrow.
>
>Thanks,
>
>Gary
>
>>
>>You could also write a script to read the file and then evaluate
>>its contents.
>>
>>-----Original Message-----
>>From: squeakland-bounces at squeakland.org on behalf of Gary Frederick
>>Sent: Tue 3/23/2004 6:13 AM
>>To: squeakland at squeakland.org
>>Cc:
>>Subject: [Squeakland] getting code from a .txt file into a script
>>Howdy,
>>
>>I am about ready to show the kids Squeak tomorrow. One thing I would
>>like to know how to do is how to read a .txt file that has code into a
>>project (is that how to 'say' what I want to do?)
>>
>>I will have some examples I will want the kids to have as scripts. Say I
>>have a text file that has this in it.
>>
>>box
>> self forward: 100.
>> self turn: 90.
>> self forward: 100.
>> self turn: 90.
>> self forward: 100.
>> self turn: 90.
>> self forward: 100.
>> self turn: 90
>>
>>I want to be able to read it into a script in a project like the script
>>project in the Worlds of Squeak.
>>
>>This is a class of kids that are playing with robots. They have been
>>working with programming LEGO robots and with a simulator. I am
>>interested in taking their programs and translating them into a script
>>they can use in Squeak... if I can get the .txt files into scripts.
>>
>>I'll put some scripts into an image and let them each have a copy of the
>>image if I don't find out how to go from a .txt file to a script. That
>>solution is better than nothing and I can do it by tomorrow :-)
>>
>>Gary
>>
>>_______________________________________________
>>Squeakland mailing list
>>Squeakland at squeakland.org
>>http://squeakland.org/mailman/listinfo/squeakland
>>
>_______________________________________________
>Squeakland mailing list
>Squeakland at squeakland.org
>http://squeakland.org/mailman/listinfo/squeakland
--
More information about the Squeakland
mailing list