Quote Originally Posted by Lindley View Post
I only specified separate counters because that seemed to be what you were indicating with the "points" system. I'm not quite sure what's going on there, so perhaps I've misunderstood.
Looks like he's got some kind of weighted counter thing going on. He gets a total of the 1s, 2s, and 3s, and compares that total to the length of the string and assigns is some kind of value. The higher the occurrences to length ratio, the higher the value.

So, converting the number to a string, iterating the string and adding to the counter when you get a 1, 2 or 3 seems to be the way to go.