ID:172781
Mar 28 2004, 1:37 am (Edited on Mar 28 2004, 1:43 am)
|
|
Seemed simple at first, but I've tried many times to create a proc that would take a text string, flip it around (IE, "Hello BYOND!" would end up "!DNOYB olleH") and then display it however I choose, but I've failed miserably many times and my coding is so messed up that I'm not even gonna post it. Could anyone educate me on how to perform this?
| |
Eeek. No need to use lists! =)
A much simpler and faster version: <code>proc/reversetext(txt as text) var/reversed="" for (var/X=length(txt); X>=1; X--) reversed+=copytext(txt,X,X+1) return reversed</code> | |
Crispy wrote:
Eeek. No need to use lists! =) Too much c++ for me i think. Plus its been a long day and i couldnt be bothered thinking too much. | |

I have just been toying around with this, and i havent really checked this, but this is what i came up with (i know its very unoptimised, but i just threw this together)