|
GaidinBDJ Wanderer
Joined: 15 Nov 2002 Posts: 52 Location: Las Vegas, Nevada
|
Posted: 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 |
|
|
|
asm Wanderer
Joined: 19 Jul 2004 Posts: 68
|
Posted: 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.... |
|
|
|
GaidinBDJ Wanderer
Joined: 15 Nov 2002 Posts: 52 Location: Las Vegas, Nevada
|
Posted: 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 |
|
|
|
|
|