I have a list full of numbers, and I want to know if a number is repeated within that same list.
How would I do that?
ID:159939
Dec 15 2008, 4:29 pm
|
|
Dec 15 2008, 4:36 pm (Edited on Dec 16 2008, 11:19 am)
|
|
Another method:
proc/CountNumber(list/L, number) Lummox JR |
In response to Popisfizzy
|
|
Yours runtimes something shocking there Fizzy-boy.
#define DEBUG The provided runtime is: runtime error: list index out of bounds proc name: repeated elements (/proc/repeated_elements) source file: Fixing this guys stuff up.dm,7 usr: Tiberath (/mob) src: null call stack: repeated elements(/list (/list)) Tiberath (/mob): test() Line 7 being: if(l.Find(l[a]) < a) |
In response to Tiberath
|
|
The profanity is quite shocking Tibby-boy.
|
In response to Popisfizzy
|
|
Popisfizzy wrote:
proc/repeated_elements(list/l) Uhm, does that work? I was under the impression that you could not compare a variable holding a floating point number to a variable holding the reference to a list? Or in other words, shouldn't you use l.len here instead? [Edit: Gah, two new replies while I was reading and replying to the posting] |
In response to Tiberath
|
|
Yar, oversight I just noticed. It should be l.len, not l. I've fixed it.
|