int main(void)
{
char post[] = "(; SNOISSES ETAVIRP ROF HGUONE EMYAP ROXXAH LUFREWOP MA I";
puts(rev(post));
return 0;
}
$ ./a
I AM POWERFUL HAXXOR PAYME ENOUGH FOR PRIVATE SESSIONS ;(
Name:
Anonymous2006-10-06 19:48
>>3
SMALLER: #include <stdio.h>
int main()
{
char post[]="(; SNOISSES ETAVIRP ROF HGUONE EMYAP ROXXAH LUFREWOP MA I";
int i;
for(i=strlen(post)-1;i>-1;i--)
{
printf("%c",post[i]);
}
printf("\n");
return(0);
}
OR IN PERL FOR AWESOMENESS: die join"",reverse split//,"\n(; SNOISSES ETAVIRP ROF HGUONE EMYAP ROXXAH LUFREWOP MA I"
OR EVEN BETTAR: die pack("c*",unpack("f*",unpack("u*",'M``"20@```$(``()"``":0@```$(``*!"``">0@``KD(``(I"``"D0@``C$(`'."\n".'M`*I"``"80@```$(``)!"``""0@``L$(``+!"``">0@``I$(```!"``"@0@``'."\n".'M@D(``+)"``":0@``BD(```!"``"*0@``G$(``)Y"``"J0@``CD(``)!"````'."\n".'M0@``C$(``)Y"``"D0@```$(``*!"``"D0@``DD(``*Q"``""0@``J$(``(I"'."\n".'M````0@``ID(``(I"``"F0@``ID(``))"``">0@``G$(``*9"````0@``;$(`'."\n".'#`"!"'."\n"))),"\n"
Name:
Anonymous2006-10-06 20:01
Fair enough. You'd use a reverse for loop if you wanted to store the reversed string in different memory too, but meh. I didn't want to rely on the string library. And at least it's not an XOR swap.