ID:151841
 
So wait... on an associative list could I do something like this...
mob/var
list/A_List = list("One" = /obj/Bob)


...or can it only be done with numbers?
For general info about associative lists, I refer you to this post: [link].
The key (item/element in the list) and its associated value can generally be any type of value (text strings, numbers, type path, object reference...), however the exception is that the key can't be a number. This is because using a numeric index to access an item in the list already has a different purpose (it returns the element in that position, so L[3] returns the 3rd item in L). The associated value can be a number however, and the key could be a text string containing a number.
You could completely cut out the associative part and just use an index if you're using increments of 1.

var/list/L = list(/obj/Bob,/obj/Joe,/obj/Harry)

mob/verb/Check()
world << L[rand(1,3)] //it will return one of the three entries


Note that this will not work, however:

var/list/L = list(1 = /obj/Bob, 3 = /obj/Joe) //you cannot directly associate anything to a number

mob/verb/Change()
list[3] = /obj/Harry //you cannot do this, either, as it is expecting a third
//item in the list to return.