Find one-handed words

Bash (100 89 chars)

for x in a-gq-tvwxz h-puy\'
do grep -iE ^[$x]*$ /usr/share/dict/words|tr '
' \ 
echo
done

Note that 21 chars go to the full path to the words file: if we're allowed to assume that pwd is /usr/share/dict then 16 of those can be saved.

Credit to chron for the shorter regexes.


sed, 78 bytes

1{x;s/^/! /;x};/^['h-puy]*$/IH;/^[a-gq-tv-xz]*$/I{G;x};${x;y/\n/ /;s/! */\n/p}

requires GNU sed, run with sed -n -f words.sed < /usr/share/dict/words


Bash, 86

for x in a-gq-tvwxz h-pyu\'
do egrep ^[$x]*$ /usr/share/dict/words|tr '
' \ 
echo
done

Taylors for, my egrep, chrons grouping of chars.

By definition, if you type by two hands blind, if you like to produce an uppercase letter, you always use the left hand to produce an uppercase character of the right hand and vice versa.

Of course you may produce an uppercase W with only the left hand, but you can produce junk with the left hand, too, if you like.

Tags:

Code Golf