Reverse Game in Etoys (was: Re: [Newbies] Reverse Game in seven lines)

Markus Gaelli gaelli at emergent.de
Thu Jul 13 13:24:07 UTC 2006


Hi David,

On Jul 13, 2006, at 11:28 AM, David Corking wrote:

> (cross-post from beginners list)

I cc it to squeakland, as this is the preferred list to discuss Etoy- 
related questions.

>
> On 7/11/06, Markus Gaelli <gaelli at emergent.de> wrote:
>>
>> Anyone tried the Etoys-Version? Someone told me that it was not
>> working for him, but I did not investigate...
>>
> http://www.squeakland.org/project.jsp?http://www.emergent.de/pub/ 
> smalltalk/squeak/projects/reverse.pr
>
> Yes - it is fun and has a lovely interface.  (I am using Linux and
> Firefox - and I have a squeakland-3.8-1.noarch.rpm from
> www.squeakland.org)  It is a great demo of the power of tiles and
> Etoys.
>

Thank you for trying. Glad that it works and that you like it.  :-)

> I am brand new to smalltalk and Etoys, and to 'everything is an
> object'.  So, I tried to teach myself something from Markus work.  My
> learning anecdote is included as a p.s.
>
> My tentative conclusion - it feels like I have a long learning curve
> ahead of me - a curve of building, breaking and repairing many Etoys,
> and learning the underlying development tools, before I could
> confidently assist a 12 year old who wants to make his imagination
> come to life on his computer screen.  I intend to embark on that
> learning curve.  I hope to be surprised later when my nephew takes the
> odd 'message not understood' dialog in his stride, deletes (or loses)
> some of his work, and starts again in the excitement of authoring his
> own multimedia product.   Do my thoughts resonate with those of you
> more experienced, or is it easier than it looks to introduce tile
> scripting to kids?
>
> BTW - thanks Markus and best regards, David
>
> p.s. my anecdote :
> to teach myself a  little from Markus's Reverse Game, I click around a
> bit to try to work out

You stumbled exactly over the two main "tricks" here:

> 1. why/how do all the buttons run the same
> scripts?

Etoys is a nice implementation of prototype systems as it stems back  
from "self".
That means, that you can create shallow copies of any morph using  
"siblings...".
So I created one cell, and then via red menu halo "Siblings..." ->  
"Create multiple Siblings..." I created another 8 siblings of this one.

A script done for one morph then also applies to all its siblings. If  
you change that script, all siblings change their behavior also, as  
they share the very same script.

> 2. where is the HelperStack?

This is the one behind the ReverseStack. (The one where you can only  
see the orange outline, I should have denoted it...)

In Etoys you can only program visual objects.
Thus I used that HelperStack to put in the cell at the cursor of the  
ReverseStack (which always denotes the first cell) until the clicked  
cell is at the first position.
As the cells are always included at the last position of the  
HelperStack (using the default include: method) and afterwards  
included at the first position of the ReverseStack
(using the includeAtCursor: method) the cells get reversed.

But I agree, as long as Etoys do not provide a visual debugger, where  
one could watch each step animated, it is hard to understand what is  
going on.
For a start you could drag (thus disable) the
"HelperStack tellAllContents: includeInReverseField"-tile out of its  
script to actually see the cells in the ReverseStack after pressing  
some cell.

>
> In overenthusiastic clicking, I delete a ScriptStatusControl and break
> the toy :( ('Message not understood' dialog whenever I click on a
> number cell.)  I decide this is another learning opportunity.  A
> couple of minutes clicking around and I haven't found out how to give
> the broken script a new status control.  I googled aound a bit for
> docs, but I know too little about Squeak to know what to ask Google.
> Next I try to make a new tile script from scratch (monkey see - monkey
> do)
>
> Oops! I accidentally click on a 'send message' (! bang) button, and
> Squeak goes into a busy loop.  The screen is not updating at all, and
> my processsor is at 100% for 3 or 4 minutes.  Finally, my processor
> load goes back to normal, but still nothing is happening in the Squeak
> window.

If you are not in the browser Ctrl-. could work to interrupt a  
process - otherwise it might be the best to just restart and  
reload... :-/

> I still don't know the answers to my first two questions.  I
> have more sympathy with Chris Cunnington.


This project is intended to show (off ;-) what could be done with  
Etoys and really pushing its limits.
I guess it is less suited as a general intro, but - who knows?

Cheers,

Markus


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20060713/360bbf61/attachment.htm


More information about the Beginners mailing list