in reply to Re^4: Find the shortest word in the English Language with: a b c d e f
in thread Find the shortest word in the English Language with: a b c d e f

Two chars off if you put the constant first in the commaprison (good practice anyways :) and get rid of the 'if' statement modifier using '&&':

for(<>){$a=a;$a++while/$a/i;f lt$a&&push@{$_[y///c]},$_}@_=map$_?@$_:( +),@_;print$_[0]

Five chars of if you get rid of transforming @_ and grab directly what you want:

for(<>){$a=a;$a++while/$a/i;f lt$a&&push@{$_[y///c]},$_}print+(map$_?@ +$_:(),@_)[0]

82. I'm sure tybalt89 can do better, though.

update: I wonder why biface isn't a verb proper, meaning treat someone with a biface. The shortest word would then be bifaced which seems fitting to me, huffman-coding anglo-saxonian history.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Replies are listed 'Best First'.
Re^6: Find the shortest word in the English Language with: a b c d e f
by tybalt89 (Monsignor) on Jul 11, 2018 at 15:45 UTC
    perl -e '/a/&/b/&/c/&/d/&/e/&/f/&&($a[99-y///c].=$_)for<>;print pop@a' + /usr/share/dict/words

    Outputs:

    boldface feedback
      boldface

      head -n1 /usr/share/dict/README; perl -e '/a/&/b/&/c/&/d/&/e/&/f/&&($a[99-y///c].=$_)for<>;print pop@a' /usr/share/dict/words

      On macOS High Sierra 10.13.4:
      
      #	@(#)README	8.1 (Berkeley) 6/5/93
      feedback
      


      STOP REINVENTING WHEELS ⚛ START BUILDING SPACE ROCKETS!CPAN 🐪