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
GaidinBDJ
Wanderer


Joined: 15 Nov 2002
Posts: 52
Location: Las Vegas, Nevada

PostPosted: Wed Jun 08, 2005 5:07 pm   

Speedwalk path parsing (PHP)
 
Alright, here's the deal. I need, for an area database, a PHP function to parse a speedwalk string and print it out in semicolon seperated format.

Basically turn this:

.(portal)12n;.(leave)4n2e2ne9nwn8wh

into this:

portal;n;n;n;n;n;n;n;n;n;n;n;n;leave;n;n;n;n;e;e;n;e;n;n;n;n;n;n;n;n;n;w;n;w;w;w;w;w;w;w;w;nw

and I kinda need it in PHP as that's the language I can debug and know how to use (I'm just not really sure about this particular application).

It's gotta be able to handle the non-standard exits (portal, leave, etc.).
_________________
Barry
Gaidin @ 3k.org
Reply with quote
asm
Wanderer


Joined: 19 Jul 2004
Posts: 68

PostPosted: Wed Jun 08, 2005 8:15 pm   
 
Extract the number (12) and the letter (n) and for loop a string +=$letter + ";" or however you concat in PHP, though obviously you'll have to change around h to nw and so on. And, if it's in parentheses, simply extract it verbatim with a semicolon on the end....

If you know PHP, I don't see why you're having trouble writing this....
Reply with quote
GaidinBDJ
Wanderer


Joined: 15 Nov 2002
Posts: 52
Location: Las Vegas, Nevada

PostPosted: Wed Jun 08, 2005 8:44 pm   
 
Because I know PHP in the sense that I can use it. I have no idea how to do this kind of string manipulation. I know the basic algorithm, but not how to apply it in this language.
_________________
Barry
Gaidin @ 3k.org
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