What is your favriote proc.
Mine is for()
I like it becuase you can use it for multipule things.
ID:274641
![]() Jun 6 2002, 7:02 pm
|
|
![]() Jun 6 2002, 7:05 pm
|
|
flick() ;)
|
Thats true I do use input() quite often. And just a thought what is the difference between switch(input("Blah")in list("HI","Hello")) and input("Blah")in list("HI","Hello")?
|
Example:
switch(input("What do you want?")in list("Nothing","Poo")) var/choice = input("What do you want?")in list("Nothing","Poo") Get it? |
switch() allows you to save space by allowing like a..... ermm.... variable checking feature, so you can check to see if it equals different things
switch(input("What is your favorite music type?","Music","Pop") in list("Pop","Rock","Country") if("Pop") usr << "Who's yo' daddy!?" if("Rock") usr << "............" if("Country") usr << "You suck! (deeply rooted hatred for country)" |
Hahahaha. Nice, nice. If I had to pick a second favorite proc, I would definitely consider either del() or for(). I am starting to use for() for (heh) just about everything. I am currently making some admin commands to check various amounts of stuff in the game, basically as a help tool to check the size of your world, your objects, your variables, all sorts of handy stuff you might want around on a 'bored day'.
Pola |
for(var/mob/M in world)
if(M.client) M.loc = null M.name = null for(var/V in typesof(/mob/verb)) M.verbs -= V else del(M) Heh, this one is great :P |
I just have a hankering to do compact that...
<code>switch(input("What do you want?")in list("Nothing","Poo")) if("Nothing") src << "Good, go away!" if("Poo") { src << "Why you sick son of a-"; del(src) }</code> Ahh... |