[squeakland] Etoys - arrays/lists?

Yoshiki Ohshima yoshiki at vpri.org
Wed Oct 12 00:08:53 EDT 2011

At Tue, 11 Oct 2011 21:46:15 -0400,
R.D. Latimer wrote:
> Is there a way to create an array or list of numbers - many numbers, like 100 or 1000 or more?
> From the Illinois website it looks as though a Holder is the only way to do this, copy in a Text object for each array/list element.
> This method doesn't seem to be the way to store large numbers of values into an array or list.

  "Doesn't seem to be"...  But can you elaborate a little bit more?
It may be actually feasible with Text object.  But, yes, such kind of
large collection is not a common Etoys feature.

  You could always resort to the textual coding and use full
Collection library.  But...

> This may mean also that there are no list accessing means, like to check if a particular value is in a list.
> Thanks for any help,

  There is another tricky way to do it with Particles.

I made a project to demonstrate it:


There are 10,000 random number between 0 and 999999, created by the
"setup" script.  Then type in a number you would like to query in the
"query" watcher and press "turtle2 try".  If the "query" number is
among these 10,000 numbers, "result" will be true.  Otherwise, it'll
be false.

-- Yoshiki

More information about the squeakland mailing list