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-
Offline
Oh no. Not another workaroundable suggestion.
Offline
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)
Offline
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
Then just ask in QaS!!!!!!!!!one!!one eleven!!!一!!one!!!!十一!!!
Offline
or you can click the item and delete it yourself.
Offline
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
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.
Offline
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
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.
Offline
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
Offline
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 noticeableactually 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.
Offline
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 noticeableactually 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
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 noticeableA 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
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 noticeableA 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
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]
Offline
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]
Offline
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 itemsWhat, 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
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 itemsWhat, 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.
Offline
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
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
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).
Offline
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.
(s)he?
Dave is generally a boys name ernie....
Offline