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

#1 2012-12-11 23:14:16

MichaelKenyon
New Scratcher
Registered: 2012-10-18
Posts: 2

BYOB Lists of Lists

I dont know if anybody uses BYOB here but I need help! I made a simple list within a list of numbers 1,2 in first part of the list and 3,4 in second part of list. I want to be able to delete a single number within this list of list. HELP! Thanks so much

Offline

 

#2 2012-12-12 02:42:56

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB Lists of Lists

Which version of BYOB are you using?


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#3 2012-12-12 10:09:41

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: BYOB Lists of Lists

try:

delete (item (i) of [list2 v]) of [list1 v]

Last edited by GeonoTRON2000 (2012-12-12 10:10:23)


http://i.imgur.com/BAEgGDL.png

Offline

 

#4 2012-12-13 10:27:20

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: BYOB Lists of Lists

no,

delete (i) of (item (j) of (main list))
where i and j are indices you want to delete the element at.


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#5 2012-12-13 16:13:37

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB Lists of Lists

GeonoTRON2000 wrote:

try:

delete (item (i) of [list2 v]) of [list1 v]

That deletes the (the ith element of list2)th element of list1, not the ith element of (the jth element of list1)

Last edited by nXIII (2012-12-13 16:14:03)


nXIII

Offline

 

#6 2012-12-15 06:11:37

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: BYOB Lists of Lists

joefarebrother wrote:

no,

delete (i) of (item (j) of (main list))
where i and j are indices you want to delete the element at.

This would work the best, as if you had a list that had two lists in it, both of those lists had two items in (lets use 1 and 2 as the items, for instance)

To delete item one of list one in list, you would use:

delete (1) of (item (1) of [list name v])
To delete item two of list one in list, you would change the FIRST number to a 2.
Then to delete item one of list two in the list, you need to change it so it's like this:
delete (1) of (item (2) of [list name v])
Pretty simple, isn't it?
Just make sure you don't add the list to the list! It would make a paradox, probbably  tongue


I'm back.
Maybe.

Offline

 

Board footer