Get Started
·
Register
·
Login
Enjoy BYOND? Contribute today!
Posts
ID:173336
Favorites
Creations
Picking the Wound...
in
Developer Help
[Tips]
ID:173336
Jan 16 2004, 2:46 pm
Thorg
How can I go about picking a random value from a list, I stupidly thought I could load it into a var by using:
var/K = pick(in Roster)
But that doesn't seem to be the case, any help would be jumped upon.
Thanks in advance.
-Thorg
#1
Jan 16 2004, 2:48 pm
Jon88
You can do either
var/list/predefinedlist = list("A","B")
var/K = pick(predefinedlist)
or
var/K = pick(list("A","B"))
#2
Jan 16 2004, 3:21 pm
In response to
Jon88
(#1)
Thorg
Thanks, much obliged.
-Thorg
#3
Jan 16 2004, 3:23 pm
In response to
Thorg
(#2)
Garthor
You could have just looked up pick() in the reference without posting. In fact, I suggest you do. There's more stuff there.
Copyright © 2013 BYOND. All rights reserved.
var/list/predefinedlist = list("A","B")
var/K = pick(predefinedlist)
or
var/K = pick(list("A","B"))