How do you make a list like:
List Contents
Name Amount
Candy 8
Ice Cream 10
Meat 1
ID:169588
May 29 2005, 12:31 pm
|
|
May 29 2005, 1:18 pm
|
|
I would help you but I dont understand what your asking ..
|
In response to Tsonic112
|
|
How would you make a list that stores a name of an item and how much you have of that item.
|
In response to BakaSan
|
|
Use BuzzyBoys item stacking demo.
|
You'd need an associative list.
mob |
In response to Nadrew
|
|
Thanks Nadrew.
How would you check if two lists are equal? Ex. var/list/A = list("Moo","Ice") This is what I tried but it keeps telling me it's unequal. |
In response to BakaSan
|
|
How would you compare if two lists are the same?For example, if you have one list that is equal to the exact way to make cheese, and another list equal to how the user made his cheese, how would you check to see if he made his cheese correctly?
|
In response to BakaSan
|
|
As ineffiecient as this looks..
proc/compare(list/listA,list/listB) Critique this please I'd like to get more aquainted with lists. -Intel |
In response to Artificial Intel
|
|
Your way actually wouldn't work because it compares every single element in the first list to every single element in the second. In other words, your proc only returns TRUE if list_one[1] is equal to list_two[1], list_two[2], and etcetera, all the way up to list_two[list_two.len].
I would do something like this: //returns 1 if both arguments are equal [edit] That proc only compares two lists. If you want to compare more, then you would do this: //takes an infinite number of arguments Of course, the above proc only returns 1 if the lists being compared are in the same order. If this is not the desired behavior, then just tell me! =) |
In response to Wizkidd0123
|
|
When I define a list with the user's mob...
mob like this, when I try to add something to the list... mob like this, I get an error... runtime error: Cannot execute null.Add(). proc name: noname (/mob/kweh/verb/noname) usr: Sandaime (/mob/player) src: Sandaime (/mob/player) call stack: Sandaime (/mob/player): noname() Can anyone please help? ~~The code has been edited to protect the inoccent~~ |
In response to BakaSan
|
|
1) Use the . operator instead of the : operator
2) mob/var/list/sl=list(), you forgot the =list() part! |