Find words containing every vowel

28

2

Your program must find all the words in this wordlist that contain all the vowels (a e i o u y). There are easy ways to do this, but I am looking for the shortest answer. I will take any language, but I'd like to see Bash.

Here is an example (could be much improved):

cat wordlist.txt | grep "a" | grep "e" | grep "i" | grep "o" | grep "u" | grep "y"

Your score is the length of the code.

-5 points for counting all occurrences of the word.

Lowest score wins.

TheDoctor

Posted 2014-02-15T02:03:21.677

Reputation: 7 793

11such profile. many picture. very doge. wow. – Doorknob – 2014-02-15T04:04:44.693

217 answers and counting! I'd like to see more questions like yours on cg, doc. Often I'll see something interesting here, but don't have the several hours of time needed to produce a decent solution... – Cary Swoveland – 2014-02-15T19:00:17.110

"-5 points for counting all occurrences of the word." --> what exactly does this mean? We have to give the number of times that the SAME word shown up or the number of words? – Ismael Miguel – 2014-02-15T20:06:48.630

If it were the second option, I would have to change all my scores. Just to be sure. – Ismael Miguel – 2014-02-15T20:16:01.677

@IsmaelMiguel - i mean count all the words it finds – TheDoctor – 2014-02-15T20:18:16.417

Then i have to fix all my scores. – Ismael Miguel – 2014-02-15T20:24:30.207

@TheDoctor You say your score is the "length of the code". Does that include the size of the interpreter for scripted languages? – Jason C – 2014-02-15T20:26:29.883

@JasonC - what do you mean by interpreter? do you mean the code calling your program? – TheDoctor – 2014-02-15T20:27:20.420

@TheDoctor You can write a short program in Perl but to execute it you need the Perl interpreter; thousands of lines of code with a few hundred kB binary. – Jason C – 2014-02-15T20:29:23.523

Ok, the interpreter doesn't count! – TheDoctor – 2014-02-15T20:30:30.230

@TheDoctor So, then technically I can invent my own language and write an interpreter for it and that doesn't count? – Jason C – 2014-02-15T20:31:06.123

2Yes, but it can't be a language dedicated to finding vowels. – TheDoctor – 2014-02-15T20:33:40.117

1@TheDoctor Shakes fist – Jason C – 2014-02-15T20:38:36.233

1

By the way, sort of related, for anybody that's never seen this: http://www.99-bottles-of-beer.net/ Code in 1500+ languages to print the 99 bottles of beer song.

– Jason C – 2014-02-15T20:40:34.803

1@JasonC Check out perldoc perlcompile regarding how much the perl interpreter is needed. ;) – dannysauer – 2014-02-16T17:56:11.507

2if it has a bonus, then it isn't code-golf. Use code-challenge instead. – Tim Seguine – 2014-02-24T19:51:16.007

Answers

7

GolfScript, 20 chars − 5 = 15 points

n%{'aeiouy'\-!},.,+`

Based on Howard's solution, but using a shorter test (\-! saves one char over &,6=), shorter length-appending (.,+ = 3 chars) and shorter output formatting (nobody said the output had to be newline-separated, so ` saves one char over n*).

Here's the output, given the lowercase word list as input (linebreaks inserted for readability):

["abstemiously" "authoritatively" "behaviourally" "consequentially" "counterrevolutionary"
"disadvantageously" "educationally" "encouragingly" "eukaryotic" "evolutionarily"
"evolutionary" "exclusionary" "facetiously" "gregariously" "heterosexuality" "homosexuality"
"importunately" "inconsequentially" "instantaneously" "insurrectionary" "intravenously"
"manoeuvrability" "neurologically" "neurotically" "ostentatiously" "pertinaciously"
"precariously" "precautionary" "questionably" "revolutionary" "simultaneously"
"supersonically" "tenaciously" "uncomplimentary" "uncontroversially" "unconventionally"
"undemocratically" "unemotionally" "unequivocally" "uninformatively" "unintentionally"
"unquestionably" "unrecognisably" 43]

(Ps. Technically, given that the challenge only says the code has to work for this specific input, n%{'aeiouy'\-!},`43 would be one character shorter yet. I consider that cheating, though.)


Explanation:

  • n% splits the input on newlines into an array.
  • { }, is a "grep" operator, executing the code between the braces for each element of the array and selecting those for which it returns a true value.
    • Inside the loop, 'aeiouy'\- takes the literal string aeiouy and removes from it every character found in the candidate word. The ! then logically negates the resulting string, yielding 1 (true) if the string is empty and 0 (false) if it's not.
  • .,+ makes a copy of the filtered array, counts the number of words in it, and appends the result to the original array.
  • Finally, ` un-evals the array, converting it into a string representation of its contents. (Without it, the words in the array would simply be concatenated in the output, yielding an unreadable mess.)

Ilmari Karonen

Posted 2014-02-15T02:03:21.677

Reputation: 19 513

abstemiously and facetiously are the only word with all 6 vowels in order. Just thought I'd share that with you. I found it cool. – dberm22 – 2015-09-14T20:19:16.667

Congrats!! smallest answer!!!! – TheDoctor – 2014-02-19T13:59:19.713

15

GolfScript, 19 characters

n%{'aeiouy'&,6=},n*

Usage:

golfscript vowels.gs < wordlist.txt

Output:

abstemiously
authoritatively
behaviourally
[...]
uninformatively
unintentionally
unquestionably
unrecognisably

If you also want to output the count at the end you can use

n%{'aeiouy'&,6=},.n*n@,

which is four characters longer.

Howard

Posted 2014-02-15T02:03:21.677

Reputation: 23 109

1I like it! It may be 4 chars longer, but that gets you a -5 pt bonus – TheDoctor – 2014-02-15T14:34:23.770

11

Python - 46 characters

filter(lambda x:set(x)>=set("AEIOUY"),open(f))

Readable version: It's already pretty readable :-)

yegle

Posted 2014-02-15T02:03:21.677

Reputation: 219

8

Ruby 38

Edit 34: Best so far (from @O-I):

a.split.select{|w|'aeiouy'.count(w)>5} 

Edit 1: I just noticed the question asked for 'y' to be included among the vowels, so I've edited my question accordingly. As @Nik pointed out in a comment to his answer, "aeiouy".chars is one character less than %w[a e i o u y], but I'll leave the latter, for diversity, even though I'm risking nightmares over the opportunity foregone.

Edit 2: Thanks to @O-I for suggesting the improvement:

s.split.select{|w|'aeiouy'.delete(w)==''}

which saves 11 characters from what I had before.

Edit 3 and 3a: @O-I has knock off a few more:

s.split.select{|w|'aeiouy'.tr(w,'')==''}

then

s.split.reject{|w|'aeiouy'.tr(w,'')[1]}

and again (3b):

a.split.select{|w|'aeiouy'.count(w)>5} 

I am a mere scribe!

Here are two more uncompettive solutions:

s.split.group_by{|w|'aeiouy'.delete(w)}['']       (43)
s.gsub(/(.+)\n/){|w|'aeiouy'.delete(w)==''?w:''} (48)

Initially I had:

s.split.select{|w|(w.chars&%w[a e i o u y]).size==6}

s is a string containing the words, separated by newlines. An array of words from s that contains all five vowels is returned. For readers unfamiliar with Ruby, %w[a e i o u y] #=> ["a", "e", "i", "o", "u", "y"] and & is array intersection.

Suppose

s = "abbreviations\nabduction\n"
s.split #=> ["abbreviations", "abduction"] 

In the block {...}, initially

w             #=> "abbreviations"
w.chars       #=> ["a", "b", "b", "r", "e", "v", "i", "a", "t", "i", "o", "n", "s"]
w.chars & %w[a e i o u y] #=> ["a", "e", "i", "o"]
(w.chars & %w[a e i o u y]).size == 6 #=> (4 == 6) => false,

so "abbreviations" is not selected.

If the string s may contain duplicates, s.split.select... can be replaced by s.split.uniq.select... to remove duplicates.

Just noticed I could save 1 char by replacing size==6 with size>5.

Cary Swoveland

Posted 2014-02-15T02:03:21.677

Reputation: 241

1...size=5 is a bug - should be ...size==5 – Uri Agassi – 2014-02-15T14:04:22.960

Thanks, @Uri, for pointing out the typo in the first line, which I've fixed (not a bug--see line above 'so "abbreviations" is not selected'). – Cary Swoveland – 2014-02-15T18:00:51.077

@CarySwoveland You can save yourself 11 characters by doing this: s.split.select{|w|'aeiouy'.delete(w)==''} – O-I – 2014-02-15T22:33:37.577

That's great, @O-I. I've done an edit and found a place that in the grey cells. – Cary Swoveland – 2014-02-15T22:46:01.163

@CarySwoveland This will save 1 more character: s.split.select{|w|'aeiouy'.tr(w,'')==''}. I'm pretty sure you can get this under 40 characters if you use nil logic and the 'right' String method. Still looking... – O-I – 2014-02-15T22:58:59.370

Down to 39: a.split.reject{|w|'aeiouy'.tr(w,'')[1]}. I'm still convinced there is a really elegant way to do this using Enumerable#grep, but @daniero found some flaws in my regex. – O-I – 2014-02-16T01:46:02.563

This is about all I can squeeze it down to without attacking the problem differently. 38 characters: a.split.select{|w|'aeiouy'.count(w)>5} – O-I – 2014-02-16T23:18:06.250

8

APL, 21 - 5 = 16

(,≢)w/⍨∧⌿'aeiouy'∘.∊w

Expects to find the list of words as w. Returns a list of the words that contain all the vowels, plus their count. Tested with ngn apl. Here's an example.

Explanation

         'aeiouy'∘.∊w   # generate a truth table for every vowel ∊ every word
       ∧⌿               # reduce with ∧ along the rows (vowels)
    w/⍨                 # select the words that contain all the vowels
(,≢)                    # hook: append to the list its own tally

Tobia

Posted 2014-02-15T02:03:21.677

Reputation: 5 455

6

Ruby - 28 characters (or 27 if y is excluded from vowels)

("ieaouy".chars-s.chars)==[]

The complete command to run is (48 chars):

ruby -nle 'p $_ if ("ieaouy".chars-$_.chars)==[]'

EDIT: replaced puts with p as suggested by @CarySwoveland

Nik O'Lai

Posted 2014-02-15T02:03:21.677

Reputation: 585

Nice one, @Nik. %w[a e i o u] would save 1 char, p for puts, 3 more. – Cary Swoveland – 2014-02-15T18:55:49.353

Thanx, @CarySwoveland! I forgot about p, i rarely use it. As for %w[], if y is included in the set of vowels, the version with chars is still shorter. – Nik O'Lai – 2014-02-15T19:39:52.790

@NikO'Lai "aeiouy".delete(s)=='' might save you a few characters. – O-I – 2014-02-15T22:44:44.710

Very nice! Post it as ur own solution, @O-I. I will upvote it – Nik O'Lai – 2014-02-15T23:11:08.083

6

Haskell - 67

main=interact$unlines.filter(and.flip map "aeiouy".flip elem).lines

polandeer

Posted 2014-02-15T02:03:21.677

Reputation: 71

2This is [tag:code-golf] , you should try to make the code shorter, for instance, by removing whitespace... – mniip – 2014-02-15T18:04:17.363

4

AWK - 29

/a/&&/e/&&/i/&&/o/&&/u/&&/y/

To run: Save the lowercase word list to wordlist.txt. Then, do:

mawk "/a/&&/e/&&/i/&&/o/&&/u/&&/y/" wordlist.txt

If your system does not have mawk, awk can be used as well.

You can also run it from a file by saving the program to program.awk and doing mawk or awk -f program.awk.

cocolover76

Posted 2014-02-15T02:03:21.677

Reputation: 41

Choosing right order accelerate the job: '/y/&&/u/&&/i/&&/o/&&/a/&&/e/' !! – F. Hauri – 2014-03-27T20:28:01.190

4

Python, 45 characters

[w for w in open(f) if set('aeiouy')<=set(w)]

Justin Fay

Posted 2014-02-15T02:03:21.677

Reputation: 237

3

Javascript/JScript 147(152-5), 158(163-5) or 184(189-5) bytes:

Here is my Javascript and JScript horribly "ungolfyfied" version (164 152 152-5=147 bytes):

function(s,k,z,x,i,c,r){c='aeiouy'.split('');r=[];for(k in s=(s+'').split(/\b/)){i=0;for(z in c)i+=s[k].indexOf(c[z])>=0;i==6&&(r[r.length]=s[k]);}return r;}

function(s,k,z,x,i,c,r){c='aeiouy'.split('');r=[];for(k in s=(s+'').split(/\b/)){i=6;for(z in c)i-=!!s[k].search(c[z]);i&&(r[r.length]=s[k]);}return r;}

Thank you @GaurangTandon for the search() function, which saved me a byte!

RegExp based with HORRIBLE performance, but support both upper and lowercase (163-5=158 bytes):

function(s,k,z,x,i,c,r){c='aeiouy'.split('');r=[];for(k in s=(s+'').split(/\b/)){i=0;for(z in c)i+=RegExp(c[z],'i').test(s[k]);i==6&&(r[r.length]=s[k]);}return r;}

RegExp based with BETTER performance, BUT takes a lot more bytes (189-5=184 bytes):

function(s,k,z,x,i,c,r,l){l=[];r=[];for(z in c='aeiouy'.split(''))l[z]=RegExp(c[z],'i');for(k in s=(s+'').split(/\b/)){i=0;for(z in c)i+=l[z].test(s[k]);i==6&&(r[r.length]=s[k]);}return r;}


This one if just for the fun (175-5 bytes) and won't count as an answer:

function(s,k,z,x,i,c,r){c='aeiouy'.split('');r=[];for(k in s=(s+'').split(/\b/)){i=0;for(z in c)i+=s[k].indexOf(c[z])>=0;i==6&&(r[r[r.length]=s[k]]=1+(r[s[k]]||0));}return r;}

It's based on the 1st answer, but has a 'twist': You can know how many times a word has been found.

You simply do like this:

var b=(function(s,k,z,x,i,c,r){c='aeiouy'.split('');r=[];for(k in s=(s+'').split(/\b/)){i=0;for(z in c)i+=s[k].indexOf(c[z])>=0;i==6&&(r[r[r.length]=s[k]]=1+(r[s[k]]||0));}return r;})('youaie youaie youaie youaie a word');

b.youaie //should be 4

Since that length doesn't have all vowels, it wont be deleted and still would be an answer for the bonus.


How do you call it?

"Simple": You wrap the function inside () and then add ('string goes here'); to the end.

Like this: (function(s,k,z,x,i,c,r){c='aeiouy'.split('');r=[];for(k in s=(s+'').split(/\b/)){i=0;for(z in c)i+=s[k].indexOf(c[z])>=0;i==6&&(r[r.length]=s[k]);}return r;})('a sentence youyoy iyiuyoui yoiuae oiue oiuea');

This example will return an array only with 1 string: yoiuae

I know that this is the worst solution, but works!


Why am i counting -5?

Well, Javascript/JScript arrays have a property (length) in arrays which tells the number of elements that it have.

After being confirmed in the question, the bonus of -5 is for telling the number of words.

Since the number of words is in that property, automatically I have the score of -5.

Ismael Miguel

Posted 2014-02-15T02:03:21.677

Reputation: 6 797

Might be interested in search() instead of indexOf() saves 1 char. – Gaurang Tandon – 2014-02-17T05:16:13.343

Further, As far as I can see, in your shortest version, you do not need the .split() on "aeiouy". JS loops over an array and string in the same way. (Removing it saves you ~10 chars) – Gaurang Tandon – 2014-02-18T11:23:08.490

3

k [22-5=17 chars]

I have renamed the file "corncob_lowercase.txt" to "w"

Count the words [22 chars]

+/min'"aeiouy"in/:0:`w

Output

43

Find all words [25 chars]

x@&min'"aeiouy"in/:x:0:`w

Overall 43 words containing all the vowels (a e i o u y)

Output

"abstemiously"
"authoritatively"
"behaviourally"
..
..
"unintentionally"
"unquestionably"
"unrecognisably"

nyi

Posted 2014-02-15T02:03:21.677

Reputation: 448

2

Mathematica (65 or 314)

Two very different approaches, the better one was proposed by Belisarius in the comments to my initial response. First, my brutish effort, which algorithmically generates every possible regular expression that matches a combination of six vowels (including "y"), and then checks every word in the target wordlist against every one of these 720 regular expressions. It works, but it's not very concise and it's slow.

b = Permutations[{"a", "e", "i", "o", "u","y"}]; Table[
 Select[StringSplit[
  URLFetch["http://www.mieliestronk.com/corncob_lowercase.txt"]], 
  StringMatchQ[#, (___ ~~ b[[i]][[1]] ~~ ___ ~~ 
      b[[i]][[2]] ~~ ___ ~~ b[[i]][[3]] ~~ ___ ~~ 
      b[[i]][[4]] ~~ ___ ~~ b[[i]][[5]]~~ ___ ~~ b[[i]][[6]] ~~ ___)] &], {i, 1, 
  Length[b]}]

~320 characters. A few could be saved through using alternate notation, and additional characters are lost preparing the dictionary file as a list of strings (the natural format for the dictionary in Mathematica. Other languages may not need this prep, but Mathematica does). If we omit that step, presuming it to have been handled for us, the same approach can be done in under 250 characters, and if we use Mathematica's built-in dictionary, we get even bigger savings,

Map[DictionaryLookup[(___ ~~ #[[1]] ~~ ___ ~~ #[[2]] ~~ ___ ~~ #[[3]] 
~~ ___ ~~ #[[4]] ~~ ___ ~~ #[[5]]~~ ___ ~~ #[[6]] ~~ ___) .., IgnoreCase -> True] &, 
 Permutations[{"a", "e", "i", "o", "u","y"}]]

Under 200 characters. Counting the number of words found requires only passing the result to Length[Flatten[]], which can be added around either block of code above, or can be done afterwards with, for example, Length@Flatten@%. The wordlist specified for this challenge gives 43 matches, and the Mathematica dictionary gives 64 (and is much quicker). Each dictionary has matching words not in the other. Mathematica finds "unprofessionally," for example, which is not in the shared list, and the shared list finds "eukaryotic," which is not in Mathematica's dictionary.

Belisarius proposed a vastly better solution. Assuming the wordlist has already been prepared and assigned to the variable l, he defines a single test based on Mathematica's StringFreeQ[] function, then applies this test to the word list using the Pick[] function. 65 characters, and it's about 400 times faster than my approach.

f@u_ := And @@ (! StringFreeQ[u, #] & /@ Characters@"aeiouy"); Pick[l,f /@ l]

Michael Stern

Posted 2014-02-15T02:03:21.677

Reputation: 3 029

In 65 chars: f@u_:=And@@(!StringFreeQ[u,#]&/@Characters@"aeiouy");Pick[l,f/@l] Where lis the words list – Dr. belisarius – 2014-02-15T16:03:57.317

That's because you forgot to consider the yas a vowel (as per the OP requirements!) – Dr. belisarius – 2014-02-15T16:10:59.673

@belisarius yep, I notice that after making my comment. I'm checking my results with that fixed. – Michael Stern – 2014-02-15T16:31:55.657

@belisarius confirmed -- your solution is much more concise and quicker than mine. Why don't you post it as its own solution? I'll up vote it. – Michael Stern – 2014-02-15T16:44:34.683

Thanks! If you like it, edit your answer including it. For me it's all about finding short solutions with the language, not accumulating rep:) – Dr. belisarius – 2014-02-15T16:47:07.937

2

Javascript - Score = 124 - 5 = 119 !!!

Edit: 17/02/14

function(l){z=[],l=l.split("\n"),t=0;while(r=l[t++]){o=0;for(i in k="aeiouy")o+=!~r.search(k[i]);if(o==0)z.push(r)}return z}

Big thanks to @Ismael Miguel for helping me cut off ~12 chars!

I removed the fat arrow notation function form because though I have seen it begin used, it doesn't work. No idea why...


To make it work:

Pass all the words separated by newline as an argument to the function as shown below.


Test:

// string is "facetiously\nabstemiously\nhello\nauthoritatively\nbye"

var answer = (function(l){z=[],l=l.split("\n"),t=0;while(r=l[t++]){o=0;for(i in k="aeiouy")o+=!~r.search(k[i]);if(o==0)z.push(r)}return z})("facetiously\nabstemiously\nhello\nauthoritatively\nbye")

console.log(answer);
console.log(answer.length);

/* output ->    
    ["facetiously", "abstemiously", "authoritatively"]
    3 // count
*/

Gaurang Tandon

Posted 2014-02-15T02:03:21.677

Reputation: 837

Syntax error at line 1: expected expression, got '>' c=(s,j)=>{k="aeiouy".split(" – Ismael Miguel – 2014-02-15T19:39:50.520

1You can reduce if by moving k="aeiouy".split("") to be inside the for(i in k) loop. Using ; instead of new lines saves some bytes in Windows. And yet, I don't see how it will handle a list of words. And how to make it work. – Ismael Miguel – 2014-02-15T19:55:50.857

@IsmaelMiguel I know it (fat arrow notation) does not work. But since I had seen it being used here so I used it because it saves chars. But I removed it. And I do not understand your tip, thanks though for examining code. Incorporated your bytes tip. And my new program should might clear your both doubts. Thanks for reading. :) – Gaurang Tandon – 2014-02-16T16:38:25.000

Instead of k="aeiouy";o=0;for(i in k), try o=0;for(i in k='aeiouy'). and using the saves bytes, you can use them to change o+=RegExp(k[i]).test(s) into o+=RegExp(k[i],'i').test(s), taking up one more byte, but working with both upper and lowercase. – Ismael Miguel – 2014-02-16T22:32:35.760

Updated with better algorithm. Though I now understand your idea, but I do not understand why it works here and not here. Please help! Thanks :)

– Gaurang Tandon – 2014-02-17T05:15:34.653

The 1st function (c()) should be replaced with this to work: function c(s){o=0;for(i in k="aeiouy")o+=s.search(k[i]);return o>5}. Solution: You are checking if o>20, when the maximum of o is 6. – Ismael Miguel – 2014-02-18T09:12:36.693

>

  • I was using a different approach. I was adding up the indexes of the characters. So, aeguy would sum to 0 + 1 + 3 + 4 = 8 and fail the condition. But I soon realized that something like ggggggaeiou would do 6+7+8+9+10=42 and pass the condition without a y. So, I had removed the program. 2) I have introduced a new program which has a single function (edit of 17/02 having 139 chars). I wonder which version you are seeing .... (I have removed that c() function to be precise). Thanks for reading though.
  • < – Gaurang Tandon – 2014-02-18T11:19:58.390

    And suddenly, the k="aeiouy" has worked! Saves me 2 chars ! Thanks :) – Gaurang Tandon – 2014-02-18T11:26:30.660

    I'm glad it worked. I forgot to mention i was referring to the version you used in the jsbin.com website. And I've learned that I don't need the .split(), but I won't mess anymore with my already confusing answer. – Ismael Miguel – 2014-02-18T12:33:54.747

    And you can replace o+=r.search(k[i])+1?1:0 with o+=!!~r.search(k[i]). The ~ operator inverts the 'signal bit' (-1 becomes 0, 1 becomes -2, 0 becomes -1). The !! turns it into a boolean. All non-zero numbers are evaluated as true. Boolean values can be used in arithmetic operators and they will be casted to number (1 for true, 0 for false). And I saved you more 3 bytes. – Ismael Miguel – 2014-02-18T12:38:16.733

    @IsmaelMiguel Cool trick! Thanks !!! Both JS programmers helping out each other :D – Gaurang Tandon – 2014-02-18T12:44:59.930

    You can cut down even more and have the bonus if you put all the results inside an array. It will be much more useful. and you have to use 0 bytes to have the number of words. And you are welcome, I like to help. – Ismael Miguel – 2014-02-18T12:49:41.693

    I will try this array tip tomorrow. Other than that, I already have the -5 bonus (I return the count of words). "and you have to use 0 bytes to have the number of words." What does that mean? – Gaurang Tandon – 2014-02-18T12:52:31.613

    It means that you won't have to use counters to know the number of words. You can use like array.push() to add elements and return the array. Since the array has the length property, you automatically get the bonus without making any code. – Ismael Miguel – 2014-02-18T12:59:26.043

    Thanks a ton! And I made a spin-off of your !!~ approach. Instead, of checking o==6 it checks o==0 and reduces !! to !. – Gaurang Tandon – 2014-02-19T03:48:32.193

    I'm not entirely sure why, but this code doesn't work on Opera 12.16. But you really have a nice answer. The only change I would make is that lost t++ almost at the end. Put it in the while loop, replacing it from while(r=l[t]) to while(r=l[t++]), saving another byte. And you will have a 120 bytes solution! – Ismael Miguel – 2014-02-19T09:59:20.463

    --2 Bytes :) And I do not know why it does not work on Opera. Not a problem, as it still works on at least Chrome :) – Gaurang Tandon – 2014-02-19T10:56:17.480

    I really don't know why too. But i saw you are doing if(o==0)z.push(r). Try !o&z.push(r). – Ismael Miguel – 2014-02-19T12:44:49.760

    And you have my name misspelled. – Ismael Miguel – 2014-02-19T13:37:28.087

    @IsmaelMiguel Oops! Really sorry ! Hope you don't mind :) And I have already golfed up the code so much that I don't want to mess with it now :) Thanks for the idea though ! – Gaurang Tandon – 2014-02-20T03:12:02.630

    That's alright. Thanks for correcting the spelling of my name. – Ismael Miguel – 2014-02-20T09:28:41.753

    2

    Ruby 39 38

    Currently the shortest Ruby entry when counting the whole program including input and output.

    Saved a char by using map instead of each:

    $<.map{|w|w*5=~/a.*e.*i.*o.*u/m&&p(w)}
    

    Another version, 39 characters with prettier output:

    puts$<.select{|w|w*5=~/a.*e.*i.*o.*u/m}
    

    Both programs take input from stdin or as a file name passed as a command line argument:
    $ ruby wovels.rb wordlist.txt

    It costs 3 extra characters to inclyde y as a wovel.

    daniero

    Posted 2014-02-15T02:03:21.677

    Reputation: 17 193

    Anyway to use Enumerable#grep to shorten this? e.g., s.split.grep /a*e*i*o*u*y/ assuming s is a string of the words separated by newlines. – O-I – 2014-02-15T23:15:04.683

    @O-I An interesting idea, but it would need some fiddling because the regex has the wovels in a fixed order. That's why i repeat the string 5 times before matching it, with .* between the wovels. – daniero – 2014-02-15T23:52:08.777

    Could you clarify? Suppose s = "aeiouy\neiouay\nyuaioe\n". Then s.split.grep /a*e*i*o*u*y/ returns ["aeiouy", "eiouay", "yuaioe"] for me. Testing in pry Ruby 2.0.0. Great solution, by the way. – O-I – 2014-02-15T23:58:18.467

    @O-I Oh wow, I assumed that grep used the =~ operator, but apparently it uses ===. My suspicion was that it would also match strings not containing all wovels, because for instance /e*a*i*o*u*y/=~"eioy" works. I really don't understand what the === between a regex and an operator actually does. Great find; I'd suggest you post it as an answer yourself. edit I was right: try with for instance "heya". – daniero – 2014-02-16T00:26:44.777

    I think you are right that the regex needs tweaking, though. I'm finding edge cases that don't contain all vowels that are leaking through. Maybe too good to be true. – O-I – 2014-02-16T00:37:16.147

    2

    Perl 6 - 35 characters

    Inspired by @CarySwoveland 's Ruby solution:

    say grep <a e i o u y>⊆*.comb,lines
    

    This selects (greps) each line that returns True for <a e i o u y> ⊆ *.comb, which is just a fancy way of asking "is the Set ('a','e','i','o','u','y') a subset () of the Set made up of the letters of the input (*.comb)?"

    Actually, both <a e i o u y> and *.comb only create Lists: (or (<=) if you're stuck in ASCII) turns them into Sets for you.

    To get the number of lines printed, this 42 character - 5 = 37 point script will output that as well:

    say +lines.grep(<a e i o u y>⊆*.comb)».say
    

    Mouq

    Posted 2014-02-15T02:03:21.677

    Reputation: 906

    2

    C - 96 bytes

     char*gets(),*i,j[42];main(p){while(p=0,i=gets(j)){while(*i)p|=1<<*i++-96;~p&35684898||puts(j);}}
    

    I saved several bytes of parentheses thanks to a fortunate coincidence of operator precedence.

    Nate Eldredge

    Posted 2014-02-15T02:03:21.677

    Reputation: 2 544

    2

    Bash (grep) - 36 bytes

    g=grep;$g y|$g u|$g o|$g i|$g a|$g e
    

    Note the order of vowels tested, least frequent first. For the test case, this runs about 3 times as fast as testing in order a e i o u y. That way the first test removes a larger number of words so subsequent tests have less work to do. Obviously this has no effect on the length of the code. Many of the other solutions posted here would benefit similarly from doing the tests in this order.

    Glenn Randers-Pehrson

    Posted 2014-02-15T02:03:21.677

    Reputation: 1 877

    Why wc, aren't we finding, not counting? Also, do we count input code into character count? – orion – 2014-03-07T15:16:39.737

    I don't really understand the bonus, "-5 points for counting all occurrences of the word". If it really means "reporting all occurrences of the word", that's what my scripts do, without the "|wc". I'm not using any "input code" because grep reads standard input, so "grep" is the "input code" and I counted it. I'll remove the "|wc" now. – Glenn Randers-Pehrson – 2014-03-07T15:22:56.593

    I've disclaimed the bonus. – Glenn Randers-Pehrson – 2014-03-29T16:48:28.467

    2

    Bash + coreutils, 39

    eval cat`printf "|grep %s" a e i o u y`
    

    Takes input from stdin.

    Digital Trauma

    Posted 2014-02-15T02:03:21.677

    Reputation: 64 644

    This looks eligible for the 5-point bonus. – Glenn Randers-Pehrson – 2014-03-27T16:36:23.000

    @GlennRanders-Pehrson That bonus makes no sense to me at all ;-) – Digital Trauma – 2014-03-27T16:43:33.700

    Whether it makes sense or not, you correctly emit 86 lines when processing a file containing two copies of the wordlist. Solutions that sort and only report 43 would not get the bonus, as I understand it. – Glenn Randers-Pehrson – 2014-03-27T17:18:17.620

    2

    sed 29 chars

    /y/{/u/{/o/{/i/{/a/{/e/p}}}}}
    

    Order choosed from Letter frequency on wikipedia to speed check.

    On my host:

    time sed -ne '/a/{/e/{/i/{/o/{/u/{/y/p}}}}}' </usr/share/dict/american-english >/dev/null 
    real    0m0.046s
    

    and

    time sed -ne '/y/{/u/{/i/{/o/{/a/{/e/p}}}}}'</usr/share/dict/american-english >/dev/null 
    real    0m0.030s
    

    F. Hauri

    Posted 2014-02-15T02:03:21.677

    Reputation: 2 654

    1Nice (+1), but I think you need to include "sed -n " in the script, for a count of 36 bytes. – Glenn Randers-Pehrson – 2014-03-29T16:53:22.313

    1

    JavaScript - 95 bytes

    Here's my golf.

    function f(s){return[var a=s.match(/^(?=.*a)(?=.*e)(?=.*i)(?=.*o)(?=.*u)(?=.*y).*/),a.length];}
    

    And I would also like to point out that your golf doesn't seem to find all occurrences of vowels.

    Ungolfed:

    function countVowels(string) {
      var regex   = /^(?=.*a)(?=.*e)(?=.*i)(?=.*o)(?=.*u)(?=.*y).*/;
      var matches = string.match(regex);
      var length  = matches.length;
      return [matches, length];
    

    Isiah Meadows

    Posted 2014-02-15T02:03:21.677

    Reputation: 1 546

    1Read the spec more carefully. He's looking for words which---like facetiously---contain all the vowels in a single word. Though he does not insist that they are contained in order as in facetiously. – dmckee --- ex-moderator kitten – 2014-02-15T03:50:19.893

    1Your regex is wrong. All the look-ahead are effectively checking whether the first character is a vowel. You need (?=.*a) to check whether a is somewhere in the string. – n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ – 2014-02-16T11:34:48.490

    @dmckee That's why I used lookaheads. They don't require any specific order. – Isiah Meadows – 2014-02-17T04:19:37.967

    @nhahtdh Thanks for the catch – Isiah Meadows – 2014-02-17T04:20:05.657

    1

    D - 196

    import std.regex,std.stream;void main(string[]a){auto f=new File(a[1]);while(!f.eof)if(!(a[0]=f.readLine.idup).match("(?=.*a)(?=.*e)(?=.*i)(?=.*o)(?=.*u)(?=.*y).*").empty)std.stdio.writeln(a[0]);}
    

    Un-golfed:

    import std.regex, std.stream;
    
    void main( string[] a )
    {
        auto f = new File( a[1] );
    
        while( !f.eof )
            if( !( a[0] = f.readLine.idup ).match( "(?=.*a)(?=.*e)(?=.*i)(?=.*o)(?=.*u)(?=.*y).*" ).empty )
                std.stdio.writeln( a[0] );
    }
    

    Usage: C:\>rdmd vowels.d wordlist.txt

    wordlist.txt must contain the lowercase list words.

    Tony Ellis

    Posted 2014-02-15T02:03:21.677

    Reputation: 1 706

    1

    Rebol (104 chars)

    remove-each w d: read/lines %wordlist.txt[6 != length? collect[foreach n"aeiouy"[if find w n[keep n]]]]
    

    Un-golfed:

    remove-each w d: read/lines %wordlist.txt [
        6 != length? collect [foreach n "aeiouy" [if find w n [keep n]]]
    ]
    

    d now contains list of found words. Here is an example from Rebol console:

    >> ; paste in golf line.  This (REMOVE-EACH) returns the numbers of words removed from list
    
    >> remove-each w d: read/lines %wordlist.txt[6 != length? collect[foreach n"aeiouy"[if find w n[keep n]]]]
    == 58067
    
    >> length? d
    == 43
    

    draegtun

    Posted 2014-02-15T02:03:21.677

    Reputation: 1 592

    1

    Bash

    Not as short as the OP's , but one line in Bash:

    while read p; do if [ $(sed 's/[^aeiouy]//g' <<< $p | fold -w1 | sort | uniq | wc -l) -eq 6 ] ; then echo $p; fi; done < wordlist.txt
    

    Kevin

    Posted 2014-02-15T02:03:21.677

    Reputation: 3 123

    You could save four bytes by replacing "sort | uniq" with "sort -u" – Glenn Randers-Pehrson – 2014-02-24T01:26:38.800

    Also you can remove the spaces from " | " and "; " to save a few more bytes – Glenn Randers-Pehrson – 2014-02-24T18:55:05.810

    1

    sort + uniq + sed

    This one does not match repeated occurrences of a word. It also does not match the letter 'y' if is occurs at the beginning of a word.

    sort wordlist.txt | uniq | sed -n '/a/p' | sed -n '/e/p' | sed -n '/i/p' | sed -n '/o/p' | sed -n '/u/p' | sed -nr '/^[^y]+y/p' 
    

    Kevin

    Posted 2014-02-15T02:03:21.677

    Reputation: 3 123

    As in your other answer, replace "sort wordlist.txt | uniq" with "sort -u wordlist.txt" to save 4 bytes. – Glenn Randers-Pehrson – 2014-02-24T01:28:56.043

    1

    Smalltalk (36/57 chars)

    'corncob_lowercase.txt' asFilename contents select:[:w | w includesAll:'aeiouy']
    

    to get the count, send #size to the resulting collection. The result collection contains 43 words ('abstemiously' 'authoritatively' ... 'unquestionably' 'unrecognisably')

    The code above has 77 chars, but I could have renamed the wordlist file to 'w', so I count the filename as 1 which gives a score of 57.

    Is reading the file part of the problem or not? If not (see other examples), and the list of words is already in a collection c, then the code reduces to:

    c select:[:w | w includesAll:'aeiouy']
    

    which is 36 chars (with omittable whitespace removed).

    blabla999

    Posted 2014-02-15T02:03:21.677

    Reputation: 1 869

    1

    updated: unnecessary spaces removed

    Very slow but in bash (81 chars):

    while read l;do [ `fold -w1<<<$l|sort -u|tr -dc ieaouy|wc -m` = 6 ]&&echo $l;done
    

    EDIT: echo $l|fold -w1 replaced with fold -w1<<<$l as suggested by @nyuszika7h

    Nik O'Lai

    Posted 2014-02-15T02:03:21.677

    Reputation: 585

    This is code golf, you might want to minify your code a bit more. Start by removing unneeded whitespace. ;) – nyuszika7h – 2014-02-15T15:27:33.930

    You can further minify the code by using fold -w1<<<$l instead of echo $l|fold -w1. Note: The current code is 84 characters, you shouldn't count the trailing newline. – nyuszika7h – 2014-02-16T10:19:10.617

    Till today I knew nothing about <<<. Thank you again, @nyuszika7h. Can you tell me, where it is explained. – Nik O'Lai – 2014-02-16T10:47:03.180

    1

    Mathematica - 136 102

    Fold[Flatten@StringCases@## &, 
    Flatten@Import@"http://bit.ly/1iZE9kY",
    ___ ~~ # ~~ ___ & /@ Characters@"aeiouy"]
    

    The shortened link goes to http://www.mieliestronk.com/corncob_lowercase.txt

    swish

    Posted 2014-02-15T02:03:21.677

    Reputation: 7 484

    Save 28 characters with http://bit.ly/1iZE9kY. – wchargin – 2014-02-15T21:13:12.187

    Save two characters with Characters["aeiou"] or more if you include y. – wchargin – 2014-02-15T21:14:48.273

    1

    C-Sharp

    I've never done this before and I'm not exactly sure what the posting procedures are. But this is what i came up with:

    185 bytes

    Action<string>x=(s=>s.Split('\n').ToList().ForEach(w=>{if("aeiouy".All(v=>w.Contains(v)))Console.Write(w);}));using(var s=new StreamReader(@"C:\corncob_lowercase.txt"))x(s.ReadToEnd());
    

    wordList = a List<string> of all the words.

    if you want to display a total:

    219 - 5 = 214 bytes

    Action<string>x=(s=>{var t=0;s.Split('\n').ToList().ForEach(w=>{if("aeiouy".All(v=>w.Contains(v))){Console.Write(w);t++;}});Console.Write(t);});using(var s=new StreamReader(@"C:\corncob_lowercase.txt"))x(s.ReadToEnd());
    


    Expanded

    // init
    var words = "";
    var vowels = "aeiouy";
    var total = 0;
    
    using (var stream = new StreamReader(@"C:\corncob_lowercase.txt"))
    {
        // read file
        words = stream.ReadToEnd();
    
        // convert word to List<string>
        var wordList = words.Split('\n').ToList();
    
        // loop through each word in the list
        foreach (var word in wordList)
    
            // check if the current word contains all the vowels
            if(vowels.All (w => word.ToCharArray().Contains(w)))
            {
                // Count total
                total += 1;
                // Output word
                Console.Write(word);
            }
    
        // Display total
        Console.WriteLine(total);
    }
    

    jzm

    Posted 2014-02-15T02:03:21.677

    Reputation: 369

    Generally if the question asks for a "program", you should post your complete program including loading/initialization, etc. Great work otherwise! – ProgrammerDan – 2014-03-28T04:21:50.167

    Oh ok. So in the minified version i should include everything not just the line that achieves the requirement? I thought it was the latter judging by other answers as they lacked the code to load/read the txt file. – jzm – 2014-03-28T04:48:45.840

    You'll see a variation of approaches, and given the age of the answer curation is likely not to be as strong on new answers, but in general if the question asks for a "program" it should be compilable and runnable as posted. Take the example in the question itself -- that is a complete, executable solution, that stands alone. – ProgrammerDan – 2014-03-28T04:55:53.643

    ahh right. well, in that case i've updated the 2 shortened versions to be standalone. – jzm – 2014-03-28T05:13:16.777

    Great! Be sure to update the text of your answer (you mention "without loading/reading") and compute your score. – ProgrammerDan – 2014-03-28T05:40:52.047

    This is still missing some of the "ceremony"; you need a main, you need a class etc. You might want to take a look at my entry for a complete example.

    – RobIII – 2014-03-28T13:30:42.283

    Oh, and also: your entry should contain the "score" in the "title". Yours would (currently) be: "C-Sharp - 251" but since the "program" doesn't run as posted this is not the final score. – RobIII – 2014-03-28T13:48:44.417

    Also, using variable-names like stream and total will ofcourse hurt your score as opposed to s and t; stuff like total += 1 could ofcourse be written as total++ and things like new char[] {'a','e','i','o','u','y'}; are (mostly) overkill when "aeiouy" will do fine (remember: a string is a char-array in essence; see my entry for that too).

    – RobIII – 2014-03-28T13:54:38.677

    @RobIII re: char[] - should have thought of that lol. Anyways, I've updated mine. re: 'ceremony', if you run mine as-is in linqpad (c# statements), it works :D also +1'd your answer. totally different approach to mine + very concise – jzm – 2014-03-29T01:35:35.063

    I suppose we can argue if running in LinqPad can be considered "a program" as stated in the contest. Thanks for the upvote though ;-) – RobIII – 2014-03-29T23:34:14.183

    1

    C# - 170

    using System.Linq;class P{static void Main(string[]a){System.Console.Write(string.Join(",",System.IO.File.ReadAllLines(a[0]).Where(w=>"aeiouy".All(c=>w.Contains(c)))));}}
    

    Formatted:

    using System.Linq;
    class P
    {
        static void Main(string[] a) { 
            System.Console.Write(
                string.Join(",", System.IO.File.ReadAllLines(a[0])
                    .Where(w => "aeiouy".All(c => w.Contains(c))))); 
        }
    }
    

    Not in the mood right now to implement counting puh but should be easy. The path to the (lower-case version of the) wordlist should be passed to the program as first argument:

    program.exe D:\foo\bar\corncob_lowercase.txt
    

    Output:

    abstemiously,authoritatively,behaviourally,consequentially,counterrevolutionary,
    disadvantageously,educationally,encouragingly,eukaryotic,evolutionarily,evolutio
    nary,exclusionary,facetiously,gregariously,heterosexuality,homosexuality,importu
    nately,inconsequentially,instantaneously,insurrectionary,intravenously,manoeuvra
    bility,neurologically,neurotically,ostentatiously,pertinaciously,precariously,pr
    ecautionary,questionably,revolutionary,simultaneously,supersonically,tenaciously
    ,uncomplimentary,uncontroversially,unconventionally,undemocratically,unemotional
    ly,unequivocally,uninformatively,unintentionally,unquestionably,unrecognisably
    

    I took the liberty of outputting and comma-separating the words; neither of which is specified in the rules (which state "must find all the words", not how (and IF) to output).

    Including count (+output): 192 - 5 = 187

    using System.Linq;class P{static void Main(string[]a){var r=System.IO.File.ReadAllLines(a[0]).Where(w=>"aeiouy".All(c=>w.Contains(c)));System.Console.Write(string.Join(",",r)+" "+r.Count());}}
    

    Output:

    abstemiously,authoritatively,behaviourally,consequentially,counterrevolutionary,
    disadvantageously,educationally,encouragingly,eukaryotic,evolutionarily,evolutio
    nary,exclusionary,facetiously,gregariously,heterosexuality,homosexuality,importu
    nately,inconsequentially,instantaneously,insurrectionary,intravenously,manoeuvra
    bility,neurologically,neurotically,ostentatiously,pertinaciously,precariously,pr
    ecautionary,questionably,revolutionary,simultaneously,supersonically,tenaciously
    ,uncomplimentary,uncontroversially,unconventionally,undemocratically,unemotional
    ly,unequivocally,uninformatively,unintentionally,unquestionably,unrecognisably 4
    3
    

    (Note the count at the end: 43)

    No output ("must find all the words"): 137 - 5 = 132

    using System.Linq;class P{static void Main(string[]a){var r=System.IO.File.ReadAllLines(a[0]).Where(w=>"aeiouy".All(c=>w.Contains(c)));}}
    

    (Bending the rules a bitm then again: not really) This finds all the words and the count is available by executing r.Count().

    RobIII

    Posted 2014-02-15T02:03:21.677

    Reputation: 397

    1

    vb.net (Score 91 = 96c - 5)*0

    *0 +49c min

    This creates an enumeration contain all of the words which contain all of the vowels.

    Dim r=IO.File.ReadLines(a(0)).Where(Function(w)"aeiou".Intersect(w).Count=5)
    Dim c=r.Count
    

    Adam Speight

    Posted 2014-02-15T02:03:21.677

    Reputation: 1 234

    Your program must find all the words in this wordlist. This is a) not a program but a snippet of a program and b) doesn't read/use the wordlist. – RobIII – 2014-03-29T23:31:03.920

    @RobIII vb.net has a minimum 49c for a basic console program. The arguments to the program (in this case the wordlist) are the array a. Plus as some others have pointed out it is valid program in LinqPad. – Adam Speight – 2014-03-30T03:08:39.370

    0

    Batch - 52 Bytes

    if you're not worried about the original word list -

    @for %%a in (a e i o u)do @find "%%a" %1>f&type f>%1
    

    This outputs the new list to a file called f, preserving the original word list - 66 bytes -

    @type %1>f&for %%a in (a e i o u)do @find "%%a" f>f%%a&type f%%a>f
    

    If you want it to clean up the files it leaves around, just add &del f%%a to the end for an extra 9 bytes.

    Takes list of words as input.

    H:\uprof>vowles.bat wordlist.txt
    

    Old solution - 162 Bytes

    @echo off&setLocal enableDelayedExpansion&for /f %%a in (%1) do (set a=%%a&set t=&for %%b in (a e i o u) do if "!a:%%b=!"=="!a!" set t=1)&if "!t!" NEQ "1" echo %%a
    

    unclemeat

    Posted 2014-02-15T02:03:21.677

    Reputation: 2 302

    0

    JavaScript - 118 bytes

    function(a){r=[];for(k in a=a.split("\n")){c=0;for(b in s="aeiouy")c+=!!~a[k].search(s[b]);c>5&&r.push(a[k])}return r}
    

    Paste this into the console to test it:

    (function(a){r=[];for(k in a=a.split("\n")){c=0;for(b in s="aeiouy")c+=!!~a[k].search(s[b]);c>5&&r.push(a[k])}return r})(document.getElementsByTagName('pre')[0].innerText)
    

    Friend of Kim

    Posted 2014-02-15T02:03:21.677

    Reputation: 101

    0

    Bash (sed) - 36 bytes

    s=/!d\;;sed /y$s/u$s/o$s/i$s/a$s/e$s
    

    As in my bash (grep) solution, I changed the order of tests to make the job run about 40 percent faster for the given input file.

    Glenn Randers-Pehrson

    Posted 2014-02-15T02:03:21.677

    Reputation: 1 877

    0

    Pure bash 86 chars

    t=aeuoiy;while read w;do v=${w,,};r=${v//*([^$t])};[ "${t//*([$r])}" ] || echo $w;done
    

    Demo:

    t=aeuoiy
    while read w;do
        v=${w,,}
        r=${v//*([^$t])}
        [ "${t//*([$r])}" ] || echo $w
      done < /usr/share/dict/american-english
    Aureomycin
    Aureomycin's
    Byelorussia
    Byelorussia's
    ambidextrously
    authoritatively
    ...
    

    F. Hauri

    Posted 2014-02-15T02:03:21.677

    Reputation: 2 654

    I like this because there is no and. The job is done in a different way! – F. Hauri – 2014-03-28T06:32:03.737

    0

    Javascript (ES6) - 60 - 5 (Bonus) = 55 Characters

    x.filter(s=>s.replace(/[^AEIOUY]|(.)(?=.*\1)/g,'').length>5)
    

    Assumes the variable x contains an array of upper-case words.

    Filters the array to find all the strings when if you replace all non-vowels and duplicate characters it has a length greater than 5.

    [Counting the bonus -5 as Firefox (which is the only browser to support ES6 arrow function syntax) outputs the result of an expression in the console and will output the length property of an array alongside all the elements.]

    An aside

    To get the word list into a JavaScript array format:

    • Save the upper-case file linked in the question as Words.txt
    • run gawk -F: '{ print "\"" $1 "\"," }' Words.txt > Words2.txt to add surrounding quotes and trailing commas to each line.
    • Open Words2.txt and manually add x=[ before the first line and replace the comma on the last line with a closing bracket ].
    • Then you can copy/paste the entire thing into the firefox console (it might take a while to generate a 58,000 row array but it managed it for me).

    MT0

    Posted 2014-02-15T02:03:21.677

    Reputation: 3 373

    0

    Perl command line - 45 - 5 = 40

    perl -ne 'print if /a/&/e/&/i/&/o/&/u/&/y/;' wordlist.txt
    

    It's 45 characters not including the file name, and I think it qualifies for the bonus. Fairly readable as well. :)

    Nice question!

    sgauria

    Posted 2014-02-15T02:03:21.677

    Reputation: 591

    0

    Python 65 bytes

    def count(word): return False not in [j in word for j in 'aeiou']
    

    Leandro Poblet

    Posted 2014-02-15T02:03:21.677

    Reputation: 111

    0

    C# (49c)

    Getting the file lines will be the hard to golf aspect of the challenge for C#.

    var r=l.Where(w=>"aeiou".Intersect(w).Count==5);
    

    This will be an enumeration of all the words containing all the vowels.

    Just wanting the count then use.

    var r=l.Count(w=>"aeiou".Intersect(w).Count==5);
    

    Adam Speight

    Posted 2014-02-15T02:03:21.677

    Reputation: 1 234

    Seriously? Translating vb.net to C# (or vice versa) and submitting as two answers? Okay... well, actually, be my guest but see my comment in your other answer.

    – RobIII – 2014-03-29T23:32:19.800

    0

    Go - 186 (or 215)

    Go's not much for code golf. (The designers like explicit code, and, heck, we're talking about a language where standard style is usually gofmt-enforced.) Nonetheless, 186 decidedly unidiomatic bytes:

    package main
    import (."bufio"
    ."os")
    func main(){f:=NewReader(Stdin)
    for{l,d:=f.ReadBytes(13)
    s,n:=0,17842449
    for _,c:=range l{s|=1<<(c-97)}
    if s&n==n{Stdout.Write(l)}
    if d!=nil{break}}}
    

    Some \n's could be ;'s, but it wouldn't affect the byte count. You can see a formatted version.

    I sort of like this variant, though, which is longer, but just reads bytes from stdin without even having line splitting done for it (formatted):

    package main
    import ."os"
    func main(){var b,w[1024]byte
    s,i,m:=0,0,17842449
    for{n,e:=Stdin.Read(b[:])
    for _,c:=range b[:n]{s|=1<<(c-97)
    w[i]=c
    i++
    if c==13{if s&m==m{Stdout.Write(w[:i])}
    s,i=0,0}}
    if e!=nil{break}}}
    

    twotwotwo

    Posted 2014-02-15T02:03:21.677

    Reputation: 101

    -1

    Python

    file = open('wordlist.txt', 'r')
    for word in file:
        if 'a|e|i|o|u' in word:
            print(word)
    

    Bharathiraja Perumal

    Posted 2014-02-15T02:03:21.677

    Reputation: 1