Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualVytis

Posted 23 April 2014 - 02:02 PM

You are not incrementing txtPtr to point to next character.

Basically you are converting the same character text_size times. Then searching for it in search array 26 times.

Change 45 line to
txtPtr = random_text + n;

But, there is a better way.
You could use the fact that letters a-z can be converted directly to integer 0-25 using ASCII table.
I leave the rest for You. A hint about debugger is also useful.

#2Vytis

Posted 23 April 2014 - 02:00 PM

You are not incrementing txtPtr to point to next character.

Basically you are converting the same character text_size times. Then searching for it in search array 26 times.

Change 45 line to
txtPtr = random_text + n;

But, there is a better way.
You could use the fact that letters a-z can be converted directly to integer 0-26 using ASCII table.
I leave the rest for You. A hint about debugger is also useful.

#1Vytis

Posted 23 April 2014 - 01:55 PM

You are not incrementing txtPtr to point to next character.

Basically you are converting the same character text_size times.

Change 45 line to
txtPtr = random_text + n;

PARTNERS