Pin Number Function

Game Editor comments and discussion.

Pin Number Function

Postby DilloDude » Fri May 19, 2006 6:46 am

I have been thinking of a simle way to get a pin-number out of a string, for use in registration. I have developed a simple solution, but the problem is, how good is it? How easy would it be to figure out? I am thinking it may not be that good for those reasons, but I want peoples opinions. Here is what I'm using:
Code: Select all
int getkey(char *Enter)
{
    int enterlength = strlen(Enter);
    char entered[10000];
    int i;
    int returnval = 0;
    for (i = 0; i < enterlength; i++)
    {
        returnval += ((entered[i] / 52) + 75) * 54;
    }
    return returnval;
}

You can adjust the integers 52, 75 and 54 to customize it. You can also adjust what returnval is set to, but this won't change much. This will determine a number for each string you enter. To test, use two text actors, one with text input. On keydown enter, textNumber = getkey(Enter.text). Then you can test various results.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest