def send_text_to(player,msg)
text_to_socket(player,(player.is_affected_by?(:perplex) ? msg.reverse : msg))
end
def send_text_to(player,msg)
text_to_socket(player,(player.is_affected_by?(:perplex) ? msg.reverse : msg))
end
string invert_string( const string & orig )
{
string result = "";
size_t j = 0;
if( orig.empty( ) )
return orig;
for( size_t i = orig.length( ) - 1; j < orig.length( ); –i, ++j )
result += orig[i];
return result;
}
void invert( char *arg1, char *arg2 )
{
int i = 0;
int len = strlen( arg1 ) - 1;
while( i <= len )
{
*( arg2 + i ) = *( arg1 + ( len - i ) );
i++;
}
*( arg2 + i ) = '\0';
}
void invert( char *arg1, char *arg2 )
{
int i = 0;
int len = strlen( arg1 ) - 1;
while( i <= len )
{
arg2[i] = arg1[len - i];
arg2[i] = '\0';
}
}
arg2[i] = '\0'shouldn't that be an i++ and the terminating null be added after the while loop?
irb(main):018:0> "Hello World In Reverse!".reverse
=> "!esreveR nI dlroW olleH"
Anyway it's cast on a char and that char gets an affect placed on them..
From then on.. that char sees things backwards names, desc's, says, emotes etc etc..
For example:
Boblinski says "Hello mudbytes!" would become: iksnilboB syas "olleH setybdum!"
Boblinski nods in agreement. would become: iksnilboB sdon ni tnemeerga.
Does anyone have any advice on where I should begin? I'm using QuickMUD!