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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Markus Gälli-3
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 <[hidden email]> wrote:

Anyone tried the Etoys-Version? Someone told me that it was not
working for him, but I did not investigate...


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



_______________________________________________
Squeakland mailing list
[hidden email]
http://squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

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

dcorking
On 7/13/06, Markus Gaelli <[hidden email]> wrote:

> 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.

A very useful lesson - thank you Markus.  This is looks quite
different from the class methods of some other object systems.

> 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.

I should have put a break point in there as well - I put Squeak in an
infinite loop all over again.  Anyway - I see your trick now!

> 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... :-/

Without labouring a point that has been discussed many times, this
kind of defeats the concepts of persistence of objects in the Squeak
image and independence from the host operating system. - if a child
had lots of artwork in their project, they would have to save an image
or a project file regularly, so they could backtrack in case I come
along and break the project.    Which is best - project file or
changeset or image file?

>  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?

You are right - there is a lot more in here than in the 'Drive a Car'
toy.  And, you hid the Navigator and Supplies flaps to further confuse
a beginner :)

But, it would be a good way to learn about ideas like sorting, arrays,
and, if I understand it correctly, an event driven approach to
applying the same action to multiple objects  (this is very
fashionable in the current world of Service Oriented Architecture and
'middleware' ... but it probably has general application to
computation, problem-solving and domain modelling for children.)
_______________________________________________
Squeakland mailing list
[hidden email]
http://squeakland.org/mailman/listinfo/squeakland