XP is just a number | |
PerlMonks |
Re: Words that suck...by ChemBoy (Priest) |
on Jan 16, 2002 at 22:53 UTC ( [id://139280]=note: print w/replies, xml ) | Need Help?? |
Neat! I disagree, though, with your for- and while-loop construction. I have a weakness for low-byte constructions, of course, but I really think it's easier to read that main loop as
In fact, given my druthers, I'd invert the logic to though I know some would argue against that move. And while I'm engaged in pointless nitpicking (<grin>), wouldn't it be more appropriate to change the scoring algorithm so that it wouldn't penalize for column shifts that could be managed without moving your hand? As it stands, "asdfdsa" and "asdfghjkl" both score 1.0,though it's obviously much easier to type the former... Of course, there are more or less infinite variations on how one could score that (which may be why you didn't try), but as a first attempt, how about this?
I don't think that's the best adjustment to apply, though--it's just the easiest. Maybe a floor function there (that is, int ( ($mostc-$leastc) / 3) ))? Hmmm... If God had meant us to fly, he would *never* have given us the railroads. --Michael Flanders
In Section
Cool Uses for Perl
|
|