#!/usr/bin/perl -w use strict; # A little anal retention :-) # Change this if your script is at another location. # Remember that your script when tested by the referees # will be named anagrams.pl my $script = "anagrams.pl"; #----------------------------------------------------------# # You should not modify after this line. # #----------------------------------------------------------# # Check solution. select(STDERR);$|=1; select(STDOUT);$|=1; # auto-flush print "You shot a round of ", get_golf_score($script), " strokes (the decimal part is the %age of different chars).\n"; # Make tests. my @tests = ( # void input. [ "", ""], # standard input: mixed order, anagrams and single words. [ "hack snooped tables salt spiff feeling spooned last grep bleats gas ablest fleeing stable slat drive ", "feeling fleeing snooped spooned last salt slat ablest bleats stable tables " ], # ten comes after two [ "ab ba abcde abced abdec abdce abecd abedc acbde acbed acdbe acdeb ", "ab ba abcde abced abdce abdec abecd abedc acbde acbed acdbe acdeb " ], # substring checking (Thanks Stephen) [ "cat act acts cats ", "act cat acts cats "], # input with no anagrams. [ "eugene andrew ton fwp spiff mtv ", "" ], # input with only anagrams of the same letters. [ "partisans aspirants ", "aspirants partisans " ], # can it handle tests of eleven or more? [ "larrywall arrywalll rrywallla rywalllar ywalllarr walllarry alllarryw lllarrywa llarrywal llawyrral lawyrrall thedamien hedamient edamienth damienthe amienthed mientheda ienthedam enthedami nthedamie neimadeht neimadthe ethdamien ", "alllarryw arrywalll larrywall lawyrrall llarrywal llawyrral lllarrywa rrywallla rywalllar walllarry ywalllarr amienthed damienthe edamienth enthedami ethdamien hedamient ienthedam mientheda neimadeht neimadthe nthedamie thedamien "], # more and less than 10 ["foo azzz oof ter larrywall arrywalll rrywallla rywalllar ywalllarr walllarry alllarryw lllarrywa llarrywal llawyrral lawyrrall ", "foo oof alllarryw arrywalll larrywall lawyrrall llarrywal llawyrral lllarrywa rrywallla rywalllar walllarry ywalllarr "], # melting words. [ "evidence acres fizzle loner siren snuggled foo sierra salter evaporate ourselves counterflow unwelcome sects severities nicest flint familiarizing unknowable archbishop encrypt alerts cares races scare airers yelp ariser nip ensure raiser warfield quashing emil slater romeo pier engenders nanoprogramming alters railroading discounts jacky resin barefaced champion sued uwarn foo streetcars ached dues rinse audiogram necessitated derivatives editorial loophole deus snobbish identifiably inconceivable used pinkly genoa risen decisiveness misshapen reins large neil foreseen rebuttal deletions slack ", "foo foo acres cares races scare airers ariser raiser sierra alerts alters salter slater deus dues sued used reins resin rinse risen siren " ], # the big one. [ "colonizer debates conspirators atrophied huxley betatron adjoined funnier lavoisier abounds years gassed overstatements presented animations incubators postmaster signification educator bayda chippendale masturbation pardonable itself skippers solomon teachers credulousness discretely skinny cliques urchin modal country merck capybara executive consecutive walden centuries hackneyed canceled jerking playwright shoed ministry docile sylvia sight murray adventurous deep atrophies annalist dying fiery gnats acknowledgments morale adjustments environs engineered dangled sprout blunter hurdle leaped dentally bunt gothicize disagreeing profitted vatican altruistically appreciations imperfections nights homogeneity envious kamikaze presbyterian manipulable limiters dawned protector scaly frantic determinations banjo armagnac carib methodologies puppy moneys befalling appended troublemaker overworking panicked plebiscite marshaled practical winds simmons counter cooing mullah churchman ivanhoe synthesizers computes buckwheat captivated comprehended mekong dreads avaricious glares mayo cry most semitic deposes resolutions reorganize backups matisse glucose whittling remodeled bromides sinai wyoming pollard chairing fijian citing dwellers copenhagen indecision rends hemoglobin hebrew radiators syndrome chaplain effectually pattered maced hart graining neck suntan modularized enveloper deadly friction brass had sarasota visit bubbly haves disk pervaded warriors indiscretion typing bypassed backstairs hiding pupa comradeship fishmonger husking requests umbrella racks blankly challengers dawns nineveh telescopes cashew amphibology fourteen contentions reduces wonted dotted cataloged totals albums millipede marry believed sailboat forcibly derails meditate reconstructed reconstruction taxis wrench recreations reappraisal endpoint prove cleanse hadamard coalesces humanity protozoa earthquake smart fruitless schoolrooms conforming notifications rubbing bungalow antennas cranking inland quasar pigeons sleighs spa extenuated optimal todd paraffin parenthesis mistakenly applicatively unmistakable varitype society carroll taster helps gradient teacher aesop fitted niceness memorableness divide deepens derivatives minsk rusticating spooning crackle donovan surliness requisition bouncer em agglutinate weston approval philosophize restrain sterilization redeclare cody applications mumblers springboard shedir firmly incident shipmate assemblage accelerometer grit pair poises engraved conquerable entitled rend poussin reflectors toilets urns findings africans headlining orlando compacter fondling orthodox nutate stan reinitialized facilitates intertwined ruined bereavements unguarded disband cliffs nationalization scout shopkeeper sympathies imitate merchandising translations tools notarize tandem reprobate sargent possibility yankee ingersoll picofarad esprit gallantly kiloword impresses shrugs assets fetal decomposition larry shaker frye corrode uneasy kettles fettered sallying entireties punting magneto science kaufman sagebrush blackberries blacks psyches norfolk disambiguate confidant govern blunted zimmerman bagel kirby arc prolog owning dispensation concordant plies abandoned pester indivisibility vietnamese minimizer buckshot vergil aniseikonic pungent gazers transferability fluke relocating sketchpad roundup dogmatism researched dodecahedron gold embroil malfunctions lodowick inconceivable ranch beget clucks isolde oversubscribed ships ordering kirkwood surety bailiffs pinball fluctuate principally arcade ike mettlesome bracing fulton whine quad orbital microphone austrianizes coupler studs statistically omens thrash benedict conrad offender ski notational fasten surrender alienating headroom octahedra explosions suitor disregarding wireless rebellion indefinitely chiefly pricked stag thermostat nibbling ensign ephemeral spreading west reflexiveness dynamically requesters alcoves intensification iowa ovals classrooms sinfully monash impurities arizona dispersal tablespoonful counselors patio socks grosses horde cooperate bilingual scythe staley consenters outrun norse drownings destruction enjoyed hollowly deviations kitchen sampler embryo subverted admirably rivaled tehran franker cutoff giggled chamberlain expires affidavit vowed found galleried guitar reevaluated reject skimming darns initiated lobbies knotted thoughtfulness conforms pincushion thanklessness agents browse discriminates fruitfulness hems resettings rule perpetuates sponsor makes torrent gujarat administer notorious schelling calvin contractors realist dolphins spoilers dispensing retyped pinning doublets trilateral galled primate anglicanizes briefest leakages pius singing island bingo waving lulled rumen concoct rectangular mainframe snip army chinas thousandth torquemada reinstates grusky obtains reflective uplift lending pensioner hanoverizes undertaker archery grayed recordings excludes excavation swastika tenderly traffic critiques romantics festivities dislocate meagerness banshees preferential column twists thimble horseflesh corporate institute berlinizes summed rounder slater protestation popping norms steeping challenges occlusions opossum imagen militant marital sentential islandia organism cypress specialized tautness stencils stumble julius resynchronization loomis repertory steepness infinitum recalibrates bewails bisection booted relayed scramble cheeses suzuki antiserum declaratory antiquated carbonates wordsworth markers abyssinia thirteen anaplasmosis ephesians gird prophets preconceived trained olympianize drunkard sundial clattered vanilla copying intercommunicate squinted abe dissension assimilating disclosing suffragette deserve eldest claudia seagull debilitated cutback suppress goddard evensen shuffle tenor stygian reconfigurable snowball dimming styling tyrant bitterer overstates plagiarist arcsine purified storied preserver speed incubator briefly clement walton motto jogs trillionth antiseptic graspable licensed jorgenson align interpreting skeptically gayly organizer pageantry purchasers dahl winded comma detergent handiest has secular bowled moghul silicone delimit comedy pelt municipally nutria hibernia unblocks hated vicissitude postulating mauritania replied abridge schulz subtitle thrills vigilant punts plenty mona sneaky neural cogs turner spiraled salter terminated technically sheboygan pound peninsulas bodyguard infiltrate paycheck orphanage ennobling fashionably subgoals guarantees stable curtsy faints second pyre somewhere metamathematical paragons delights mosquitoes parallelizes lasts fashioned orchestral dielectric jocund chicana sentences wrecker explosively playwrights beeps payoffs duplicator duct unchanging civilization purses buck reckonings structurally buttercup malfunctioned bloats comparison righteous disadvantages preserves instinctual cryptic ordinal mnemonics currant closenesses recurs identity requester oar roundoff assigners homeward exasperate coax detachments described taurus discontinue lace pick pusan reviewed transceivers enabled difficulties awakens crying mainland compensations inanimately scaffoldings cider airlines disbursement egyptianize chunk juniper knight pisces appealingly eyepiece apple revive swedish retrofitting gallops tentatively intercontinental knighting guyers mediterraneanize chinamen askance immediacies durers decipher swindle congresswoman emilio burying kenilworth repose amiable microgramming postulates blocs yaunde reanalyze connecting lining chariot intersects subverter felony doled positive filth manageableness scepters covalent backside cezanne corporation glistened perfectness tell proposals midsection soviets disservice extrapolate selectivity world laws insert quartermaster diophantine muster profound salters impermeable babysit ferret impairs marshmallow marijuana scratched evanston pierces upholding realities liberia hendricks strike decatur systematize croydon parson demodulate far obliges enhancements marts impeachable multiplicative opel lustily staying handiwork bounds chess stafford blunt wench alphabetic subsystems wettest indescribable placements pairing ripped volcano eben breech skip embeds valerie incurs passwords mephistopheles gomez burglarizes relax iterative malt arose sir norwich issuers coiled colleagues estella vases mires contriving analyzable muffled younger slurry watterson investor validly hellespont assistant compartmented wield determined infatuate phoenix grandfathers picks smeared invested subproofs crescents hypnotic bribe satires colonels biconcave phosphate rescuers boning taproot felicia concept comforts clasping confirmed zebra armer channel spend artifacts authentically catered hurl competency fears transformational disowns sunburnt realize surrogates lighthouse searchlight mackinaw unkindness effigy counterbalance slaps schizophrenia ungratefulness amounters tammanyizes deferrable provocation marinate dreadful timeless detaching tabulating reverified bibbed peripheries buss appear tractable disputers timbers varnish linotype gist ballet cheng wheelings modalities utilizing officiate dwelled amazing sensitively occupational noisier adjacent queen continually sheridan huts adducts relabel karol scrub crippled inconvenience norway gustav harassed spooling gibberish tart mediterraneanization evaporation sham infernos osgood hesitate potter deallocated rampant grains czechizations astonish calculates latin lighted sob bulged dissent banks mammalian undecided billionth jean cog beards atemporal rankle subjectively son muncie noun reuniting brag chinaman hypodermic message ramblings reconverted viability shocked thurman hoyt io moorish selected gardner kicked thundering tautology iraq educates proclamations cajoles galileo trigrams stratifications strenuous bulling bromide paroled frayed freshman juiciest unsafely rearranging adjustably peppered commemorating inferring prophesy confines junkers surveyed abelian revolted ziggy saddlebag wrecked aztecan resolvable cajole rearrange ailerons sprawling setters freemasons stair diets goofed alfalfa dorchester egyptian lou accuser rot traditional deaths monitoring mesquite peripherally annunciators languished storage gassing desperado chicanas marriageable expunge laziness launches aubrey chirping asteroid surged assumption monitor finesse piraeus payment rural subverts caviness manic furniture fenton irking burntness fluoresce dissidents movies italianizer learning welles yeast alertedly gleanings picosecond paneling disclaims antisymmetry plains elaborations affections reordering witty yearn mediated rick untested touching marten vectorization yielded cyanide taunt shenanigan modernizer airflow insides level beans faber diskettes operator dunne browbeaten male visitor winter explode corinthian comes darwinizes athens piecewise bolshevism relish looped gaseous airplane roadbed stench abortive real adders oscillatory ribbons dry indignant percussion expedite intoxication tenex straws headlight cake some preoccupation crosstalk sequencings regulus rehearse speakeasy capitals personalizing core cache inflict pebbles hesitatingly limiting manifolds worldly jets comical tapings allergy molding howling confrontation patrick hug goofy anticipations coziness squabbled generalizations dependent destine cargill importers examining wire branchings threw revisionary blowing touchy disadvantageous sophistry pilgrimages bumbled unionization reichstag moslemizes ascetics laced marvelous besting reined melbourne disillusion peterson forceful disinterestedness kermit littleness baronial oakmont squint harvardizes replacer synchronous context contention harrier undaunted schopenhauer somatic antidisestablishmentarianism loiter murderously decompositions huffman flawed belittling regenerating boatswains book swapping pardons grounder buds sympathizers mangles osbert cupertino autopilot stun reconstruct recalled sate fictions suspension polio interpolating talkativeness barters judas appliance queued subsumed chameleon relabelled furs hypocrites mu whiz bucks kali fauntleroy sherlock pan bushy quieting cheyennes bobbing rockaways elk boldface timidity baileys justifiers degrading mitch misusing preallocating tabulation woodbury hyper squires projectors resound stammered tchaikovsky humoring discrepancies buick poetics prologue slogan grass hiawatha approachability byways ascertainable broadway overemphasized dalhousie collagen enactment basking unites bothers willfully progressively betterments forefather cuttingly screeching armata contrives fir diviner tuesdays tilted strictness emigrant cottrell casters optimality forgivable articulation citroen symbolized anomalously munsey kuala dismissing probable suitcases incarnations cycled elinor decal paraguayans eloise rooseveltian plaguing cogitates syntactically convincingly ginger footpath epstein tiffany supporter tramps busses troublesomely censorship detest ambulance bulldog madagascar furtive den deeds hanging largely liquidate pickles beginning affiliated lutz frontier hopeful brushes sixties tagging saluting powdering proceedings luring rocks crawl miserable boots zeroed regains giorgio buxton granddaughter theorem casseroles calories simulation necking murderers filippo inclinations heaved cominform phillies roasted pickled spurning isle counsel centralizes resumable squareness tabulated midshipman linnaeus elegance birch unequivocally hillock absorption elephant fe deducted overseers antisocial humidify acclaims trips welcher flyer compunction sharer pies impertinent memorabilia withholders gorillas invertible lingua dunbar anthropology oxford deploying yawner gaunt greedy toaster phaser slits baptistry ivory underwrites spelled nitrogen rarely commodore jeopardize omitted screaming junta inaccurate unexplored catlike defenestrate nicklaus hollingsworth base granulates lawsuit marcher preconception searchingly confronters interlink antaeus hummed sincerely fireman sojourn theaters condense retranslated reconstructing mussolini rallying application featherweight dissipated ship mild impromptu superior eyes compaction boulevards functionalities dropping graduations andalusian undermines colicky widows aerials pinhead trafficked curled debts vista seasons hobbs bustling pyongyang crudely respectfulness indirected mailmen prostration exports indomitable export apostrophe befell marches ekstrom meekness engraves streamer orbits sharpen harper fewness isotope churchyards subjective baron points rascals anther axis respectably contemplative punishes texture idem nursed concludes ordinances butyl mississippians solidify auscultates falling giraffe kilohertz borate talmudization perisher politic brightens confiscating chasing cultivations allophonic annulus club miltonized isometric lice supportable lutheranizes limitation wariness carried wellesley enigmatic bulletin crickets drown submerged analogies tester penh symbiosis bug irateness renovated antimony above judson guilt conserving bonders behalf clannish landed peeks reconfigure secondary hills respite cohort crossover waiting clamorous asteroids hens pea kindling questionings mathias ambrosial thoughtlessness nibbler undetected bedazzle vilified elapse americanize equivalence widget linus dwelt slave imprints zeiss suppressor stab annulments bowstring attest calculated bewilders producer peppy reworking indifferent nurturing seeley pandas resentfully make bender fortunately theoretically weapon pocketbooks beanbag slice facings reservoir stochastically refilled tyler dialect risers passing searching detecting redirecting withdraws antagonisms anyone rehabilitate tentacles successful arranger restlessness meditative synonymously gracefulness zealously expecting contrastingly horned dada crow inquire nonlocal ants assurances grammarian affirmative blowup messy expire collarbone seed acclimate arterioles effie delinquency deceleration degrees clearing welds witnesses processor translated steps mayor corpses sausages fairest italianizes threads greenwich hum inflation westbound risks insistently paraphrase mottoes elaborate dons squalls liability fortier ericsson crazing suddenness blackmailed predominate goldfish unkindly crandall firsthand mechanizations bumping victor fuzzy poconos emancipation concourse discounted scrolling distilled incorporated baseboard aspirations sampson backarrow mat seasoned uris succeeding insight annuity mckenna dreaming footer dialing buddhism reassures stinker bleat bootable bangles controversy orphan operational unlimited nazarene nibelung biennial pontiff shoji glimmering rupturing ceres blockhouses interface bastion mel james emotions eulerian continued comfortability inhibits warring affectionately delirious alienate irrationally escapade olin exacerbation poplin interchanging audience fizzle sustain acetone unitarians triangularly snatched wishful wartime gulch unlawful blues draftsman photocopier cutout program ohmmeter chili sunken deductible ungrateful knowhow galaxy storks nonpersistent infernal queries banbury styled affects media baller wonders antagonistic refined silica isfahan attained tapped bereavement slighting strikingly francisco virginia weaker adkins haplessness dialysis mini sportswriter reared porting colorado infringed collar six booms parisianization shadiest fetters potato perpetuate leeds echoing drowsy unalienable eden conjecture brazes facilitate swims parentage moon sketched ponderous uglier catheters presents calder grieved chanted urquhart ferried untenable exasperating tachometer nonlinearly britannic manifestations admonishments grouping reexamined afflictive frighten adumbrating page collectible relentlessness captivation parsifal subnets natural handy sexy clamoring budgeters uniformly galen ingestion missionaries bundles conflagration feminist malamud bulls goats bayonne nonetheless stapleton onetime markham purple attainment denver inward threatened postscript portends quack accompaniments spectrographic closeted abbott slapstick chadwick compounded sunflower emphatic exacts truant gnaws gigawatt baubles francie thereafter seize lunching booze sponger career pulled disordered questions claps popularizing introspective reunion weep zoning neptune poignant acclaimed hoodlum disbanded descriptions hitched objects cromwellian huh analogical configured leyden godzilla mariner relaxes northeast canonicalization draped loki stilts leveller verticalness blasphemy krause gladdest permanence thirdly spellers visor questers hooverizes hereof unveiling rat hacker aldebaran unfriendly mingled bundy heiresses directrix replacing cured consonant entrenches chairs taxicab trilled hell presences parasol quote emitter swallowed cruddy pedro splenetic autopsied reenforcement remembered reoccur indestructible terrestrial powdery outskirts destroying irately empiricists wielded vouches pronounced cryptanalyst avoiders weekends chum repel pittsfield root proffers pressed phonetic audit clenches tape transvaal metavariable mayer cloak articulator scarceness uncountably accurate generate kindle memoir sparking permissively disambiguating teems graduating trafficking striker survey ruinous mansfield pend minnesota tolerability cohesively deletes straightforwardly purchaser mankind marginal cognitively chevrolet ripeness bags guatemalan clues tinily rollins roughness almighty jubilee dilution albeit combine deafen tapping monoalphabetic foils yaqui missing noses bomb periodic combustion brookline rejects earns headers culling timid various quarantines knapsack keys oleander frenzied leagues josef boastful moduli lounged earphone rulers implies trudge jesse scenario prevails slavizes yuba ugly acoustics bower inferior salts musty anaerobic feigning stiles slopes commuting butcher sure chef microvax epsilon corvus catherine algol briton eyebrows scowling futuristic pica fragmentation occlusion seoul almost newburyport booming rigs mark agamemnon seated populated tabulate liver dative supplying seismology rawer confounding impelled mailbox perceivably wreak enciphers undermine entropy gaseously judicious expiration creation decompression urging solitude forsaken planck hatch hacked blackfeet upwards genders animate riddles mappable leaved underlings kidnapping served photogenic hellman primes collection quantitatively atalanta predicating entrenched soda palaces rebelliousness dressmakers introspect acting mali rely disapproves sallow revision starter floss tickers spreadsheet darlington helper cruder taping nassau mans severally midpoints reno depleted exerting delay phosphorus pecks intermittently hertz shintoism captor waiverable represses audition unnerving phantoms currently londoner mechanically elliott meandering owned bluing glidden wideband duskiness photocopied didactic vaughn sicken delightfully hernandez cock americans alimony distally pinochle elastic skulks peruvian warmer congratulations pruned nonmaskable perverted triggering demountable screamers pails dirges claws kicks lawless annoy earl stunning misleads bouncing circumstances anecdotal citation appliances foreboding belonging crossroad forage tablecloths pronunciation sunbeam stromberg synopsis dependability quarantining segmenting xenia interpretation memoirs adept consequents snuggled linoleum sanhedrin klaus glistens substructure truncated nay pagoda glaswegian subdirectories antoinette allah anarchy median seasonally unconventional strawberry polyalphabetic marvelling congressionally rulings middlesex radiology payments shined asher superuser inflicted dervish machining handwriting gibraltar hitherto cutter bagrodias imaginably proscribe reinserted perpendicularly will johnnie stammering terrace beep ablest bluffing consequential aeroacoustic suspense beating cohabitation checks deploy discussant squishy fluidity overshadowing antipode built eavesdrop loudspeaker subproblems sixes cougar postulation council innings espousing fibrously caesarian propellers modems devil intern ackerman nod addressable adjudicating warily doberman bowstrings casserole constraints sear pigpen scourge solace priest volleyball authenticator mercurial broadcasts holyoke respondent mellows farmhouses reconnecting buxom observances heard intriguing bumptiousness craves expunges executioner revert cans lucerne centimeter shear rated belief figurative performs noyes denebola accelerating suitably tiller shard diplomatic boxer gatsby counterfeiter whisker licorice villainous affronted einstein magnet respiration recalibrate bribes blacked entered antoine topology restaurants autocrats twofold basting antibacterial deportment moodiness deans knuckle evoked flagpole lease industrial merciful authenticate processed little deriving festivals shimmer mandible sybil ridge resurrector shoals slimly goren gaelic elbow backhand entertainingly wightman muddied radiate dodger lessen lahore blanks perpetuating revoking foible circumventing dashes capsicum mauritius incurable strife blacksmiths gift inclosed exodus forty inspires combated dumbness concomitant prostitution monty rattles confuse ecosystem occidentalize matroid tableaus hemlock aggravation galatean personage preparative fish slept pogo divisible screamer mythical consequently dressmaker converged muscled subscripted decstation scuffling contrasters womb stanzas middletown lockian vanderbilt erring aphonic relieved profile sluggishly dixiecrats anding swimmingly wicker jamaica zions molochize near demanded mutely located arrestors complementers unveiled woman retains lemons colombo rebellions koenig offering nordhoff feeney laotians inaction gazing prohibitively vegetable proselytized disobedient moliere namely fortifications acta wildness waltzing forgettable waterways lovably struggles westerners screams portentous pardoner fermenting imperialism pecking treetops configuration shifting edged cereal nicked retransmits brawler enameled galapagos seizures ventilating controllably bipartisan pitfalls comedians mildly afterward ballast rejoice challenger methodological erudite estonian desperate combines ford revokes droppers earners revoltingly abdominal exhaling lucian auburn shortening coarsest numerics platoon shrinkable performed evinced haphazardness dumbest cocky celticize sessions matcher capers plank illustrious invisible foretold brandel periodically hoffman exponentially stopcocks computerized drips rebuffed epicurizes extremists interfaces vitally livid gags expand despises dowry weathercocks recombine factorization mesopotamia orthogonality squeaking steal septembers weeper bargain sentry recursing lazed fickle up merged intangible forbidden parallelograms related duplex rebooting victory predicted unprimed checkers rationality irreflexive warsaw evenings cowan sniffed telephonic finns discovering interferometer cardiff macromolecule importation granulate wee duchess parasitic researchers disorders roughly drilling prescriptions alps prisoner ventura capistrano battalions laboratories doughnut grovels journeyman trash daunt irreversible shrew prices repealed garner utilize prayer grants tin accompanies physician collaboration meandered accountancy congestive inexperienced restructures burgundies skeptics thousands deport teethed disconnected cede infidels armenian reconcile textual oats bunkhouses januaries disowning consulates forget am shod pythagoreanizes quivered whirr mcdougall hedonist availabilities budgeter shoshone mortals springiness postdoctoral provence computerizes lily adjudication filled caresses candlesticks delicacy bondsman supremely hyacinth proxmire mclaughlin subverting plants transferrers everglades noblest eased manipulations granter goose exponentiations macon marriage carting yarmouth blissful opus geographically straggle invertebrate sharpening airplanes telnet tinting started grooved downlink coaching bullets spiro heatedly cafeteria yardstick circularly census recounts vichy whereabouts scarce bombarding adhere glow chicano uncles bubbling limbs promotes duty equalizer boxes conspicuously fences obscene ekberg leavening critically reluctantly reconsider producing torturing landing shredder cannibal employee factored swipe achaeans lousy discoveries stoke witching thoughtful dishwasher bewitches anomic beguile covet motions courageous musket culvers battlements therefore paid budgeting bellyfull prepares refract matchers substantiates teens photographing outvoted polynesian fouls raft escherichia dossiers annoyer grimness chalked exhilarate aryan depletes marjory planters redcoat wayne acquirable cordial composite heinrich harlem leaps callus awake denier reilly quietness nimbly ann jim escalates scribbles blinking infirmity annihilation seared hapgood circumventable contrasts neat campaigns edict calypso margin appears bloodied bosses disproportionate timonize mung illegitimate clowning oxnard haskins belgium unfamiliarly impersonate employer penalties precisely unattractively veer shivering marshes saxonizations delaney calmest revolts waiter discards blabbing territories connectives thousand saturating subprocesses backlogged forecasts properly purveyor isabel circumstantially umpire harrowed idealizes tobacco demultiplexer earliest hams signals vigilantly echelon finding emperor assert fair iceland ferguson sanatorium bull therein yield mcguire prettier weinstein realism tensions purportedly freewheel accession interferingly droops favorite compensates immense glorified ventilation peddlers crania colloquial advisements readiest gobbles anticipating translate institutions occasions adrenal tutorials falcons subside notched seconders graphed untried carol cleaners resided busch fend filial stiffen divining relies pentecost sacrificer forestalls feldman aromas affiliates splendid petition pointing burdens matter hoe dion groans transplant parisian weighting formica lowness distorting schooner peculiarly perpetuity anions hatched operetta bouts tumultuous substantivity variances furtiveness benton angler markedly magazines lasers sheaf versing selfridge topmost strengths jovian liaison accomplice appraisers decrease midshipmen tiniest yelp packager carbolic plotter ram review founded leaders brochures reformatting opposites supposed breakwater expended flavors contest dunce adjoining smokies academic kaskaskia matchless eyelash claustrophobia pamphlets converting browbeating reinforced reciprocation wriggle stocker bobs poseidon donate parisianizes countersink itel archenemy droplet denotes foiled instants hissing referenda committed quark unaccustomed majestic mouths art spotlight aristocracy abortion eskimos passers agreements exercised munroe algebra decisively juneau await kobayashi simplicities fungus sicknesses filler imposes americanization justifying chickadee beneficent antidotes amazement expend nails repented burnside conflicting restitution mawr encouragement lichter construing stabilized sorrows champlain muffin tahiti perturbed chalking retroactively inequality goldenrod bizet maize prescription filing threescore dampness decryption recline preexisting word trances diversionary recycles tentative hysterical implanting traded newbold agendas philosophizer thorough slipped sidereal beatably passage fees cushion dystrophy crumbly ranker skirmisher depresses refrains arpanet restful manifested macroeconomics predetermination okinawa toweling princely nepal backstage forecasted gullies twin lawns sobbing brownest purpose modestly harried psychopathic impulse assessor compels commander prosodic feats differentials goodwin forgives immunities orbited flashes overlap technicians dormant millionth citizens relic fable recitals bulked brunhilde dacca absent monolith willed woof stroking motorcycle sequoia subsequence clocker pier redone stile threading apsis gapes latinization affinity slewing incubates grownups flashers apologizes syndicate administrators dekastere amount jeremiah turns gunfire satellites trip swim infirmary supple balm mastery conditioned leavened dismal gladiator regenerator patina excessively bicycle oncology spite hindus glimpse perilously bullfrog blackboards bowler shearer honeymooned leo telephony representatively distinguishes culture dungeon carleton hemispheres williamson pauli greenly removals frivolous caterpillar exhaustive regional dismembered tonsil sheraton elbows faint sedimentary corrigible attains gases conjugal bricked thessalonian pioneers geese truism twice teleologically obstructed misnomer blending lifestyles thereof plymouth altars gated blunting estimate licensee assassinations messes blight habitat engineer yeats knits cassandra pseudonym johann alibis misjudgment hilt matted sheered staunchly reveals watchers earn canada tuscany westphalia bedders fertilizes vehicular pine throneberry canal lydia blatz potemkin saved shaved morocco imprecisely ablating deify condemners miranda nipple matrimony antihistorical river amounting parceled bunches texases unmasked malraux morally dasher harrington paramus balboa incubation rebroadcasting illicit phonemes preemptor defunct conglomerate electron zonal sidesaddle acquits attentionality flanking electrons fattener consenting annie cast simile grover pistol occurrence circulates disallowed binders hindered glowingly damn taint affected peaked husbandry reassign bathurst queueing expendable scuffles budd intensely truthfulness penalized house invasions microarchitectures reachability antipodes squeal appendages colorful uninsulated alundum huxtable assassins empirical oddity sunlight british listener impending grassier lambdas tangential grounding owner disney formant brunswick roundhouse sicker armchairs bread actinium spiced migrant looted danced publicly weldon kinship calling examine chafer agreeing saddest blase arrows throttles control plunge viet overseer orly legislating nuisance puddings robes incorrectly presentation serializing however feudalism attribution recombined serpentine bowline viking line disproving antisemitism mournful paradise multiprocessor rickettsia tightly strolled mendelssohn burglarproof evict frightfulness alvin cramps baskets mayhap appealed pouch recounting squat nevins oldy visiting atmospheric bargains avoids assailing desolate scoff braying schloss revivals obscurity salted ill byron authorizer magician spaniardizations pin macromolecules acceptably sacrificially hydrant levis encyclopedic amazedly tiled embellished anhydrous egypt catapult lynxes concretely ruts bimonthly abnormalities algenib unvarying injurious reconciles upgrade impenetrable use conversely agglomerated types acknowledger armadillos measure denizen mischievousness snipe appoint broil filthier process outcomes document protista implication annoying vein britishly bonny floor skillet bobbed italy sympathized multics pipette fluff parity burlington trains mint archangels rebuked shootings reciprocally elliptically assisting proportionally airless clanging committeemen mourns induced lesser fashions abase binges gad whipple telemann honeycomb origins incomparable interrelated seedlings intimidated swan exclaimers comprehensively frisian nebraska uttered stockbroker knickerbocker rams refillable brew accreditations assertively customize augustus is confers fiddler dampen imagines slipperiness keying paragon badness armed frog cartridges aberration untouchables marylanders adaptors brunch lynched catalyst statutoriness reminiscence retaliatory embody confederate virus outstandingly latinate waffle garfield comprise improvements improvisations wills carriers readout decremented revolver minded priori seminole buenos abiding quarts entertained canvas refuses harmed nineties facades bawls squash motivated pinwheel jingling infringe persevering harken adhesives trespassers reflector thayer bunny visitation circuses soldier mediates sorts deterministic genevieve exclusive pythagoreans boatsmen necessities beaks foremost shiva bureaucracies interchangeably draco your firearm july gradients erects leonard depositions inconsistently exactions freest affair consent knotting limits punjab remote trademark slider chairwoman rewire chanting xhosa foundries snored sleeve chokers improbability modules paddy bangui befriends sweating lunged abductor bootstrap champagne storekeeper stupidity sprawl volunteers chicagoans regarding macmahon arguers verily whiteners ringers milliampere building desertion atrophic hobbling sofia suffrage offshore rushed plower beautifier assessors haziness sensibilities geyser ingest gables realized exaggeration cager dike noted drummond allegation lairs subunits customizer casts jackets beatific name throws cadenced expensively ankles similarities demonstrators tunisia illegality sequentialized inflates bisons prying pilers cosine auckland austerely folk imprimatur reformulating retch happiness aback interior whistlers exalts hiatt liter slats eliminators fivefold crossable moistness missouri maxima complaining declarer warping refilling weds infantry blemishes reconfigures girl distortions isomorphically nondeterminism curricular gazer squirt sector cicada scans stirling furnishing extents elderly prussianization them fixer informing hitchcock phoneme realms underpinnings apportionments much think torment keypad simonson ejaculation proselytize speeches frequent clytemnestra intramuscular sonar teheran grab scalloped thrashing recife decidability disclaim auditing sources mobs curing disjunctively readouts burrs watanabe elks intramural slipper quaked revived deluge flaxen dellwood sandpaper discharge giraffes lenten mileage directs technologist autographs eccentricities calkins partook baths prepending gargantuan allotting henderson peaks widowed denounces proudest aiding destroy salem choke deceiver taunts fans adelaide neighborhood cohen opportunity avalanches fill relentless walks submodules dominantly rotates notice drape bile infused ramifications submissions superlatively toggling contends cardiology restored hilarity frills rene mailboxes ascension mitigate cloudiness numeral donated likeness defections interconnecting dynamism boners possible edenize sore journey bellowed barring bootlegs showpiece manufacturing tampering bleakness courts ermine postal concrete waldron covetousness davy warranties remedying reiterated reverses musical occurring alight carriage rowena neigh darwinism squad dirts clinker woofs herodotus transparently monotone contracting sensuous describe mcconnell pitiers rankin prospectus rebinds bertram undisciplined reducible defiling smile besieging indigestible swaggered downplays practice sequencer skyscrapers cryptology paleness abstractness nonprogrammable infamy meriting emulating folksy assertions wanders veil mounter avoiding covent multicasts metrecal horsefly jingled excepting fly politicians tamil twirled counteracted suspicions jello doublet overthrown deserts barnstorming phenomena combed verified encrypted adducible tropez clipboard perforce rein anatomy steams chinese whisk contrive stripe dedicating bike provided sweated memories sensors homeless silhouetted attendee mcknight butane recommendation bilbao laid rots hums equilateral loosed placid proportion math afoot rewind highwaymen sprague protrusion kevin gigavolt prerequisite flexibly necessitate meanly intervals formulator pearls shadily nobleman hereabout idiosyncrasy resigning provident excretory papered affluent interrupt dependently good affection pitiful compute ballooner cardboard henpeck tass snugness lobbied myers repository persianization begin phyla tankers teases encapsulation patriotism faraday competence sparest crafted assertion paroles prevailed rows proliferating percy unlinked dismissed muscular thereabouts spider envy hardworking resembling selecting debase somalia personalizes disgusts millipedes slit hijacked cupboards patterns pinks rectum expanse carlo innards buildings scents balsam rending aptly dubuque awards comprised desegregate appalachia lavender relates mcneil darling certainly lucien smoothest declinations customs saxton earnestness viscous scampers noiselessly indo redeemers kingsley justified mechanized electors bedeviling shaken eastern axon repaid blinked gatherings barnstorm grate verderer gorky wardrobes amiss clue availers debater cultivation spawning inconspicuous peal mahogany acceptor athletic irvine recant dubiousness investigative counterpointing denials humidifier enticing implants stockroom pastors alleyways skirted utopianizes sweat intruders pi devon everybody electrolytes narcissus swivel magnolia novak buddhist compartmentalizes fraternity hairiness lithuania inquired gunman piezoelectric trapezoid desserts homesteaders appealers stenographer quixote surroundings stagnate devastated gush adherence belting enumerate reconverts spitefully declined type alliances megaword plural vikram elena exercise thereupon entrances cart enlarged exists abasement defendant crete renewer favoring shavings jewels rephrases juncture dishonored african cocktails pocahontas front victimizers virginians angeleno goatees coalition cutthroat sloan query having pegboard squirrels truk discount fracturing actual regain hypertext inquirers pounce roxbury cookbook based radioing dwelling reclassifying pepperoni synonymous dustbin clio depress distillers paten governed olympus possessors purdue sullenness crags decentralized spoilage honduras complexities palm terrific recesses agar aright several evacuate float boheme soccer decomposable blanche valentine jumped splitting clods conductor monograph layer judith bacillus sprinted rigorous quivers textures reveal kickapoo diplomas negligible safest bloodstream craze rifling guidelines reactively exceptional penalize exemplifies overdraft wilmette scrutinize failures menials closely aloha astronomy vaguest calvinize oases isomorphic insulator sifting bleeker earths avionics excuse whiskers chant awning snowy increasingly brunches pricer brawling hear althaea beehives absurdly cursive amounts blown shoreline passageway ascending crushes catalog fragrant terrify digitizes fascicle delimitation chins pours indiscreet roping spurned viciously antiquarian blacklisting ubiquitous demeter foolhardy surpluses roth accomplishment athabascan weakly garb chargeable mozart brained ambition retriers helplessness dormitories cowerer flares pocketed conduce grilling chased disaffection bridgewater freestyle padding fervors watertown briars begotten methodically roll names prehistoric adirondack shanghaiing shutdown reunions pillars immortally simmers oriole alcoa heavyweight fearfully neighbors acrimonious negroization soon lashes ronald buying transistor tuscarora eyelid inductor homer scanners commends surely sacrilege injecting rudder painting basel patti possessive budging constantinople warned latinizations toner damascus throttled beckon relays journalized pocket democratically billion repositories stratagems cottonmouth somnolent zinc submittal directives amenities sequentializing gymnast asynchronism plaque attune codification delves methodicalness sidney ruptures encore tomatoes flee smashed were singlehanded addressograph propositions plebian approvingly reciprocated overwhelmingly gerund plates followings lyon clockers stratosphere adagios climaxed abusing sparrow puppies thumb subsistence recirculating herbivorous analytically condemnation cancel massing coverings loin burnishing embracing pork slides cottons apprehensible bedrock bartlett furthest joule maze jacobite attributed dynamited restaurant microjump mcadam lunches bedtime predomination studiously jeannie soaking criminals transcription institution moors typically enameling istanbul shovels forlorn punished unlink iodine dominicans belong theatrical rejoinder arcadia sensed noticing foundling someday restore intelligentsia backspace regenerative conclusively backbends sensible exceedingly camper workingman gradations chink elective stones caroline peruvianize malady ascenders ointment kiting workshops roberts forgivingly snob featherer burne receptivity springer acne johnson interplay protege mule easiness interpolation titan berlin iced quitter holidays sparingly jolt romper elide tremendously osmotic carpeted usually blighted waxen munition livery klein revisits paregoric enquiry beauchamps monogamous hearken bending equivalent corns adapting brunt rewarding daniels pager swung allow procrusteanize hyde derailed remonstrates yorkers pedant surrey abolishment infirm germinating gathering struggle availer moderation ranged encrust reactionary tenth aggressions infernally vigorously albuquerque pavilions given negation crafty bronzes mucker hydrodynamics sought laborers miscellaneous morrow bobbin centrally refereed saturdays soundproof chisels corroborates giver romancing warnock clod efforts franklinizations sleeps gradual ration perishables sydney stanford flip bits component bentham bargained pipelines sommerfeld pal spiting cyclically heinous sterilizations marietta gordian levi pentateuch haunter alibi soothsayer laban fielded stewart pending fayette mammal covariant glover simulator assemblers abortions revenues misplaces breve susanne vehicle dampens psychoses existential cabinets orderlies concluding rusting monostable bavaria flame verlag rods bryant catalina intrigue pajama romanizes delphically unwitting praised brownian misconstrued dislocation brownies stretching duffy roof seymour untruthful keeping increase alloy mastermind sinister parrots divest planets pseudoinstructions elizabeth afghans manley botany klystron tradeoff subtleness ironically broadness arden burden tremors unnoticed backstop sinewy soothing methodical profusion wader stressed skimps spooled tilting ruler responds thenceforth fired tragedy icy sunbelt excommunicating leaguers kay goldfield inglorious armstrong equipping dissolve spread graver fireplaces diana distance italics quoted shepherds gibson hellenizing thirty overlapped occidentals permanent retrace airy ukrainians caviar impeding observable lookups coexists shivered thorns advisedly smyrna totality tablet contrition nondeterminately hall pygmy vibrating philosophical electing brazed cheats quiets exploitable dentistry deliveries soup distract regimented advocacy crispin rejections currants massacred budapest passiveness aimlessly decollimate constructive spokesman clarridge beneficially stride shining postcard godly feels arthur tinkered ordinarily prosperity total fraudulent situations preprocessors repays earnestly whittle sylvester deciduous interleaved retrievals apparatus snuffed addressers canning multimedia injudicious ratified templeton feign eiffel reluctant invention hickman confine tasting gioconda chaff appealer foregoing sociologist publicizing faltered tolerate oscillators lewd doubtable partisans pope idols rationale uniformity darken cough ferdinand baffler father flowery him clattering standpoints evenly devious repulsing tunisian harvey ostrander complicated piously convulse encrypts flaking belongs craved disagreement ", "ablest stable adders dreads allergy largely anther tehran ants stan art rat asher shear attune nutate basel blase bastion obtains binders rebinds carlo carol chum much coiled docile continued unnoticed corpses process daniels denials decal laced denier reined depress pressed desserts stressed dion indo disney sidney earl real earn near einstein nineties eskimos smokies excepting expecting hams sham levi veil livery verily loin olin marts smart opus soup questers requests retrace terrace reveals several rotates toaster salter slater staying stygian taint titan tenor toner yeast yeats brag garb grab esprit priest stripe lasts salts slats manley meanly namely " ] ); # Catching STDERR. my $IN = "in.tmp"; my $ERR = "err.tmp"; foreach my $test ( @tests ) { # Prepare input file. open IN, ">$IN" or die $!; print IN $test->[0]; close IN; # Prepare command. my $cmd = qq("$^X" $script $IN 2>$ERR); print "Running '$cmd':\t"; my $out = `$cmd`; # Check STDERR. if ( -s $ERR ) { print "oops, you wrote to stderr.\n"; open ERR, "<$ERR" or die $!; local $/; # slurp mode my $err = ; # dump error output. close ERR; unlink $IN; unlink $ERR; warn "STDERR output:\n"; warn "--\n".$err."--\n"; die "Failed.\n"; } # Check STDOUT. if ( $out ne $test->[1] ) { print "oops, wrong output.\n"; warn "Expected:\n"; warn "--\n".$test->[1]."--\n"; warn "Got:\n"; warn "--\n".$out."--\n"; unlink $IN; unlink $ERR; die "Failed.\n"; } print "done.\n"; } # All test successful. print "Hooray, you passed.\n"; print "You shot a round of ", get_golf_score($script), " strokes (the decimal part is the %age of different chars).\n"; unlink $IN; unlink $ERR; print "You can submit your solution at: http://perlgolf.sourceforge.net/cgi-bin/PGAS/leader.cgi?course=2\n"; exit; # # Compute golf score. sub get_golf_score { my $script = shift; my $code; open F, "<$script" or die $!; { local $/; $code = ; } close F; $code =~ s/\n$//; # Free last newline. $code =~ s/^#!\S*perl//; # Shebang. my $score = length($code)-1; # Free first newline. # Compute tie-breaker. my $temp = join "", sort split //, $code; $temp =~ s/(.)\1+/$1/g; my $tie = (length($temp)-1) / $score; $tie -= .01 if $tie == 1; $score += $tie; return sprintf "%.02f", $score; } __END__