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
horks
Apprentice


Joined: 20 Jul 2001
Posts: 127
Location: USA

PostPosted: Tue Feb 04, 2003 6:32 am   

Variable Question
 
This should be an easy one. I just can't think of a good answer, and I'm hoping you guys can :)

I record how much gexp per round I make, and I'd like to record peaks, valleys and averages ...

however I only want to record the peaks valleys and averages of the last X rounds ...

so I am guessing I need to do these steps?:

1) record value a list
2) check number of items in list
3) if number of items is over X discard oldest item.

Any ideas? Thanks for the help :)

Father Horks
The only problem with computer security, is when you think it exists.
Reply with quote
Don_Coulane
Newbie


Joined: 23 Jan 2003
Posts: 3
Location: Sweden

PostPosted: Tue Feb 04, 2003 11:56 am   
 
Could you describe it a little more precisely?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Feb 04, 2003 4:41 pm   
 
Since you didn't provide info, I've just made stuff up.
Using @gexp as the gexp per round and @gexplist as the list. 15 as the max number of items.
#VAR gexplist {%additem( @gexp, @gexplist)}
#IF (%numitems( @gexplist) > 15) {#DELNITEM gexplist 1}
#SAY %max( %replace( @gexplist, "|", ","))
#SAY %min( %replace( @gexplist, "|", ","))
#SAY %eval( %eval( %replace( @gexplist, "|", "+")) / %numitems( @gexplist))

LightBulb
Advanced Member
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