13
\$\begingroup\$

The challenge is to remove vowels (a, e, i, o, u) from string from STDIN (yes, I know, simple). You can expect that your program will be not ran with any arguments in argv.

Example:

This program will remove VOWELS.
So we can now speak without them.

Is changed to:

Ths prgrm wll rmv VWLS.
S w cn nw spk wtht thm.

There is a catch. The winning entry is decided basing on number of different bytes. For example a ab has three different bytes (a, b and space). If two or more entries will have this same ammount of different bytes, then fallback is done on number of bytes for those entries.

\$\endgroup\$
7
  • 11
    \$\begingroup\$ A job for Whitespace language \$\endgroup\$
    – jfs
    May 28 '12 at 20:24
  • \$\begingroup\$ What about input like Renée’s naïveté? Stripped of vowels, that should of course be Rn’s nvt as output. Seem like these approaches are all pretty ahem naïve if you ask me. :) \$\endgroup\$
    – tchrist
    May 28 '12 at 20:25
  • \$\begingroup\$ If you remove é, you might want to remove y too. \$\endgroup\$ May 28 '12 at 22:23
  • 5
    \$\begingroup\$ @tchrist, read the question. Says to remove a,e,i,o,u. You're off topic, please drop it. \$\endgroup\$
    – boothby
    May 29 '12 at 2:40
  • 1
    \$\begingroup\$ @tchrist: Especially the challenge didn't say "all vowels" and enumerated what we should consider as removable. \$\endgroup\$ May 29 '12 at 12:17

31 Answers 31

13
\$\begingroup\$

Brainfuck, 8 distinct (2121 total)

>,+[-<>>>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>[-]++<[-<+>>>>->>>->>>->>>->>>->>>->>>->>>->>>->>>-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[<<<]+>-[<-<.>>-]<[<<<]<[-]>,+]

The distict characters: <>+-[],.. Works with interpreters that use -1 for EOF.

$ echo '
This program will remove VOWELS.
So we can now speak without them.
' | bf vowel-rm.bf

Ths prgrm wll rmv VWLS.
S w cn nw spk wtht thm.

\$\endgroup\$
8
  • 2
    \$\begingroup\$ By the requirements as stated, this is the best answer; but OTOH it's the worst in that it uses every syntactically-significant character in its language. \$\endgroup\$
    – dan04
    May 28 '12 at 19:12
  • 3
    \$\begingroup\$ @tchrist: It assumes ASCII. Anyway, only {a, e, i, o, u} are in the requirements. \$\endgroup\$
    – Jon Purdy
    May 28 '12 at 23:24
  • 1
    \$\begingroup\$ So it’s ok to turn Renée’s naïveté into Rń’s n̈vt́, then? That doesn’t seem right to me, but if you say so. Since you can’t assume any normalization, it is perfectly reasonable that Renée’s naïveté is really "Rene\N{COMBINING ACUTE ACCENT}e\N{RIGHT SINGLE QUOTATION MARK}s nai\N{COMBINING DIAERESIS}vete\N{COMBINING ACUTE ACCENT}" — or if you prefer magic numbers, "Rene\x{301}e\x{2019}s nai\x{308}vete\x{301}". If you remove the vowels without their attendant diacritics, you get extreme silliness. Welcome to the Brave New Millennium! :) \$\endgroup\$
    – tchrist
    May 28 '12 at 23:30
  • 1
    \$\begingroup\$ Use Unary, you'd only have one distinct character! :-P esolangs.org/wiki/Unary \$\endgroup\$
    – marinus
    May 29 '12 at 5:27
  • 3
    \$\begingroup\$ @marinus, I've converted this to Unary and I just needed 1.166921663690E+1824 bytes to store it (I've uploaded exact number to pastebin, it wouldn't fit in this comment). I wonder how much time it would take to send it to this site. \$\endgroup\$ May 29 '12 at 16:29
10
\$\begingroup\$

Whitespace, 3 points (218 chars)

You knew it was coming.

↲___↲____↲⇥↲⇥_____↲___⇥_____⇥↲___⇥___⇥_⇥↲___⇥__⇥__⇥↲___⇥__⇥⇥⇥⇥↲___⇥_⇥_⇥_⇥
↲___⇥⇥____⇥↲___⇥⇥__⇥_⇥↲___⇥⇥_⇥__⇥↲___⇥⇥_⇥⇥⇥⇥↲___⇥⇥⇥_⇥_⇥↲↲___⇥↲_↲_↲⇥_⇥↲___
_↲⇥⇥⇥⇥__⇥↲⇥_↲↲_↲_⇥↲↲__↲↲⇥__↲↲_↲↲↲__⇥↲____↲⇥⇥⇥_↲_↲⇥___↲⇥↲__↲_↲_↲↲____↲↲↲↲

(_ = space, ⇥ = tab, ↲ = newline)

Here's the script encoded in base64:

CiAgIAogICAgCgkKCSAgICAgCiAgIAkgICAgIAkKICAgCSAgIAkgCQogICAJICAJICAJCiAgIAkg
IAkJCQkKICAgCSAJIAkgCQogICAJCSAgICAJCiAgIAkJICAJIAkKICAgCQkgCSAgCQogICAJCSAJ
CQkJCiAgIAkJCSAJIAkKCiAgIAkKIAogCgkgCQogICAgCgkJCQkgIAkKCSAKCiAKIAkKCiAgCgoJ
ICAKCiAKCgogIAkKICAgIAoJCQkgCiAKCSAgIAoJCiAgCiAKIAoKICAgIAoKCgo=

And here's the program written in visible assembler-like form:

ioloop: charin  0
        push    0, 'A', 'E', 'I', 'O', 'U', 'a', 'e', 'i', 'o', 'u'
ckloop: dup
        jz      out
        get     0
        sub
        jz      skip
        jump    ckloop
skip:   jz      ioloop
        jump    skip
out:    get     0
        dup
        jz      done
        charout
        jump    ioloop
done:   exit
\$\endgroup\$
6
  • \$\begingroup\$ Smells like Acme::Bleach to me. :) \$\endgroup\$
    – tchrist
    May 29 '12 at 2:38
  • \$\begingroup\$ When I convert your "symbolic" program to Whitespace, it has fatal syntax errors. \$\endgroup\$
    – r.e.s.
    May 29 '12 at 3:23
  • \$\begingroup\$ That's odd. Did you remember to remove the actual newlines before doing the conversion? I should just include a base64-encoding of the actual script. \$\endgroup\$
    – breadbox
    May 29 '12 at 3:48
  • 1
    \$\begingroup\$ Yes, I did that -- your base64 version decodes into exactly what I'm using. Here's an "STL" version (with S,T,L coding Space,Tab,Linefeed respectively): LSSSLSSSLTLTSSSSLSSSTSSSSSTLSSSTSSSTSTLSSSTSSTSSTLSSSTSSTTTTLSSSTSTSTSTLSSSTTSS‌​SSTLSSSTTSSTSTLSSSTTSTSSTLSSSTTSTTTTLSSSTTTSTSTLLSSSTLSLSLTSTLSSSLTTTTSSTLTSLLSLS‌​TLLSSLLTSSLLSLLLSSTLSSSLTTTSLSLTSSSLTLSSLSLSLLSSSSLLLL. It appears that two problems (among others) are that you're trying to push a 0 onto the stack using SSSL instead of SSSSL, and also trying to define an "empty" label by using LSSL for skip. \$\endgroup\$
    – r.e.s.
    May 29 '12 at 4:47
  • 1
    \$\begingroup\$ Sorry for the delay ... I just confirmed that indeed Edwin Brady's Version 0.3 (Linux binary) of the Whitespace interpreter does indeed run your program without complaint. I've been using the Ruby implementation (available at the same page), which disallows the syntax you're using. \$\endgroup\$
    – r.e.s.
    May 30 '12 at 1:00
9
\$\begingroup\$

SED (10 distinct bytes, 13 total)

s/[aeIou]//gI

Sample usage:

echo The quick brown fox jumps over the lazy dOg. | sed -e s/[aeIou]//gI

outputs:

Th qck brwn fx jmps vr th lzy dg.
\$\endgroup\$
7
  • \$\begingroup\$ Just wondering, why I is uppercase? It works fine when I characters are lowercase. \$\endgroup\$ May 28 '12 at 14:35
  • 2
    \$\begingroup\$ @GlitchMr I just did that to emphasize that the I character is reused. \$\endgroup\$ May 28 '12 at 14:36
  • 1
    \$\begingroup\$ @tchrist I don't think the OP mentioned French vowels in his post. Also, I like writing naïve programs. :-) \$\endgroup\$ May 28 '12 at 20:49
  • 3
    \$\begingroup\$ I'm pretty sure ö and ï are misused in your example and the other two are consonants. Still, I think you have a point. But this way we may end up supporting ò̟̣̱͉̙t̝͔͖͇͙̦̝h̵̩e͎r͓̥ ̱̼̞̰̠͔k̞̝̮̕i̴̘̟̬̠n̻͜d̦̰̼̰͔s͈̺̝̭ ̫̺͔̠̭̖o̼f̲͘ ͓̮v̳̙͔̝o͔̭̫͕͢ẃ̜͉̪̩̗e̻͔̺̬̣ĺs͖̭̮ as well; perhaps even ,,slǝʍoʌ uʍop ǝpısdn,, :-) \$\endgroup\$ May 28 '12 at 21:28
  • 1
    \$\begingroup\$ @w0lf, those uses of ö and ï were once found in English, though they've nearly disappeared now. \$\endgroup\$
    – Joe
    May 28 '12 at 21:40
7
\$\begingroup\$

Perl: 8 or 10 distinct characters

s/// solution: 10 distinct, 13 total

The (purported; see below) sed technique always works in perl, too, and yields the name number of distinct characters (10):

s/[aeiou]//gi

For example:

$ echo 'This program will remove VOWELS. So we can speak without them.' | 
  perl -ple 's/[aeiou]//gi'
Ths prgrm wll rmv VWLS. S w cn spk wtht thm.

That’s 10 distinct characters, as this proves:

$ echo 's/[aeiou]//gi' | perl -nle '@s{split//}=(); print scalar keys %s'
10

The problem with the sed solution is that its /i is not part of POSIX sed, and thus is not portable:

$ echo 'This program will remove VOWELS. So we can speak without them.' | 
  sed -e 's/[aeiou]//gi'
sed: 1: "s/[aeiou]//gi": bad flag in substitute command: 'i'

That’s running on an OpenBSD system. In contrast, because /i is indeed always part of standard perl, you can count on its always being there. Unlike sed.

If you want to include “y” in the list of vowels, it is of course one greater if you use the same technique:

$ echo 'This nifty program remove any VOWELS. So we easily can speak without them.' | 
  perl -ple 's/[aeiouy]//gi'
Ths nft prgrm rmv n VWLS. S w sl cn spk wtht thm.

$ echo 's/[aeiouy]//gi' | perl -nle '@s{split//}=(); print scalar keys %s'
11

And it is now 14 total characters.

tr[][] solution: 8 distinct 10 total

You could also use tr/// to remove anything it matches. Perl can even use sed’s y/// alias for tr:

y/aeiou//d

which is now 8 distinct characters, but does’t work on uppercase. You end up having to add 5 more characters to cope with the casemaps:

$ echo 'y/aeiouAEIOU//d' | perl -nle '@s{split//}=(); print scalar keys %s'
13

and of course that’s now 15 total.

However, adding “y” to the mix as a vowel doesn’t up the number of distinct characters as it did with the s/// version:

$ echo 'This nifty program remove any VOWELS. So we easily can speak without them.' | 
  perl -ple 'y/aeiouy//d'
Ths nft prgrm rmv n VOWELS. S w sl cn spk wtht thm.

So that’s still just the original 8 distinct out of 11 total:

$ echo 'y/aeiouy//d' | perl -nle '@s{split//}=(); print scalar keys %s'
8

EDIT: Accounting for Diacritics

And what about inputs like Renée’s naïveté? The correct output should of course be Rn’s nvt. Here’s how to do that, using v5.14’s /r flag for s///:

$ echo 'Renée’s naïveté' |
  perl5.14.0 -CS -MUnicode::Normalize -nle 'print NFD($_)=~s/[aeiou]\pM*//rgi'
Rn’s nvt

That’s 27 distinct characters:

$ echo 'print NFD($_) =~ s/[aeiou]\pM*//rgi' | 
  perl -nle '@s{split//}=(); print scalar keys %s'
27

You can trim that to 26 if you can guarantee that you’re running at least v5.10 by swapping out the print for a say:

$ echo 'Renée’s naïveté' |
  perl -Mv5.14 -CS -MUnicode::Normalize -nlE 'say NFD($_) =~ s/[aeiou]\pM*//rgi'
Rn’s nvt

$ echo 'say NFD($_) =~ s/[aeiou]\pM*//rgi' | 
  perl -nle '@s{split//}=(); print scalar keys %s'
26

And you can get it down to 22 if you don’t mind moving the diacritics instead of removing them:

$ echo 'Renée’s naïveté' |
  perl -Mv5.14 -CS -MUnicode::Normalize -nlE 'say NFD($_) =~ s/[aeiou]//rgi'
Rń’s n̈vt́

Which is ... interesting to look at, to say the least. :) Here’s its distinct-count:

$ echo 'say NFD($_) =~ s/[aeiou]//rgi' | 
  perl -nle '@s{split//}=(); print scalar keys %s'
22

Good luck getting any other language to properly deal with diacritics using fewer characters than this!

\$\endgroup\$
6
  • 1
    \$\begingroup\$ ɢᴏᴏᴅ ᴘₒᵢⁿᵗ αβουτ 𝐝𝐢𝐚𝐜𝐫𝐢𝐭𝐢𝐜𝐬 𝑦𝑜𝑢 𝒈𝒐𝒕 𝓽𝓱𝓮𝓻𝓮, 𝒷𝓋𝓉 𝔥𝔬𝔴 𝕒𝕓𝕠𝕦𝕥 𝘀𝘁𝘂𝗳𝗳 𝚕𝚒𝚔𝚎 𝕋ℍ𝕀𝕊? \$\endgroup\$ May 29 '12 at 1:25
  • \$\begingroup\$ @leftaroundabout Most of that’s fixed by committing to an NFKD decomposition. The Greeks don’t count though they’re lookalikes, and the smallcaps don’t decompose to regulars. The result is "ɢᴏᴏᴅ ᴘnt αβουτ dcrtcs y gt thr, bvt hw bt stff lk THS", or "\N{LATIN LETTER SMALL CAPITAL G}\N{LATIN LETTER SMALL CAPITAL O}\N{LATIN LETTER SMALL CAPITAL O}\N{LATIN LETTER SMALL CAPITAL D} \N{LATIN LETTER SMALL CAPITAL P}nt \N{GREEK SMALL LETTER ALPHA}\N{GREEK SMALL LETTER BETA}\N{GREEK SMALL LETTER OMICRON}\N{GREEK SMALL LETTER UPSILON}\N{GREEK SMALL LETTER TAU} dcrtcs y gt thr, bvt hw bt stff lk THS". \$\endgroup\$
    – tchrist
    May 29 '12 at 2:07
  • \$\begingroup\$ But are there are some Latin vowels that don't have compatibility decompositions, such as ø. \$\endgroup\$
    – dan04
    May 29 '12 at 2:28
  • 5
    \$\begingroup\$ challenge doesn't say to remove vowels with diacritics -- just a,e,i,o,u -- so Renée’s naïveté should give Rné’s nïvté. \$\endgroup\$
    – boothby
    May 29 '12 at 3:37
  • 2
    \$\begingroup\$ Why would greek vowels not count, if äèïóű etc. (not in [a,e,i,o,u]!) do? Or Cyrillic, for that matter (which aren't lookalikes, but sure enough vowels). \$\endgroup\$ May 29 '12 at 9:47
7
\$\begingroup\$

C, 22 20 19 distinct characters.

Letters needed for main, putchar, getchar = 12.
Punctuation - (){}; = 5.
Operators - &-= 2.

i;ii;
p(c){
    (c&ii-(-ii-ii))-(i-ii-ii-ii-ii-ii-ii)&&
    (c&ii-(-ii-ii))-(i-ii-ii-ii-ii-ii-ii-i-i-i-i)&&
    (c&ii-(-ii-ii))-(i-ii-ii-ii-ii-ii-ii-ii-(-i-i-i))&&
    (c&ii-(-ii-ii))-(-ii-ii-ii-ii-ii-ii-ii-i-i)&&
    (c&ii-(-ii-ii))-(i-ii-ii-ii-ii-ii-ii-ii-ii-(-i-i))&&
    putchar(c);
}
a(c){c-i&&n(p(c));}
n(c){a(getchar());}
main(){
    n(i---ii---ii---ii---ii---ii---ii---ii---ii---ii---ii---ii---i);
}

main invokes undefined behavior (too much -- in one line).
I don't care about the expression value, and it does decrement ii the right number of times.
Can be fixed easily by separating the decrements with ;. But it's so much nicer as it is.

Old version, 20 characters:
Actually 21, because I didn't notice that some spaces are significant and must be counted, but they can be replaced with parentheses easily.

ii;iii;c;a;
main(i){
    i=c;i-=--c;
    ii=-i-i-i-i-i-i-i-i-i-i-i;
    iii=i-ii-ii-ii-ii-ii-ii-ii-ii-ii-ii;
    -(c=a=getchar())-i&&main(
        (c&=ii- -ii- -ii)- -            a&&
        -ii-ii-ii-ii-ii-ii-  i-         c&&
        -ii-ii-ii-ii-ii-ii- -i- -i- -i- c&&
        iii- -ii- -ii- -ii-  i-i-i-i-i- c&&
        iii- -ii- -ii- -ii- -i-         c&&
        iii- -ii- -ii-       i-i-i-i-   c&&
        putchar(a));
}

Can perhaps be improved further, by compiling with gcc -nostartfiles, and renaming main to _start. min are removed (after some variable renaming), _s added. But then I need to use exit(), which adds 3 chars.
Instead of _start, any name can be used, and it works in Linux. This allows going down to 18 chars, but is very non-standard.

\$\endgroup\$
5
\$\begingroup\$

GolfScript (7 distinct bytes, 103 total)

Sufficiently much of an improvement over w0lf's answer that I think it qualifies as a separate one:

[9-99))--9+99))99))))))99)9+))9-9)99--)99-9+9--9+9-))99-9+9)))--9+99-9+-9+9-)99-9+9)))-)99)9-9-)))]''+-

12 distinct bytes, 13 total:

'aeiouAEIOU'-
\$\endgroup\$
1
  • \$\begingroup\$ Great! I wish I could upvote you again. \$\endgroup\$ May 29 '12 at 11:08
4
\$\begingroup\$

Golfscript (8 distinct bytes, 837 total)

[9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))]''+-

Explanation:

  1. The program creates the following array of integer values: [97 101 105 111 117 65 69 73 79 85] (corresponding to the ASCII codes of a,e,i,o,u,A,E,I,O,U). Each number is represented by pushing on stack the value 9, followed by the needed number of ) (increment operators). For example, the number 67 is obtained using 9 and 58 )s
  2. Using ''+, the array is converted into the string "a,e,i,o,u,A,E,I,O,U", representing all vowels
  3. The subtraction sign ('-') is then used to subtract all vowels from the source string

The 8 unique characters that were used: [,],9,),+,-,' and (space)

\$\endgroup\$
4
\$\begingroup\$

Unreadable (2 distinct, 2666 total)

Since everyone is posting Turing tarpits, I thought I'd use this one. It's not a very well-known one but it does exist ( http://esolangs.org/wiki/Unreadable ) and it has only two characters.

'""""'""""'""""'""""""'"""'""'""'""'""'""'""'""'""'""'"""'""""'"""""'"""""""'"""'""""'"""
"'""""'""""""'"""'""""""""'"""""""'"""'""""""'""'"""'""'""'""'""'""'""'"""""""'""'"""'"""
"'""""""'""'""'"""'""'""'""'""'""'""'""'"""""""'""'""'"""'""""""'""'""'""'"""'""'""'""'""
'""'""'""'""'"""""""'""'""'""'"""'""""'""""'""""""'""'""'""'""'"""'""'""'""'""'""'""'""'"
"'""'"""""""'""'""'""'""'"""'""""""'""'""'""'""'""'"""'""'""'""'""'""'""'""'""'""'""'""""
"""'""'""'""'""'""'"""'""""'""""""'""'""'""'""'""'""'"""'""'""'""'""'""'""'""'""'""'""'""
'"""""""'""'""'""'""'""'""'"""'""""""'""'""'""'""'""'""'""'"""'""'""'""'""'""'""'""'""'""
'""'""'""'"""""""'""'""'""'""'""'""'""'"""'""""""'""'""'""'""'""'""'""'""'""'""'"""'"""""
"""'""""""""'"""""""'""'""'""'""'""'""'""'"""'""""'""""""'""'""'""'""'""'""'""'""'""'"""'
""'""'"""""""'""'""'""'""'""'""'"""'""""'""""""'""'""'""'""'""'""'""'""'"""'""""""""'""""
""""'""""""""'""""""""'"""""""'""'""'""'""'""'""'"""'""""""'""'""'""'""'""'""'""'"""'""'"
"'"""""""'""'""'""'""'""'"""'""""'""""'""""""'""'""'""'""'""'""'"""'""""""""'""""""""'"""
""""'""'""'""'""'""'"""'""""'""""""'""'""'""'""'""'"""'""""""""'""""""""'""""""""'"""""""
"'"""""""'""'""'""'""'"""'""""""'""'""'""'""'"""'"""""""'""'""'""'"""'""""'""""'""""""'""
'""'""'"""'""'""'""'""'"""""""'""'""'"""'""""""'""'"""'""'""'""'""'""'""'"""""""'""'"""'"
"""'""""""'"""'""'""""""""""'"""""'"""""""'"""'""""'""""'""""""'""'""'""'""'""'""'""'""'"
"'""'""'"""'""'""'""'""'""'""'""'""'""'""'"""'""""""'""'""'""'""'""'""'""'""'""'""'""'""'
"""'""""""""'"""'""""'"""""""""'""""""""'"""""""'""'""'""'""'""'""'""'""'""'""'""'"""'"""
""'""""""""'"""""""'""'""'""'""'""'""'""'""'""'""'""'"""'""""'""""'""""""'""'""'""'""'""'
""'""'""'""'""'""'""'""'"""'"""""""'"""'""""""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'
"""'"""""""'"""""""'""'""'""'""'""'""'""'""'""'""'""'"""'""""'"""""""""'"""""""'""'""'""'
""'""'""'""'""'""'""'""'""'""'""'"""'"""""'"""""""'""'""'""'""'""'""'""'""'""'""'""'""'""
'""'"""'""""'""""""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'"""'""""""""'"""""""'""'""'
""'""'""'""'""'""'""'""'""'""'""'""'"""'""""""'""'""'""'""'""'""'""'""'""'""'""'""'""'"""
'""""""""'"""""""'""'""'""'""'""'""'""'""'""'""'""'""'""'"""'"""'""""'"""""""""'"""""""'"
"'""'""'""'""'""'""'""'""'""'""'""'""'"""'""""""'""'""'""'""'""'""'""'""'""'""'""'""'"""'
""'"""""""'""'""'""'""'""'""'""'""'""'""'""'""'"""'"""'""""""'""'""'""'""'""'""'""'""'""'
""'""'"""'""""""""'"""""""'""'""'""'""'""'""'""'""'""'""'""'"""'"""'""""'"""""""""'""""""
""'""""""""'""""""""'""""""""'""""""""'""""""""'""""""""'""""""""'""""""""'"""""""'""'""'
""'""'""'""'""'""'""'""'""'""'"""'"'""""""""'"""""""'"""'"""'""""""'"""'""'""""""""""
\$\endgroup\$
2
  • \$\begingroup\$ (+1) Nice ... I verified it with your interpreter. Is it still considered "unapproved", even though the creator of this language approved it? (It seems a shame that the language wasn't defined using two whitespace characters instead of single- and double-quotes ;o))) \$\endgroup\$
    – r.e.s.
    May 30 '12 at 15:02
  • \$\begingroup\$ @r.e.s. That shouldn't be hard to implement. Just pick two whitespaces and modify the interpreter so that it replaces the whitespaces by the single- and double-quotes at first! \$\endgroup\$
    – ComFreek
    May 31 '12 at 8:06
4
\$\begingroup\$

Binary Whitespace (2 distinct chars, 324 total chars)

TTSSSTTSSSSTTTSTTTSSSSSSTTSSSTSSSSSSTSTTSSSTSSSSTSSTSTTSSSTSSSTSSSTSTTSSSTSSSTSTSTSTSTTSSSTSSTSSTSSTSTTSSSTSTSSSSSTSTTSSSTSTSSSTSSTSTTSSSTSTSSTSSSTSTTSSSTSTSSTSTSTSTSTTSSSTSTSTSSTSSTSTTTTSSSTSTTSTTSTTTSSTSTTSSSSTTTSTSTSTSSSTSTTTSSTTTTSTTSTSTTTTSSTTTTTSSSTTTTSTTTTTTSSTSTTSSSSTTTSTSTSSTTSTTTSSSSTTTSTTSSTTSTTSTTTTSSSSTTTTTTTT

where S,T,L denotes Space,Tab,Linefeed, respectively. (Shamelessly obtained by converting the Whitespace answer by "breadbox" into Binary Whitespace -- this posting should probably be a comment to his answer, but it's too long.)

Binary Whitespace is Whitespace converted to a prefix-code language by everywhere using TS instead of T and using TT instead of L; e.g. the BWS instruction to push -5 onto the stack is SSTSTSSTSTT instead of SSTTSTL, etc. Link: A both-ways translator for an arbitrary 3-symbol language and its binary prefix-code versions.

NB: It would be straightforward to design a true bitwise interpreter for Binary Whitespace programs regarded as bit-sequences, rather than char-sequences (e.g. using 0,1 bit-values instead of S,T characters, respectively). The above would then be a 324-bit program requiring 41 bytes of storage.

\$\endgroup\$
2
\$\begingroup\$

VBA - 25 22 distinct bytes (120 total)

I know this won't win with so many different bytes, but here it is in VBA.

(space),(newline),",,,(,),=,a,b,c,d,e,E,I,l,n,O,p,R,S,u,1

Sub S(u)
u=Replace(Replace(Replace(Replace(Replace(u,"u","",,,1),"O","",,,1),"I","",,,1),"e","",,,1),"a","",,,1)
End Sub

*,,,1 allows for ignoring case. (1 represents the constant vbTextCompare)

\$\endgroup\$
4
  • \$\begingroup\$ You didn't count the E in End Sub. But quite nice, considering it's Basic. \$\endgroup\$ May 30 '12 at 11:38
  • \$\begingroup\$ @leftaroundabout Thanks! Absolutely right about E, and I've corrected. I think I was too worried about the meat of the Sub. ;-) \$\endgroup\$
    – Gaffi
    May 30 '12 at 11:41
  • \$\begingroup\$ Actually, as VBA as a language suppotts autoformatting, you can change your answer to be in all lower (or upper) case and VBA will correct for this itself, and because it is accepted that autoformatting languages may be considered before the autoformatting occurs, that would mean that you can drop either the e or E \$\endgroup\$ May 31 '17 at 16:16
  • \$\begingroup\$ you could configure this down to an immediate window function as ?Replace(Replace(Replace(Replace(Replace(cells(1,1),"u","",,,1),"O","",,,1),"I","",,,1),"e","",,,1),"a","",,,1) with by my count 18 Distinct Bytes ?Replace(s1,)"uOI and 111 bytes total \$\endgroup\$ May 31 '17 at 16:20
1
\$\begingroup\$

Python 3.x, 19 distinct chars, 62 total

print(''.join(x for x in input() if x.lower() not in 'aeiou'))
\$\endgroup\$
1
  • \$\begingroup\$ That doesn’t work properly on inputs like Renée’s naïveté, you know. \$\endgroup\$
    – tchrist
    May 28 '12 at 20:48
1
\$\begingroup\$

J, 21 characters (18 distinct)

'AEIOUaeiou'-.~1!:1[1
\$\endgroup\$
1
\$\begingroup\$

bash 26 distinct, 37 total

c=$(cat -)
echo "${c//[aeiouAEIOU]/}"

sorted:

""$$()-///=AEIOU[]aacccceehiootu{}"

scala> code.toList.distinct.length
res51: Int = 26

scala> code.length
res52: Int = 37

"
  ""$$()-///=AEIOU[]aacccceehiootu{}"

    
scala> code.distinct.sorted 
res56: String = 
"
 "$()-/=AEIOU[]acehiotu{}"

Result (preserves linefeeds):

echo "This program will remove VOWELS.
So we can now speak without them." | ./cg-6025-remove-vowels.sh
Ths prgrm wll rmv VWLS.
S w cn nw spk wtht thm.

For tr, it isn't clear how to count: '-d aeiouAEIOU' as 10 or 13:

echo "This program will remove VOWELS.
So we can now speak without them." | tr -d aeiouAEIOU
\$\endgroup\$
3
  • \$\begingroup\$ I considered using tr, but I concluded that since it's not a programming language it would have to be wrapped in a shell, so it would count the full text of tr -d aeiouAEIOU for 15. \$\endgroup\$ May 29 '12 at 10:44
  • \$\begingroup\$ 16 <!-- char-threshold-gymnastics --> \$\endgroup\$ May 29 '12 at 12:13
  • \$\begingroup\$ 15 distinct, 16 total. \$\endgroup\$ May 29 '12 at 12:19
1
\$\begingroup\$

K, 29. (18 distinct bytes)

{i@&~(i:0:0)in(_i),i:"AEIOU"}

distinct bytes: {@&~(:0)in_,"AEIOU}

k){i@&~(i:0:0)in(_i),i:"AEIOU"}`
Hello WoOOrld
"Hll Wrld"
\$\endgroup\$
1
\$\begingroup\$

ASM - 6 distinct characters 520 source characters (MsDOS .com)

Assembled using A86

db 10110100xb
db 00000110xb
db 10110010xb
db 11111111xb
db 11001101xb
db 00100001xb
db 01110101xb
db 00000001xb
db 11000011xb
db 10001010xb
db 11010000xb
db 10111110xb
db 00011101xb
db 00000001xb
db 10111001xb
db 00001010xb
db 00000000xb
db 01000110xb
db 00101010xb
db 00000100xb
db 01110100xb
db 11101010xb
db 11100010xb
db 11111001xb
db 10110100xb
db 00000110xb
db 11001101xb
db 00100001xb
db 11101011xb
db 11100010xb
db 01000001xb
db 00000100xb
db 00000100xb
db 00000110xb
db 00000110xb
db 00001100xb
db 00000100xb
db 00000100xb
db 00000110xb
db 00000110xb
\$\endgroup\$
1
  • \$\begingroup\$ Just write the machine language, it will be two distinct characters. \$\endgroup\$
    – ugoren
    May 31 '12 at 20:19
1
\$\begingroup\$

MATL, 8 bytes (all distinct)

t13Y2m~)

Try it on MATL Online

Just a straight up golf, didn't really find any trick to reuse characters to reduce unique bytecount.

13Y2 is a literal containing aeiouAEIOU.

Take a duplicate of the input string, make a logical (boolean) array indicating which letters of the input are not (~) members of that literal, and index ()) at those places, to return an array of only non-vowel characters.

\$\endgroup\$
1
\$\begingroup\$

K (oK), 16 bytes, 14 distinct

Solution:

^[;v,_v:"AEIOU"]

Try it online!

Explanation:

Using except (^) to filter out the vowels.

^[;v,_v:"AEIOU"] / the solution
^[;            ] / except (^) projection
      v:"AEIOU"  / save vowels as v
     _           / lowercase (_), "AEIOU" => "aeiou"
    ,            / join (,)
   v             / uppercase vowels
\$\endgroup\$
1
\$\begingroup\$

JavaScript, 6 (7325 total)

[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(+(!+[]+!+[]+!+[]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+!+[]+[!+[]+!+[]])+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]])()((!![]+[])[+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[+!+[]]]+([]+[])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[!+[]+!+[]]+(!![]+[])[+!+[]]+(+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(+(!+[]+!+[]+[+!+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+!+[]+[+!+[]])[+!+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[+!+[]+[!+[]+!+[]+!+[]]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+([][(!![]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()+[])[+[]]+(![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+[]]+([][(!![]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()+[])[!+[]+!+[]+[!+[]+!+[]]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+(![]+[+[]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+[[]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]([[]])+[]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]]+([+[]]+![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[!+[]+!+[]+[+[]]])

This uses JSFuck to turn r=>r.replace(/[aeiou]/g,"") into six unique characters.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ You would need to add the i flag as well to satisfy the challenge requirements. \$\endgroup\$
    – Makonede
    Apr 21 at 22:42
1
\$\begingroup\$

Vyxal, 4 bytes, 4 distinct characters

k∨$F

Try it Online!

Only works with single-line strings. Explanation:

      # Implicit input
k∨    # Constant "aeiouAEIOU"
  $   # Swap top two values
   F  # Remove from second string any characters in first string
      # Implicit output
\$\endgroup\$
1
\$\begingroup\$

Unary, ~3.081e1915 bytes, 1 distinct character

Specifically, this is how many 0s are required. Simply a Unary port of the brainfuck answer by @ceased to turn clockwis.

\$\endgroup\$
1
\$\begingroup\$

Jelly, 3 bytes

ḟØc

Try it online!

\$\endgroup\$
1
\$\begingroup\$

APL (Dyalog Extended), 17 bytes, 13 distinct

((⌊,⊢)'AEIOU')~⍨⊢
 (⌊,⊢)'AEIOU' ⍝ concatenate with lower case version of string
   ~⍨⊢ ⍝ remove vowels

Try it online!

\$\endgroup\$
0
\$\begingroup\$

PHP - 30 distinct bytes

<?=preg_replace('/[aeiou]/i','',fgets(STDIN));
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Couldn't you change /[aeiou|AEIOU]/ into /[aeiou]/i? Also, your code also causes | to disappear. \$\endgroup\$ May 28 '12 at 17:22
0
\$\begingroup\$

F# 105 121 91 characters

Console.ReadLine()|>Seq.filter(fun c->not("aeiouAEIOU".Contains(c)))|>Seq.iter(printf"%c")
\$\endgroup\$
1
  • \$\begingroup\$ Hmmm... I just noticed that this code will work in Linqpad but not in Visual Studio. And since I don't feel like down voting my own contribution, I will leave it here with this comment until I figure out what's wrong with it. \$\endgroup\$ May 29 '12 at 6:37
0
\$\begingroup\$

Excel Formula - 19 distinct bytes (196 total)

=,S,B,T,(,),,,",a,e,i,o,u,A,E,I,O,U,1

Cell A1: <Value>
Cell B1: =SUBSTITUTE(SUBSTITUTE(A1,"a",""),"e","")
Cell C1: =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B1,"i",""),"o",""),"u",""),"A",""),"E",""),"I",""),"O",""),"U","")

*This actually is too many nested functions to work in Excel 2003, but the concept is there.

Splitting the formulas into two cells achieved the desired effect. -- Result is in C1.

\$\endgroup\$
0
\$\begingroup\$

Noether, 16 individual bytes (17 total)

I"[aeiouAEIOU]"-P

Try it online!

Uses the regex

[aeiouAEIOU]

to remove the vowels from the input string.

\$\endgroup\$
0
\$\begingroup\$

PowerShell, 26 bytes

|%{$_-replace'[aeiou]',''}

Anything before the | will be devowel'd.

\$\endgroup\$
0
\$\begingroup\$

jq, 119 bytes, 15 distinct characters

explode-[121-2-2,111,111-2-2-2,111-2-2-2-2-2,111-12-2,111-22-2-2,111-21-11,111-22-12-2-2,111-21-21,111-22-22-2]|implode

Try it online!

Here's how is works.

explode

Converts the input, which has to be a quoted string or jq can't parse it, to an array of codepoints.

-[121-2-2,111,111-2-2-2,111-2-2-2-2-2,111-12-2,111-22-2-2,111-21-11,111-22-12-2-2,111-21-21,111-22-22-2]

Remove all occurrences of upper and lower case vowels, which are representing as numeric expressions that map to the codepoints. You COULD make a program with one less unique character by limiting the expressions to 1 and -, but it would be very long...

|implode

Converts the array of codepoints left into a string and prints it.

\$\endgroup\$
0
\$\begingroup\$

Scala, 25 total bytes, 15 distinct bytes

_ filterNot "aeiou".toSet

Try it in Scastie!

\$\endgroup\$
0
\$\begingroup\$

Python 2, 7 distinct bytes, 2091 2082 bytes

c="%c%%c%%%%c%%%%%%%%c"
ex=c==c
ee=c==""
exec"e=%x%%x"%ex%ex
exec"e%%%%%%%%=%x%%x%%%%x"%ee%ex%ee
exec"ee=%x%%x"%e%ee
exec"ee%%%%=%x%%x"%ex%e
exec"e=%x%%x"%ee%e
exec"ec=ex%cex"%e
exec"xe=ec%cec"%e
exec"xx=xe%cxe"%e
exec"xc=xx%cxx"%e
exec"ce=xc%cxc"%e
exec"cc=ce%cce"%e
exec"xee=ce%cec"%e
exec"cee=ce%cxx"%e
exec"exe=ce%cex%%cxx"%e%e
exec"xxe=ce%cec%%cxe%%%%cxx"%e%e%e
exec"cxe=ce%cec%%cxx%%%%cxc"%e%e%e
exec"ece=cc%cex"%e
exec"xce=cc%cex%%cxe"%e%e
exec"cce=cc%cex%%cxx"%e%e
exec"eex=cc%cex%%cec%%%%cxe%%%%%%%%cxx"%e%e%e%e
exec"xex=cc%cex%%cxe%%%%cxc"%e%e%e
exec"cex=cc%cex%%cec%%%%cxx%%%%%%%%cxc"%e%e%e%e
exec"exx=cc%cex%%cxe%%%%cxx%%%%%%%%cxc"%e%e%e%e
exec"xxx=cc%cex%%cec%%%%cxe%%%%%%%%cxx%%%%%%%%%%%%%%%%cxc"%e%e%e%e%e
exec"cxx=cc%cex%%cce"%e%e
exec"ecx=cc%cex%%cec%%%%cce"%e%e%e
exec"xcx=cc%cex%%cxe%%%%cce"%e%e%e
exec"ccx=cc%cec%%cxe%%%%cce"%e%e%e
exec"eec=cc%cxx%%cce"%e%e
exec"xec=cc%cex%%cxx%%%%cce"%e%e%e
exec"cec=cc%cec%%cxx%%%%cce"%e%e%e
exec"exc=cc%cxe%%cxx%%%%cce"%e%e%e
exec"xxc=cc%cec%%cxe%%%%cxx%%%%%%%%cce"%e%e%e%e
exec"cxc=cc%cex%%cec%%%%cxe%%%%%%%%cxx%%%%%%%%%%%%%%%%cce"%e%e%e%e%e
exec"ecc=cc%cxc%%cce"%e%e
exec"xcc=cc%cec%%cxc%%%%cce"%e%e%e
exec"ccc=cc%cex%%cec%%%%cxc%%%%%%%%cce"%e%e%e%e
exec"eeee=cc%cxe%%cxc%%%%cce"%e%e%e
exec"xeee=cc%cex%%cxe%%%%cxc%%%%%%%%cce"%e%e%e%e
exec"ceee=cc%cec%%cxe%%%%cxc%%%%%%%%cce"%e%e%e%e
exec"exee=cc%cex%%cec%%%%cxe%%%%%%%%cxc%%%%%%%%%%%%%%%%cce"%e%e%e%e%e
exec"xxee=cc%cxx%%cxc%%%%cce"%e%e%e
exec"""x=""
"""
exec"x%c=c%%xcx%%xxee%%xcx%%ecx"%e
exec"x%c=c%%xee%%xee%%xxe%%cec"%e
exec"x%c=c%%cxc%%xec%%xxc%%cee"%e
exec"x%c=c%%ecx%%eec%%xcc%%cee"%e
exec"x%c=c%%xcx%%ceee%%cxx%%exc"%e
exec"x%c=c%%cee%%ecx%%exe%%exe"%e
exec"x%c=c%%ccx%%cxc%%xcc%%ce"%e
exec"x%c=c%%ecx%%ce%%xec%%xxc"%e
exec"x%c=c%%ce%%ecx%%xxee%%xxe"%e
exec"x%c=c%%ccc%%ecc%%exc%%xec"%e
exec"x%c=c%%eeee%%cee%%exe%%exe"%e
cx="""ecc
xcc
xec
xxc
eeee
xee
xee
xxe
cec
cxc
xec
xxc
cee
cxx
cex
cxx
ce
xec
xxc
xee
cxx
xcx
xec
cxc
xeee
ece
xce
cce
eex
xex
xee
cxe
exx
ccx
cxc
xcc
ce
cxx
ce
xec
xxc
ce
xcc
cxx
exee
xxx
xec
xxc
ecc
xeee
eeee
cee
exe
exe"""
exec"exec%cx"%ce

Try it online!

I'm using the algorithm of this question to translate the following code in the code above to only use e, x, c, ", =, % and newline. Make sure to follow the link to understand how the transformation works

code before transformation: (57 54 bytes)

print"".join(a[a in"aeiouAEIOU":]for a in raw_input())

Try it online!

Even if the first code isn't golfed, this one is :p

Thanks to dingledooper for -3 bytes on the second program

\$\endgroup\$
2
  • 1
    \$\begingroup\$ By the way, I think you can do a[a in"aeiouAEIOU":] which is 3 bytes shorter. \$\endgroup\$ Jun 5 at 1:19
  • \$\begingroup\$ @dingledooper I didn' thought of that. Thanks :) \$\endgroup\$
    – Jakque
    Jun 5 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.