Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Seyne
Newbie


Joined: 26 Aug 2001
Posts: 3

PostPosted: Thu Jan 15, 2004 5:24 am   

functions, broken?
 
OK, I'm going to start with I'm a pretty newbie coder, but I tend to think I learn fast. So, I try to make some functions, and they aren't working the way I think they will. So out of curiosity, I do the function example verbatim from the help.

#FU fact {%if(%1<=1,1,%1*@fact(%eval(%1-1)))}

So then I further do the example actions, using #EVAL and #SHOW.

#EVAL @fact(5)

it's supposed to yield an output of 120. But it gives me the #SHOW output, 5*4*3*2*1.

If I can't get the basic example to work with cut'n'paste, I've no hope of successfully creating my own. Any ideas?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Jan 15, 2004 2:46 pm   
 
You need to tell zMUD to evaluate the output of the function:
#SH %eval(@fact(5))
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jan 15, 2004 7:40 pm   
 
Interesting, you're probably the first person to ever actually try the example.

Submit a bugrep on #EVALUATE.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net