看板mud
标 题Re: [问题] zmud的多重if问题..
发信站NTITBBS (Thu Oct 20 17:01:12 2005)
转信站ptt!ctu-reader!Spring!news.nctu!news.ntu!news.ee.ttu!netnews.csie.nctu
※ 引述《[email protected] (●○●○●○●○●○●)》之铭言:
> 要做多个#if的判断的话,
> 除了#if aaa=@bbb {#if aaa=@ccc {#if aaa=@ddd {do xxx}}}这样以外,
> 有比较好的写法吗?
> 这个写法好吃资源啊..
可以用#case
以下是zmud的说明档
#CASE 2 {first command} {second command} {third command}
sends the string second command to the MUD
#CASE @joincmd {join} {rescue}
if the variable @joincmd is 1 (or 3,5,7...) the string join is returned,
otherwise the string rescue is returned.
#CASE %random {Hello} {Hi there} {Hiya} {Hi}
returns a random string from the given list to the MUD.
--
所学得永远都只是基本概念,唯有从基本概念去延伸出无限概念,这才是科学。
NCIT CSIE. Saren Chen.
--
※ Origin: 碧海蓝天 <bbs.ntit.edu.tw>
◆ From: 218-175-72-205.dynamic.hinet.net