String Character Changing
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
When you use input[i] it returns the entire string from that point onwards. For example:
pawn Код:
new input[6] = "hello";
printf("%s", input[1]);
//prints: ello
The proper way to compare a single character would be:
pawn Код:
if(input[i] == 'A')
Note: single quotes.
But you may want to look at an implementation of rot13 or similar; 26 similar lines does not seem efficient at all.
While it might not be efficient, It's easy to read (but not easy on the eyes). Thanks for that correction, and I did some research on rot13. The difference is, you could change the character set in those 26 lines, with rot13, it's all the same key (it seems, from a short research period).

EDIT: I wrote this script as a sort of proof of concept to myself and to a friend, I might turn this into a stock to use for a wider range of jumbling
Reply


Messages In This Thread
String Character Changing - by Aerotactics - 03.06.2014, 23:20
Re: String Character Changing - by Vince - 03.06.2014, 23:27
Re: String Character Changing - by Aerotactics - 03.06.2014, 23:38

Forum Jump:


Users browsing this thread: 1 Guest(s)