This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-10-14 15:46:39

dave1998
New Scratcher
Registered: 2011-04-27
Posts: 56

Lists Improvements

The main reason that I'm posting this is because I want to find the workaround but basically
think Scratch should have (in the lists section) delete -name- from -list-
currently it has delete -all/1,2,3etc/last- from -list-
big_smile

Offline

 

#2 2012-10-14 15:48:46

Molybdenum
Scratcher
Registered: 2012-06-17
Posts: 1000+

Re: Lists Improvements

Oh no. Not another workaroundable suggestion.


"The Enrichment Center is required to remind you that you will be baked, and then there will be cake."
(|Balls and Platforms: Stay on!|) (|NaOS-H: An operating system... Or is it?|)

Offline

 

#3 2012-10-14 15:51:47

dave1998
New Scratcher
Registered: 2011-04-27
Posts: 56

Re: Lists Improvements

Molybdenum wrote:

Oh no. Not another workaroundable suggestion.

Well what's the workaround THEN!!!!

Offline

 

#4 2012-10-14 15:55:16

Molybdenum
Scratcher
Registered: 2012-06-17
Posts: 1000+

Re: Lists Improvements

Step one: Stop being so mean.
Step two: Stop calling us "a completely stubborn snob".
Step three:

when gf clicked
set [temp v] to [0]
repeat until <(temp) > (length of [list v])>
   if <(item (temp) of [list v]) = [EXAMPLE]>
      delete (temp) of [list v]
   else
      change [temp v] by (1)
   end
end

Last edited by Molybdenum (2012-10-15 12:47:45)


"The Enrichment Center is required to remind you that you will be baked, and then there will be cake."
(|Balls and Platforms: Stay on!|) (|NaOS-H: An operating system... Or is it?|)

Offline

 

#5 2012-10-14 15:55:44

dave1998
New Scratcher
Registered: 2011-04-27
Posts: 56

Re: Lists Improvements

Molybdenum wrote:

Oh no. Not another workaroundable suggestion.

Well, half the time I only post a suggestion because I wanna find out the workaround  big_smile

Offline

 

#6 2012-10-14 15:57:09

Molybdenum
Scratcher
Registered: 2012-06-17
Posts: 1000+

Re: Lists Improvements

dave1998 wrote:

Molybdenum wrote:

Oh no. Not another workaroundable suggestion.

Well, half the time I only post a suggestion because I wanna find out the workaround  big_smile

Then just ask in QaS!!!!!!!!!one!!one eleven!!!一!!one!!!!十一!!!


"The Enrichment Center is required to remind you that you will be baked, and then there will be cake."
(|Balls and Platforms: Stay on!|) (|NaOS-H: An operating system... Or is it?|)

Offline

 

#7 2012-10-14 16:04:19

funelephant
Scratcher
Registered: 2010-07-02
Posts: 1000+

Re: Lists Improvements

or you can click the item and delete it yourself.


nicki begs to differ
http://24.media.tumblr.com/ab0e6e8fd347c5e39c2821bcab9d16e6/tumblr_mgu35sui1L1rfb7aqo2_500.gif

Offline

 

#8 2012-10-14 17:41:20

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Lists Improvements

dave1998 wrote:

Molybdenum wrote:

Oh no. Not another workaroundable suggestion.

Well, half the time I only post a suggestion because I wanna find out the workaround  big_smile

That's exactly not the point of the "Suggestions" forum - post in Help With Scripts.

Molybdenum posted the solution, use that if you ever need to do this.


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#9 2012-10-14 17:59:43

777w
Scratcher
Registered: 2009-02-10
Posts: 1000+

Re: Lists Improvements

funelephant wrote:

or you can click the item and delete it yourself.

if you need it to be part of the script that wont work
the problem with your workaround molybdenum is that the "repeat" block has enough delay to be noticeable

Last edited by 777w (2012-10-14 18:00:35)

Offline

 

#10 2012-10-14 18:43:46

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Lists Improvements

777w wrote:

funelephant wrote:

or you can click the item and delete it yourself.

if you need it to be part of the script that wont work
the problem with your workaround molybdenum is that the "repeat" block has enough delay to be noticeable

A solution to that would be:

set [variable v] to [whatever item you want deleted]
delete (variable) of [list v]
Just use this whenever you need to delete a specific item from a list.


http://i46.tinypic.com/35ismmc.png

Offline

 

#11 2012-10-14 18:46:36

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Lists Improvements

777w wrote:

funelephant wrote:

or you can click the item and delete it yourself.

if you need it to be part of the script that wont work
the problem with your workaround molybdenum is that the "repeat" block has enough delay to be noticeable

actually the new flash player seems to handle repeat loops that only contain math/lists/variables in extremely high speed. i have evidence here, you will see it is substantially faster in the online flash than downloaded


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#12 2012-10-14 18:47:44

Molybdenum
Scratcher
Registered: 2012-06-17
Posts: 1000+

Re: Lists Improvements

Wes64 wrote:

777w wrote:

funelephant wrote:

or you can click the item and delete it yourself.

if you need it to be part of the script that wont work
the problem with your workaround molybdenum is that the "repeat" block has enough delay to be noticeable

actually the new flash player seems to handle repeat loops that only contain math/lists/variables in extremely high speed. i have evidence here, you will see it is substantially faster in the online flash than downloaded

Yes. I can perform 131072 calculations in under 1 second, and calculate 100! almost instantly.


"The Enrichment Center is required to remind you that you will be baked, and then there will be cake."
(|Balls and Platforms: Stay on!|) (|NaOS-H: An operating system... Or is it?|)

Offline

 

#13 2012-10-14 18:51:29

777w
Scratcher
Registered: 2009-02-10
Posts: 1000+

Re: Lists Improvements

Wes64 wrote:

777w wrote:

funelephant wrote:

or you can click the item and delete it yourself.

if you need it to be part of the script that wont work
the problem with your workaround molybdenum is that the "repeat" block has enough delay to be noticeable

actually the new flash player seems to handle repeat loops that only contain math/lists/variables in extremely high speed. i have evidence here, you will see it is substantially faster in the online flash than downloaded

oh ok :o
the new flash player is almost exactly the same as the 2.0 alpha player so this is good

Offline

 

#14 2012-10-14 18:57:58

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Lists Improvements

ErnieParke wrote:

777w wrote:

funelephant wrote:

or you can click the item and delete it yourself.

if you need it to be part of the script that wont work
the problem with your workaround molybdenum is that the "repeat" block has enough delay to be noticeable

A solution to that would be:

set [variable v] to [whatever item you want deleted]
delete (variable) of [list v]
Just use this whenever you need to delete a specific item from a list.

since when did that work‽‽‽

How come no one ever told me about these kinds of shortcuts‽‽‽

Offline

 

#15 2012-10-14 19:01:42

777w
Scratcher
Registered: 2009-02-10
Posts: 1000+

Re: Lists Improvements

kayybee wrote:

ErnieParke wrote:

777w wrote:


if you need it to be part of the script that wont work
the problem with your workaround molybdenum is that the "repeat" block has enough delay to be noticeable

A solution to that would be:

set [variable v] to [whatever item you want deleted]
delete (variable) of [list v]
Just use this whenever you need to delete a specific item from a list.

since when did that work‽‽‽

How come no one ever told me about these kinds of shortcuts‽‽‽

it doesnt work, i tried it and the outline of the list just flashed red
it only works when deleting numbered items

Offline

 

#16 2012-10-14 19:03:49

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Lists Improvements

777w wrote:

kayybee wrote:

ErnieParke wrote:


A solution to that would be:

set [variable v] to [whatever item you want deleted]
delete (variable) of [list v]
Just use this whenever you need to delete a specific item from a list.

since when did that work‽‽‽

How come no one ever told me about these kinds of shortcuts‽‽‽

it doesnt work, i tried it and the outline of the list just flashed red
it only works when deleting numbered items

i concur

which then renders it silly because you could just cut out the middleman and do

delete (whichever item you want deleted v) of [list v]


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#17 2012-10-14 21:05:47

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Lists Improvements

777w wrote:

kayybee wrote:

ErnieParke wrote:


A solution to that would be:

set [variable v] to [whatever item you want deleted]
delete (variable) of [list v]
Just use this whenever you need to delete a specific item from a list.

since when did that work‽‽‽

How come no one ever told me about these kinds of shortcuts‽‽‽

it doesnt work, i tried it and the outline of the list just flashed red
it only works when deleting numbered items

What, I made a mistake. Here's what I meant:

set [variable v] to [whatever item # of the list you want deleted]
delete (variable) of [list v]


http://i46.tinypic.com/35ismmc.png

Offline

 

#18 2012-10-14 21:09:07

777w
Scratcher
Registered: 2009-02-10
Posts: 1000+

Re: Lists Improvements

ErnieParke wrote:

777w wrote:

kayybee wrote:


since when did that work‽‽‽

How come no one ever told me about these kinds of shortcuts‽‽‽

it doesnt work, i tried it and the outline of the list just flashed red
it only works when deleting numbered items

What, I made a mistake. Here's what I meant:

set [variable v] to [whatever item # of the list you want deleted]
delete (variable) of [list v]

the only problem with that is that you dont always know the place of the item in the list

Offline

 

#19 2012-10-14 21:43:11

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Lists Improvements

777w wrote:

ErnieParke wrote:

777w wrote:


it doesnt work, i tried it and the outline of the list just flashed red
it only works when deleting numbered items

What, I made a mistake. Here's what I meant:

set [variable v] to [whatever item # of the list you want deleted]
delete (variable) of [list v]

the only problem with that is that you dont always know the place of the item in the list

Oh wait, when I read dave1998's topic, I thought that was what (s)he was suggesting. Now I see where I went wrong. My mistake.  tongue


http://i46.tinypic.com/35ismmc.png

Offline

 

#20 2012-10-14 22:36:12

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Lists Improvements

Even if you do consider it a "workaround," deleting a specific item from a list, in any programming language, requires iterating through the list (unless you're dealing with some more complex data structure like a hash table, dictionary, or map).  Even Scratch's built-in "list contains [thing]" involves running through the list until the desired item is found.  It just happens quickly because native Squeak code (or Flash, depending on what player you're using) runs faster than interpreted Scratch scripts.

Last edited by amcerbu (2012-10-14 22:37:13)

Offline

 

#21 2012-10-15 00:00:31

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Lists Improvements

777w wrote:

kayybee wrote:

ErnieParke wrote:


A solution to that would be:

set [variable v] to [whatever item you want deleted]
delete (variable) of [list v]
Just use this whenever you need to delete a specific item from a list.

since when did that work‽‽‽

How come no one ever told me about these kinds of shortcuts‽‽‽

it doesnt work, i tried it and the outline of the list just flashed red
it only works when deleting numbered items

Ah, ok good. I didn't waste my time making extra-long-cuts.

Offline

 

#22 2012-10-15 14:50:06

Prestige
Scratcher
Registered: 2008-12-15
Posts: 100+

Re: Lists Improvements

Yeah, unless you know the location of the item within the list then to actually locate it requires a script which systematically counts through the list until it reaches the item. This can be sped up if you know a 'rough' location of the item:

For example, if the item is added late in a game then you can track through the list from the last item to the first (backwards) to locate the item faster (because it'll be more likely for the item to be in the second half of the list).


"Don't insult someone until you've walked a mile in their shoes. That way, if they don't like what you have to say, you'll be a mile away and still have their shoes  smile  "

Offline

 

#23 2012-10-15 14:54:28

dave1998
New Scratcher
Registered: 2011-04-27
Posts: 56

Re: Lists Improvements

ErnieParke wrote:

777w wrote:

ErnieParke wrote:


What, I made a mistake. Here's what I meant:

set [variable v] to [whatever item # of the list you want deleted]
delete (variable) of [list v]

the only problem with that is that you dont always know the place of the item in the list

Oh wait, when I read dave1998's topic, I thought that was what (s)he was suggesting. Now I see where I went wrong. My mistake.  tongue

(s)he?
Dave is generally a boys name ernie....

Offline

 

Board footer