- 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.