in reply to (Golf) Hangman Player
44 charssub f { ($a=shift)=~s/_/[^$a]/g;grep/^$a$/i,@{$_[0]} #23456789_123456789_123456789_123456789_1234 }
Update I screwed up and didn't do most frequent char... now I have both...
Done the right way I get 79 chars for part Bsub g { shift;for(@{+shift}){s/[@_]//g;$c{$_}++for split//}(sort{$c{$b}<=>$c{$ +a}}%c)[0] #23456789_123456789_123456789_123456789_123456789_123456789_123456789_ +123456789 }
43 chars without most common char (the wrong way :)sub g { shift;for(@{+shift}){s/[@_]//g;$b||=chop}$b #23456789_123456789_123456789_123456789_123 }
- Ant
- Some of my best work - Fish Dinner
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: (Golf) Hangman Player
by japhy (Canon) on Oct 04, 2001 at 22:11 UTC |