ID:176446
 
I was wondering if it was possible to store lists inside of lists.

Here goes:

Say I have four lists. FF7, FF8, FF9 and FF10.

Then I wanted to store them into a new list, called FF.

So, when it comes to a client using his/her verb, they get to choose one of the four options (FF7, FF8, FF9 and FF10) in the list, FF.

Simple reason I want to know this is because I feel as though it would be easier to get around things this way.

So, if more information is needed or if it is possible, would you kindly take the time to assist me?

--Lee
I believe that if it is, you would store them as any regular variable inside the list.

Something like this
mob
var/list
FF9
FF8
FF7
FF

New()
..()
FF9=list()
FF8=list()
FF7=list()
FF=list(FF9,FF8,FF7)

But it would have to be tested.

To access them I am guessing you would do something like this.
for(var/list/A in FF)   break
for(var/B in A)
B.Add(mob/zidane)



/*Something like this, I really have no clue what you are trying to achieve aside from this but if you could, would you test this for me and give me some feedback?*/

I am very sorry to leave you with this, I will provide more detail later but I must run, I have school but you know how to further contact me.

Lance
...Guardian of Dragons...
In response to Dragon Guardian
Got it cracked, although you know it wasn't that way once I showed you exactly what I mean't :P

They finishing output comes as follows;

var/list/FF7 = list("Aeris' Theme.mid","Barrets Theme.mid","Cait Siths Theme.mid","Cids Theme.mid","Costa del Sol.mid","RedXIII' Theme.mid","Tifas Theme.mid","Weapon Raid.mid","World Map Theme.mid")
var/list/FF8 = list("Balamb Garden.mid","Dont Be Afraid.mid","Galbadia Garden.mid","Retaliation.mid","SeeD.mid","The Landing.mid","The Man With A Machine Gun.mid")
var/list/FF9 = list("Battle Theme.mid","Cids Theme.mid","Eikos Theme.mid","Freya' Theme.mid","Kuja' Theme.mid","Lifa Tree.mid","Quina' Theme.mid","Zidane' Theme.mid")
var/list/FF10 = list("At Zanarkand.mid","Battle Theme.mid","Blitz Off.mid","Ending Theme.mid","Other World.mid","Rikkus Theme.mid","Seymours Theme.mid","Tidus Theme.mid","Yunas Theme.mid")
var/list/FF = list("FF7","FF8","FF9","FF10")

mob/verb/MusicBox()
var/choose = input("Which Final Fantasy series would you like to listen music from?") in FF
switch(choose)
if("FF7")
var/a = input("Which song would you like to play?") in FF7
usr << sound(a,0)

if("FF8")
var/b = input("Which song would you like to play?") in FF8
usr << sound(b,0)

if("FF9")
var/c = input("Which song would you like to play?") in FF9
usr << sound(c,0)

if("FF10")
var/d = input("Which song would you like to play?") in FF10
usr << sound(d,0)


Thanks for the help anyway, Lance :)

--Lee

[Edit] One problem though, it compiles great. Though when choosing the song you wish to hear... You find nothing outputted.

All help is needed here and all help will be gracefully accepted :)
In response to Mellifluous
The switch seems to set up a bunch of redundant code that could just as easily be handled with an associative list.
var/list/FF=list("FF7"=list( ... ),\
list("FF8"=list( ... ),\
...
)

Lummox JR
In response to Lummox JR
Lummox JR wrote:
The switch seems to set up a bunch of redundant code that could just as easily be handled with an associative list.
var/list/FF=list("FF7"=list( ... ),\
> list("FF8"=list( ... ),\
> ...
> )

Lummox JR

Thanks Lummox, I will get on this now, although, I am not very good with lists so I tend to get them wrong often.

As you may or may not already know, lists are one of the many weaknesses I have with DM.

--Lee
In response to Mellifluous
Lists really are my weakness, never even attempted one...