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
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Sun Mar 03, 2002 10:41 am   

Script help.
 
Here's what I'm looking for. I want a script, one that will start with look aaa and go all the way to look zzz. One that will hit every possible combination between aaa and zzz. How do I do this without the pain of typing every combination?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sun Mar 03, 2002 11:29 am   
 


#LOOP 26 {
#VAR firstletter %char(96+%i)
#LOOP 26 {
#VAR secondletter %char(96+%i)
#LOOP 26 {
look @firstletter@secondletter%char(96+%i)
}
}
}


it looks at all combinations of [a..z][a..z][a..z]

TonDiening
Beta Upgrading to 6.26
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Mar 03, 2002 5:55 pm   
 
If you'd prefer to do it all with one loop, this should work:
#VAR alphabet {abcdefghijklmnopqrstuvwxyz}
#LOOP 0,17575 {look %copy(@alphabet,%eval((%i26)+1),1)%copy(@alphabet,%eval(((%i/26)26)+1),1)%copy(@alphabet,%eval(((%i/676)26)+1),1)}


I'm not going to test it though. I'm not willing to inflict 17.5K lines of spam on myself.

LightBulb
All scripts untested unless otherwise noted
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