Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Script to find optimal words

by tedv (Pilgrim)
on Nov 10, 2000 at 00:15 UTC ( [id://40802]=note: print w/replies, xml ) Need Help??


in reply to Kiddie Codes

Just for fun, I wrote this script to parse /usr/dict/words looking for long words without repeating letters. Here's the code:
#!/usr/bin/perl -w use strict; my @words = (); my $max_len = 0; my $delta = 2; # Number of letters less than maximum which is acceptab +le while (<>) { # Check for words which are too short my $cur_len = length; next if $cur_len + $delta < $max_len; # Check for words with repeating letters next if /(.).*\1/; # Store value in list, possibly destroying old values if ($cur_len > $max_len) { $max_len = $cur_len; @words = ($_); } else { push @words, $_; } } print @words;
And if you're curious, here's the output:
ambidextrously bankruptcies bluestocking configurable considerably consumptively copyrightable customizable exclusionary flowcharting incomputable productively questionably recognizably unpredictably unprofitable upholstering
A thirteen letter word might work better because you wouldn't have to pad the cypher.

-Ted

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://40802]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2025-06-22 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.