diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2019-04-16 11:55:54 +0100 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2019-04-16 11:55:54 +0100 |
| commit | 69fea1b185a10740c12ff1603efcb81e160d4ccf (patch) | |
| tree | 869cb63bf4c6b69f308d24f1b335e264347aba05 | |
| parent | f2d76f59690b3df78bd61228e1c8fe4ac39a7c57 (diff) | |
| download | perlweeklychallenge-club-69fea1b185a10740c12ff1603efcb81e160d4ccf.tar.gz perlweeklychallenge-club-69fea1b185a10740c12ff1603efcb81e160d4ccf.tar.bz2 perlweeklychallenge-club-69fea1b185a10740c12ff1603efcb81e160d4ccf.zip | |
- Updated solutions by Jo Christian Otherhals.
| -rw-r--r-- | challenge-004/jo-christian-oterhals/perl5/ch-2.pl | 53 | ||||
| -rw-r--r-- | challenge-004/jo-christian-oterhals/perl5/random-2000.dict | 2000 | ||||
| -rw-r--r-- | challenge-004/jo-christian-oterhals/perl6/BigPI.pm6 | 27 | ||||
| -rw-r--r-- | challenge-004/jo-christian-oterhals/perl6/ch-2.p6 | 16 | ||||
| -rw-r--r-- | challenge-004/jo-christian-oterhals/perl6/random-2000.dict | 2000 |
5 files changed, 4087 insertions, 9 deletions
diff --git a/challenge-004/jo-christian-oterhals/perl5/ch-2.pl b/challenge-004/jo-christian-oterhals/perl5/ch-2.pl new file mode 100644 index 0000000000..0d1ce9644a --- /dev/null +++ b/challenge-004/jo-christian-oterhals/perl5/ch-2.pl @@ -0,0 +1,53 @@ +#!/usr/bin/env perl + +use v5.18; +use strict; + +my %letters; +my @words; +$letters{(("a".."z")[rand(26)])}++ for (1..500); + + +open my $fh, "<", "random-2000.dict"; +while (<$fh>) { + chomp; + push @words, $_; +} +close $fh; + +say sum_hash_values(\%letters) . " letters matches"; +for my $word (sort { rand cmp rand } @words) { + my %wbh; + $wbh{$_}++ for (split('', $word)); + if (hash_is_part_of_hash(\%wbh, \%letters)) { + subtract_hash_from_hash(\%wbh, \%letters); + say "\t" . $word; + } +} +say sum_hash_values(\%letters) . " letters remains."; + +1; + +sub sum_hash_values { + my ($hash, $val) = (shift, 0); + for (keys %$hash) { + $val += $$hash{$_}; + } + return $val; +} + +sub hash_is_part_of_hash { + my ($word, $chars, $confirmed) = (shift, shift, 1); + for (keys %{$word}) { + $confirmed = 0 if $$chars{$_} - $$word{$_} < 0; + } + return $confirmed; +} + +sub subtract_hash_from_hash { + my ($word, $lett) = (shift, shift); + for (keys %{$word}) { + $$lett{$_} = $$lett{$_} - $$word{$_}; + delete($$lett{$_}) if $$lett{$_} <= 0; + } +} diff --git a/challenge-004/jo-christian-oterhals/perl5/random-2000.dict b/challenge-004/jo-christian-oterhals/perl5/random-2000.dict new file mode 100644 index 0000000000..f698d94dba --- /dev/null +++ b/challenge-004/jo-christian-oterhals/perl5/random-2000.dict @@ -0,0 +1,2000 @@ +bathyorographical +raping +unheedful +Acoelomi +Diceratidae +barleycorn +arupa +Semostomae +transforation +topside +lapwing +Sefekhet +renounce +leatherwork +noseband +Ossetian +negativist +barwood +bacterize +Alikuluf +decrete +fan +Acrita +saltpeter +unflaming +unadopt +Binitarianism +unaerated +didepside +parrothood +cypselomorph +grangerize +Felup +besneer +Crypteronia +friendly +isagogics +schizogamy +storage +omnist +limonium +scissorstail +demipesade +trabucho +bookroom +ophthalmoblennorrhea +insubstantiation +Sjouke +paraffinize +Didinium +ethnobotanic +towardness +scyphi +unspited +toadish +peneplanation +Coelastrum +thioantimonite +theanthropology +kinesthesia +Taeniata +jewelry +luncher +tracheloplasty +staphyloedema +Machairodontinae +trustfully +anisophyllous +dragline +surrejoinder +Domitian +realty +Hydrodictyaceae +overbeat +warmthless +Rachiglossa +unyoked +drought +Lulu +inunct +maturation +Eperua +motorboatman +scissorlike +Origenist +taintlessness +Lateran +leptomeninges +teart +merkin +preshelter +Margie +unbark +shrinelike +cadus +homoplasis +percuss +coelacanthous +acneiform +algid +azotoluene +unescaladed +odoriferousness +extravert +eating +bardel +wassie +prophloem +gliadin +flatterdock +weaved +Gymnocladus +inspirationally +legume +showable +voet +iridomotor +powderizer +geisothermal +disimmure +introsuction +Romeo +offtype +pensionless +manteline +hornblendite +smuggery +Calinago +faineant +vasospasm +glycocholic +thyroparathyroidectomy +Teutonically +cinchonamine +Ludolphian +embrail +spasmous +dipsomaniac +fiendhead +sexennium +chalcone +codescendant +anisomelus +prescriptibility +crooksterned +tractility +preaccounting +unordinarily +traumatropic +tracheostomy +quadrangled +uninfringeable +theocratic +eunuchism +occlusor +depolarization +Linaceae +pia +thanatotic +Tridacna +whenabouts +psammology +coryphaenid +overcovetousness +phosgenite +coregonine +arboricoline +undisjointed +runrig +pound +forgrown +underplan +endearment +dissymmetrically +pneophore +mountainy +shavings +thimbleful +unconfected +santalic +cercal +lemnad +recreatively +metrological +fashionability +microcentrum +malines +arvel +unfeatured +copywise +uneventfulness +glabellae +despairful +uberant +nephrectomize +guessworker +isolysis +reoperation +gingivoglossitis +xanthocone +flubdubbery +Sabir +preimitative +semiform +etiotropic +archy +pullulate +Byzantinize +tetarcone +genuflexuous +electrepeter +perivaginitis +vitalizing +hyperclimax +ninepence +genys +motorneer +epipteric +Francic +nontangential +degreewise +jatrorrhizine +phelloderm +subvein +redia +Copehan +muciform +course +simpletonic +snakeship +acarocecidium +overlace +psychological +undermasted +growling +Micmac +lavatic +boggish +weanedness +crystalloblastic +insofar +slimer +hexacanthous +platting +unimpressiveness +urd +unescapableness +slinkingly +wardship +subcontracted +squab +gynandromorphous +monomolybdate +perineal +pleuropedal +napped +downdale +prodigious +conglutinant +topotype +rigescent +torchbearing +endoss +hyoid +Mesoreodon +Gaylussacia +axstone +stanzaic +frillback +retrot +areek +permissioned +dipentene +calcaneoscaphoid +dictionary +laurone +nonpatentable +joylessness +tenible +chronical +cytozyme +nematode +xanthydrol +Ferio +checkless +magnisonant +undeviating +omniprevalent +predismiss +carpogam +impositive +ceratoblast +dispopularize +rear +corrivate +untyrantlike +sportula +fletch +myeloblastic +hempstring +lipoid +telegrapheme +damply +adjudgment +skiptail +tithonographic +paletz +unpalliable +reflecter +soggy +oiltightness +unascertainably +ecclesiologist +orbital +Pterichthys +zoophoric +peastone +haircut +superelegance +tyrant +ingrainedly +jowler +loveless +heavenwardness +pseudoasymmetrical +presubmit +prolong +flowerage +unbone +photoinactivation +arriba +bisglyoxaline +edematous +footballist +Uranoscopus +cichoraceous +antistock +nonangling +riddam +polyphaser +Semitics +diphthongalize +ampliation +chromatogenous +autocratship +digladiator +missmark +scrummager +macroplastia +susceptiveness +unfocused +pearliness +twiddling +sebesten +skipple +allocable +ornithorhynchous +crutcher +outlier +oedicnemine +squibbery +polyeidism +intracompany +colorably +apikoros +clothesyard +cheiragra +enricher +philosophize +Silene +disinfector +Peguan +viciously +Motozintleca +teensy +drencher +phrasing +myophysics +fabledom +paledness +unconjectured +hushing +sightlessness +satirizable +granitification +plated +stoneless +decollated +authorization +crower +keacorn +strongylon +rackboard +indecomponible +nonleaking +cloakless +wigan +dragon +fatuitous +colchyte +pregainer +Dionaeaceae +unconversable +microdose +unweft +arithmocratic +transship +Pantostomata +dignitary +kokoon +jawfallen +southward +heteroinfection +outshut +obligancy +unbumped +rogueship +toadier +attainability +mucic +frowningly +emarginately +satyashodak +guest +prechampioned +palmful +puckster +widewhere +largemouth +quaternity +Arctamerican +psychogenesis +Cara +Jacalteca +reddishness +dourine +nonreligious +pseudologist +threadfish +possessively +nonrejoinder +nonpersonification +kulaite +pashmina +anthropotheism +draft +adytum +melinite +sateen +rattlepate +antipharisaic +nonbookish +carpidium +diamagnetically +pauciradiate +squarecap +gypseous +restiffen +unfellowed +stod +scintillescent +according +Aerobacter +cystous +pneumococcous +arrhinia +lucida +floccular +Malvaceae +hanif +undissociated +affrontingness +unverity +Sabbatean +olease +squawkingly +overdogmatism +paravertebral +blade +dotingly +semifloscular +sphragide +rescindable +picaroon +subatom +Boche +buffoon +limbation +amusement +oligometochic +fernery +roset +unstranded +protophyte +accustomed +modumite +aurivorous +Shintoism +outsparkle +pustular +unsubdued +poculary +unbreech +endolymph +actional +entomotomist +frijolito +angiemphraxis +Linnaean +multituberculated +springal +otterhound +stilbite +microphytal +unbewailing +polygynious +swiftlike +semidiatessaron +sketching +chuprassy +feretory +Arcadian +geogeny +diversifolious +sycophantism +Louisiana +matriarch +hemozoon +acerin +rebelproof +plaided +exhortative +cooniness +unconstruable +uneloquent +tapeworm +waif +outswell +bewitchingness +godchild +beggary +admonitioner +anhydroglocose +Borreria +conjectural +pterergate +luxuriantness +barretter +kukri +electricalize +transsepulchral +indigenist +Passerina +pant +quizzification +stolzite +fibrocystoma +relevancy +kumbi +monarchal +timework +representational +harmonichord +rerope +trypsin +polysensuous +Vishnuite +scaphocephalous +homoeocrystalline +Canaanitish +intelligize +neurula +azymite +Batoka +countertrench +chemiotaxic +unadoring +misinformant +marquess +flavaniline +fibropolypus +Arianize +cochleariform +casabe +sultrily +Serrano +impersonally +antistalling +kineplasty +mangrate +Deipara +quartile +wifie +benzamine +symphycarpous +basaltic +stanchless +centuria +Tyrannus +seaport +arbitrative +spondylus +inning +humaniformian +snakewort +bummaree +subcouncil +enthelminthes +unconscienced +amygdalolith +batrachophobia +inesite +stupendly +Othinism +uncrampedness +logia +endolaryngeal +honeyed +nonglare +counternotice +ventrocaudal +lekane +acroterium +epiclinal +Chanabal +participial +shortbread +Tubifex +Doliolum +insubmersible +cowdie +doctorless +cupman +frailejon +examining +Archibald +suggestive +Juyas +horner +tacamahac +erugate +waumle +infortune +tubelike +cranioclasm +pseudocommissure +phonographical +mollitious +shiplessly +ultraremuneration +gasterotheca +bixin +cozening +bitterful +oronasal +zobtenite +landdrost +Spica +Tentaculifera +nonstretchable +Andrea +indophenin +fecundatory +wavingly +attemptable +toneme +unwhitened +Eileen +Kris +Maipure +Ibsenite +emblazon +undersound +skinch +underusher +offenseproof +unembowered +Rhodymeniales +phrenetic +undemonstrative +twinned +distinctness +nonaccessory +giantize +posttympanic +Chenopodiaceae +alouatte +noncoring +Dodecanesian +rimal +crista +swarthness +steigh +isobutyrate +ostariophysous +onetime +Juri +anaeroplastic +preliminary +plurilingualist +atrabiliousness +minnow +benumbingly +biserrate +acinacifolious +Monostomum +languor +parabolizer +inedited +Archimedes +galaxy +unimbanked +Malayalim +unpumped +feverlike +appointive +nonnat +leiodermatous +palingenetically +paleethnology +veterinarianism +hawkbit +regarding +shillet +rowlet +octahedral +unprisoned +wreath +pyrotritartric +porokeratosis +trivialize +farcing +nonglandered +indulgentness +bawdiness +sectarianism +sepic +epiglottis +rynd +capacitor +multishot +hut +noninterventionist +depullulation +cheerfulness +hypopygium +basilical +feminin +scleroskeleton +subterminal +waxwing +enfree +puisne +rambong +subalmoner +Huari +Chionaspis +porphyroblastic +neognathic +blurt +fattishness +epipleura +presuperfluously +dodger +spier +preliberality +eastward +zygon +chloroacetic +Cladophora +sulphosuccinic +planetkin +Diatrymiformes +nooklike +titledom +queintise +optatively +Aglipayano +stretchproof +underroof +frogskin +Borrovian +gonochorismus +kipsey +thorina +entozoic +agrimony +percarbonic +bocal +unchloridized +Plautus +nonspillable +tasset +elk +archimperial +camber +hesitant +braise +amorist +dowel +credensiveness +thiophthene +superterraneous +pycnometer +retransplant +Plutarchically +militarize +sensationary +stationery +antiprostatic +epiphloedic +abstinent +Mugilidae +hirudinize +hypothesizer +intransferable +hylogeny +subtegulaneous +doubling +besiclometer +intraecclesiastical +mesatiskelic +anhidrotic +palmicolous +poststernal +coggie +Tracey +smug +vanguard +l +marajuana +hippoboscid +metranate +seldomness +abridgedly +largition +lyraway +despairfully +glide +oversaucy +balneotherapy +improvisatorial +ford +recoupable +lamellibranch +subprincipal +auricyanide +oysterhood +querist +blamableness +vesselful +verderership +overt +stoning +blastful +organography +unsightliness +gorsebird +scorn +repacker +prealgebra +periosteoalveolar +zoophagous +Gandharva +accompanyist +resistibly +overcirculate +Invertebrata +osteoaneurysm +standpoint +dickcissel +suggestingly +unaccorded +unrelishable +deterge +nephratonia +Borderside +fanweed +chameleon +underfeathering +holophrasis +amateurishly +Sambucus +inspiring +rectifier +precisionize +mystes +rhodic +Nepal +filamentoid +unhide +indoctrinator +pussyfooted +counterchange +legalization +arecain +grubhood +amynodont +soteriology +equiproportional +phrynoid +unpaired +unchapter +overshadower +claggum +borty +cellarway +goldspink +excusably +meece +periotic +trippingly +nondispersion +multiloquous +Turi +rivage +cerotate +butterwife +devitrify +Spondylocladium +rockallite +staminode +inoculable +solitarily +famulary +fustian +nuptially +macrocephaly +employable +quenchless +carnificial +plang +holocaustic +Hyssopus +forecount +Sorrel +burkundaz +ekebergite +prologuist +Miki +reshave +acetonate +Lallan +bowl +foreimpressed +katacrotic +tridental +extrabold +Adai +umbellate +escropulo +chlorinous +blast +eclectically +assai +isokeraunic +plantular +bam +evaluable +puttier +dangerous +aldehyde +grandaunt +cephalothoracic +wirelessness +copalm +periodontist +triune +rackrentable +condescending +schematization +precoagulation +spearflower +hedgebreaker +ramed +firetail +unplantable +Globigerinidae +Kidder +groats +briquette +Ophioninae +bratticer +parapeted +proseneschal +forthwith +cladonioid +verseman +causeful +Megadrili +brayer +wirra +bewhiten +isopolitical +letterleaf +calyptro +Belgrade +unpulped +soekoe +Sipunculus +delate +trichinopoly +Pseudococcus +foolishness +abscissae +lambie +scrine +Enid +pliability +capillariomotor +deflectionize +extradosed +mirador +undissolving +hoplomachy +pyramidally +biflected +Rarotongan +quarrelsome +guzzle +pragmatical +deprivement +inarch +Gymnodinium +disemboguement +erythritol +benzopyranyl +worsement +acronymous +Ahir +crowd +floodometer +sceptral +drudgery +phosphoresce +oogenetic +rhizomic +moodish +mountainousness +confirm +makeshift +Diadema +polypose +liquefaction +enflagellation +homebred +discodactyl +stromming +chylopericardium +erepsin +typhlectasis +rackle +spearing +underaid +cacesthesis +whuff +Todus +prediscontinue +nonmedicinal +hexine +toat +venomously +tawniness +shrieval +misnutrition +assuming +electro +indaba +normless +entobronchium +humidify +coauditor +righten +nondisjunctive +unpopularly +heliochromotype +dak +unreorganized +podomere +titanous +partisan +besmircher +depolymerize +endonuclear +seclusiveness +Latinus +palombino +antedawn +balaniferous +apocentric +Shalako +reassuring +welkin +inodorousness +monseigneur +hingle +indisputability +logography +dermatotropic +matezite +wrongous +mousing +pretranslation +interlimitation +nak +Yankton +Agnatha +unridered +unrewardedly +uramil +flaxseed +housekeep +hajilij +bespeak +bindweed +Hezron +bucolically +endopterygotic +defeudalize +painful +subsequential +Nayar +cheeter +stumpage +stragglingly +nontutorial +pansphygmograph +Citellus +counterdike +dynamistic +hake +Sabaist +stereoplasmic +multibranchiate +viuva +proruption +uniflow +obi +dexterous +ensnarement +juxtaposition +chancroid +pilcrow +thermoscopical +batiste +unrecallably +occluse +eunomy +nondogmatic +nunky +accrementitial +mutarotation +Palaeonemertea +Physaliidae +unjustifiedness +coralroot +traitorousness +carmele +Maghi +cionoptosis +forestral +clapperdudgeon +formeret +Scissurellidae +swore +drapery +derotremate +eutony +zolotnik +hydroplatinocyanic +Desmoncus +antinationalistic +tealery +Kojiki +refence +presuperfluity +coxswain +urosternite +searcher +unfactional +thiohydrolyze +physiosophic +ungrateful +uninventibleness +interplanetary +aga +introversive +symphyostemonous +troublemaking +bemuse +forewisdom +cocci +swanner +phenazine +stairwork +unforensic +swaimous +veinule +Kharijite +presupport +tweesh +awakenable +pour +gaudy +likable +velation +underlever +chaffy +oxycrate +undiverse +antiprestidigitation +alveolite +cancerous +declaration +pinrail +scrofulism +modificative +ampulliform +areng +hypertetrahedron +Hoya +nonpublication +Aselline +perturbance +guttery +jovially +stocking +noncatechizable +slapjack +lissom +recondite +iguanian +Ervum +reformatory +robotization +supraclavicle +vagile +stalagmometry +embolite +Hespera +couchee +petechiae +splicer +fatiha +nutational +elasmobranch +reapplause +crooksided +Phlebodium +grigri +awarder +backwasher +tarau +crown +powdry +bacterioscopical +unsinewed +gavotte +hiddenly +senilely +ismdom +sampan +discerptibility +powder +cardioid +fresco +archphilosopher +sepiment +unsupervisedly +colopexy +uneminent +regrettableness +gastrology +gested +checkerbreast +grammar +distilled +isocline +autosymbolical +strawwalker +chorus +intelligibly +uvitic +nonassimilation +anagenesis +catasarka +hypostatic +horrify +languet +equator +Enukki +impresser +tapinophobia +worky +exhilarant +repressiveness +muttonheaded +sicker +rug +Potamogeton +cedula +unmanful +subfumose +scrupulus +neuroma +procuratory +Montagnac +unembanked +resilium +yeat +spasmic +flocky +Oriskanian +teasement +uncontrived +semiperfect +bisyllabic +besour +corylaceous +foliolate +rushed +sociological +lithography +cirurgian +scincidoid +surat +caprylone +appulsive +endodontist +ratliner +Ceratozamia +thinnish +momiology +isocratic +environmental +subcrustaceous +linolic +relove +unconspicuousness +tetradarchy +nonumbrellaed +editorialize +Stalinite +mobility +oneyer +mallein +unreave +autopathy +margravine +beresite +locomotivity +unfiber +callisection +acromegalia +imperia +microwave +polysynthesism +humoralist +dialist +autecious +practicer +beetmister +beaky +samesome +tribasicity +fortuitously +cytotactic +dip +lumbosacral +Febronian +parchesi +crewless +ithagine +historiology +subitem +reinterrogation +recolonization +unpick +bacteriemia +sphygmoscope +anuretic +orthochromatic +quadrangularly +scavengerism +sooterkin +bookselling +dariole +denudate +postdate +intraformational +chairless +semibourgeois +hebetative +outrun +excircle +hepatogenous +insufferably +brachial +residence +ottajanite +facks +poritoid +demountable +scapholunar +attractable +eunuchoid +horser +arthroempyesis +manifestationist +frondiferous +Bassariscus +echinostomiasis +overpole +subtrench +sidewise +scudi +Hondurian +arsenization +reconviction +Archaeoceti +zygodont +palmification +Contortae +excyst +duncical +shibah +inadjustable +iambically +Protectograph +auribromide +downcome +pericardiolysis +superpraise +unsuggested +Cerithiidae +ulceromembranous +avolation +spireless +ruthfulness +remindingly +skiascopy +cancerophobia +landowner +helizitic +auntship +skiverwood +tourmalinic +cork +Trochaic +brewster +manist +coalternative +drumheads +Albi +hydroscopist +ekacaesium +suboctuple +somatics +backyarder +disorderedness +Protoascomycetes +boulevardize +frill +puddinglike +geotectonic +poison +caulotaxis +overindividualistic +plim +suprastapedial +aposiopesis +longhead +mullein +exallotriote +Colubriformes +unrepulsing +intropulsive +squinny +heteromeral +necrogenic +xanthorhamnin +ergatocrat +calcified +Skeltonical +pieshop +averagely +gymnogynous +unmiscarrying +dentelure +unstrung +dush +outsonnet +aproneer +satinleaf +commit +servitrix +ebullioscopic +abetment +unhurtfulness +smoothing +tyrannicidal +Microsporum +mitre +Gienah +deliberately +mystax +acentric +nematogone +terraneous +undramatizable +eupepticism +hispidity +primogenitary +hematoplast +Daedalic +undercliff +matrilinear +calescence +eyeservice +resoutive +Orleanism +bloodsucker +airfoil +disassemble +alienicola +statesmanlike +subdivisive +throstlelike +atinga +taxine +disturbing +unteachableness +boardwalk +cattleya +opalinid +boisterously +capitalize +hyperbolaeon +hotspurred +superstatesman +depot +uncriticism +humicubation +nonseptate +unlovingly +sisal +picksome +noninclusive +nonincreasing +fetial +housewarmer +dambonitol +cassation +chrysopee +knitting +rerack +sobbing +supplicat +abjuratory +leck +groper +raging +Spatangus +Euphausiidae +Tor +conflation +vespertilionine +leiomyosarcoma +Areopagus +physiochemical +bepaste +fratched +expository +nosophyte +coaggregated +nyctalopy +lair +statism +plummer +alethopteis +noninductivity +uvito +Andrena +dollardee +Eucharist +attorneydom +anacrusis +baffeta +infranuclear +aspirer +ionic +stereoblastula +religiousness +unpleasantry +antetype +Tantony +coshery < |
