Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static char rcolors[] = { 19, 20, 22, 24, 25, 26, 27, 28, 29 };
- static int
- color_of (char *name)
- {
- int i = 0, sum = 0;
- while (name[i])
- sum += name[i++];
- sum %= sizeof (rcolors) / sizeof (char);
- return rcolors[sum];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement