[Squeakland] Re: Squeakland Digest, Vol 11, Issue 17

Thomas Oeding Thomas.Oeding at gmx.de
Wed Mar 24 19:28:45 PST 2004


Forward for Steve Gutierrez <sjg9360 at lausd.k12.ca.us>:

I've been following this discussion with interest.  I'm very interested 
in getting sketch morphs to follow sequential commands a la the Lego 
Brick rather than running Forward 5 and Turn 5 simultaneously, so an 
object could complete a series of steps and then based on the results 
fire off a new script. Would this be done with text scripting?

On Mar 23, 2004, at 12:00 PM, squeakland-request at squeakland.org wrote:

> Send Squeakland mailing list submissions to
> 	squeakland at squeakland.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://squeakland.org/mailman/listinfo/squeakland
> or, via email, send a message with subject or body 'help' to
> 	squeakland-request at squeakland.org
>
> You can reach the person managing the list at
> 	squeakland-owner at squeakland.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Squeakland digest..."
>
>
> Today's Topics:
>
>    1. Re: getting code from a .txt file into a script (Ned Konz)
>    2. Re: getting code from a .txt file into a script (Alan Kay)
>    3. Re: getting code from a .txt file into a script (Alan Kay)
>    4. 	Question: delays, collections, object instance variables
>       (Thomas Oeding)
>    5. Re: getting code from a .txt file into a script (Bert 
> Freudenberg)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 23 Mar 2004 08:53:31 -0800
> From: Ned Konz <ned at squeakland.org>
> Subject: Re: [Squeakland] getting code from a .txt file into a script
> To: squeakland at squeakland.org
> Message-ID: <200403230853.31484.ned at squeakland.org>
> Content-Type: text/plain;  charset="iso-8859-1"
>
> On Tuesday 23 March 2004 8:34 am, 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?
>
> Real easy:
>
> if you have the debugHaloHandle preference turned on, you can bring up 
> an etoy
> object's halos, click on the light grey debug handle, and then choose
> "inspect player".
>
> The bottom pane of this inspector will interpret 'self' as the etoy 
> object
> (the player).
>
> Or you can open an empty script, turn on the text mode check box, and 
> then
> enter script text in there and then hit the '!' button to try it.
>
>
> -- 
> Ned Konz
> http://bike-nomad.com/squeak/
>
> ------------------------------
>
> Message: 2
> Date: Tue, 23 Mar 2004 09:12:56 -0800
> From: Alan Kay <Alan.Kay at squeakland.org>
> Subject: Re: [Squeakland] getting code from a .txt file into a script
> To: Gary Frederick <gary.frederick at jsoft.com>,
> 	squeakland at squeakland.org
> Message-ID: <a05100304bc861b83a06e@[192.168.0.3]>
> Content-Type: text/plain; charset="us-ascii" ; format="flowed"
>
> 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
>
>
> -- 
>
> ------------------------------
>
> Message: 3
> Date: Tue, 23 Mar 2004 09:14:00 -0800
> From: Alan Kay <Alan.Kay at squeakland.org>
> Subject: Re: [Squeakland] getting code from a .txt file into a script
> To: Ned Konz <ned at squeakland.org>, squeakland at squeakland.org
> Message-ID: <a05100305bc8620c4dc8f@[192.168.0.3]>
> Content-Type: text/plain; charset="us-ascii" ; format="flowed"
>
> But what does this have to do with children and the UI they need?
>
> Cheers,
>
> Alan
>
> ------
>
> At 8:50 AM -0800 3/23/04, Ned Konz wrote:
>> On Tuesday 23 March 2004 4:13 am, Gary Frederick wrote:
>>>  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.
>>
>> Are you using the eToy environment? I assume that's what you want.
>>
>> You can use text scripting instead of tiles. The check box at the 
>> left top of
>> the editor changes between the two modes.
>>
>> However, if you edit the text in text mode you can't see it or edit 
>> it in
>> (classic) tiles any more.
>>
>> Here's a quick way to see the text format:
>>
>> * turn on the "debugHaloHandle" preference
>> * go to the "drive a car" project in the Worlds of Squeak.
>> * bring up the halos on the car.
>> * click on the grey (debug) halo.
>> * click on "browse player class".
>>
>> You will see a browser with the Player157 class in it.
>> Get the context menu on the name of the class (Player157) and choose
>> "fileOut".
>>
>> Now you will have a Player157.st file on disk.
>>
>> Here's what it looks like (NOTE that you MUST use bare CR characters 
>> (Mac text
>> format) if you are editing or building such scripts, though CR/LF may 
>> also
>> work in a pinch):
>>
>> --------------- 8< --------------
>> 'From Squeak3.7alpha of 11 September 2003 [latest update: #5816] on 
>> 23 March
>> 2004 at 7:44:49 am'!
>> Player subclass: #Player157
>> 	instanceVariableNames: 'isTrue'
>> 	classVariableNames: ''
>> 	poolDictionaries: ''
>> 	category: 'Morphic-UserObjects'!
>>
>> !Player157 methodsFor: 'access'!
>> getIsTrue
>> 	^ isTrue! !
>>
>> !Player157 methodsFor: 'access'!
>> setIsTrue: t1
>> 	isTrue := t1! !
>>
>>
>> !Player157 methodsFor: 'scripts'!
>> drive
>> 	self forward: 7.
>> 	self turn: Wheel getHeading // 5! !
>>
>> "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
>>
>> Player157 class
>> 	instanceVariableNames: 'cardPlayer111 unscriptedPlayer1
>> unscriptedPlayer2'!
>>
>> !Player157 class methodsFor: 'reference'!
>> refCardPlayer111
>> 	^ cardPlayer111! !
>>
>> !Player157 class methodsFor: 'reference'!
>> refUnscriptedPlayer1
>> 	^ unscriptedPlayer1! !
>>
>> !Player157 class methodsFor: 'reference'!
>> refUnscriptedPlayer2
>> 	^ unscriptedPlayer2! !
>> --------------- 8< --------------
>>
>>
>> So if you could translate your text files into this format you may be 
>> able to
>> use them directly (depending on the vocabulary).
>>
>> What's the format of your text files? Can you send me one?
>>
>> You could do this:
>>
>> * make a blank project with a Sketch in it that represents the robot.
>>
>> * Make a new script in that Sketch that will prompt for a file and 
>> read your
>> text format into methods (it would be best, probably, to put the 
>> reader
>> method in another class (perhaps Player) so that you can make 
>> multiple Sketch
>> classes that can read such files).
>>
>> Let's say that your scripts have the method names in column 1.
>>
>> The enclosed change set (which you would file into your new project) 
>> will let
>> you make a script that will read such files.
>>
>>>  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 :-)
>>
>> You should distribute projects instead of images.
>>
>> --
>> Ned Konz
>> http://bike-nomad.com/squeak/
>>
>>
>> Attachment converted: Macintosh HD:ScriptEditorText.png (PNGf/ogle) 
>> (000CAB12)
>> Attachment converted: Macintosh HD:ScriptEditor.png (PNGf/ogle) 
>> (000CAB13)
>> Attachment converted: Macintosh HD:ReadTextFilesIntoPlayer-nk.1.cs
>> (TEXT/ttxt) (000CAB14)
>> Attachment converted: Macintosh HD:getMethodsScriptor.png
>> (PNGf/ogle) (000CAB15)
>> _______________________________________________
>> Squeakland mailing list
>> Squeakland at squeakland.org
>> http://squeakland.org/mailman/listinfo/squeakland
>
>
> -- 
>
> ------------------------------
>
> Message: 4
> Date: Tue, 23 Mar 2004 19:28:48 +0100
> From: Thomas Oeding <Thomas.Oeding at gmx.de>
> Subject: [Squeakland] 	Question: delays, collections, object instance
> 	variables
> To: squeakland at squeakland.org
> Message-ID: <13542007203.20040323192848 at impara.de>
> Content-Type: text/plain; charset=us-ascii
>
> forward for Poster at Kinetium dot Com <poster at kinetium.com>:
>
> Hi.
>
> Five questions from a newby.
>
> 1. It appears that tiles placed in a script are executed as sequential
> Smalltalk statements. Is this correct?
>
> 2. Some tiles (e.g. make sound) appear to involve asynchronous calls to
> outside services, returning before completion of that service. For 
> example,
> if I put 2 make sounds in sequence, they get garbled together. Is my
> understanding correct, and is there a way to synchronize on the 
> completion
> of the sound or to insert something like a delay between the calls so 
> they
> are heard as two sequential sounds?
>
> 3. Is it possible to use collections? e.g. can I make a collection of
> ladybugs and then use collection methods? I don't mind using text 
> instead of
> tiles.
>
> 4. If I paint two eToys objects (sorry, don't know the right term), 
> how can
> I set an instance variable of one to point at the oher?
>
>
> 5. Lastly, I noticed that if I view the text version of a script and 
> edit
> it, then switch back to the tile view, I lose the edits I made. Is 
> there a
> gradual way to transition from the tiles, drag-n-drop programming 
> version to
> full(er) Smalltalk or is it an all-or-nothing abrupt jump?
>
> Thanks!! (and an email reply would be greatly appreciated).
>
> Newbie
>
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 23 Mar 2004 19:58:20 +0100
> From: Bert Freudenberg <bert at impara.de>
> Subject: Re: [Squeakland] getting code from a .txt file into a script
> To: squeakland at squeakland.org
> Message-ID: <0D55A8AA-7CFC-11D8-A4DB-000A9568394E at impara.de>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> Am 23.03.2004 um 16:36 schrieb Markus Gaelli:
>>
>> Am Dienstag, 23.03.04 um 16:25 Uhr schrieb Mitchell, David [CC]:
>>
>>> 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.
>>>
>> Some weeks ago I found out that you could also press the escape key to
>> open the world menu.
>
> Actually, dragging-and-dropping files onto the Squeak window works on
> most machines ...
>
> - Bert -
>
>
> ------------------------------
>
> _______________________________________________
> Squeakland mailing list
> Squeakland at squeakland.org
> http://squeakland.org/mailman/listinfo/squeakland
>
>
> End of Squeakland Digest, Vol 11, Issue 17
> ******************************************




More information about the Squeakland mailing list