72
\$\begingroup\$

Inspiration: in 1939, a man named Ernest Vincent Wright wrote a novel called Gadsby without using the letter 'e'.

Your task is to write a set of (up to 5) programs in any language (which has a text-based syntax*) to output all 26 letters of the alphabet in order. However for each vowel aeiou, at least one of the programs must not include any occurrence of the vowel.

So there must be

  • a program that does not use 'a' or 'A' anywhere in the syntax of the program.
  • a program that does not use 'e' or 'E' anywhere in the syntax of the program.
  • a program that does not use 'i'  or 'I' anywhere in the syntax of the program.
  • a program that does not use 'o' or 'O' anywhere in the syntax of the program.
  • a program that does not use 'u' or 'U' anywhere in the syntax of the program.

All of them must output abcdefghijklmnopqrstuvwxyz.

The winner shall be the solution where the length of all programs is the shortest.

* since the constraint wouldn't be much of a challenge in Piet or Whitespace


Current rankings (06 Mar 2014):

The Catalogue

The Stack Snippet at the bottom of this post generates the catalogue from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

## Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

## Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

## Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the snippet:

## [><>](https://esolangs.org/wiki/Fish), 121 bytes

/* Configuration */

var QUESTION_ID = 196898; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 8478; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });  
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];
  
  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
    });
    
    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    else console.log(body);
  });
  
  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;
    
    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    lang = jQuery('<a>'+lang+'</a>').text();
    
    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body {
  text-align: left !important;
  display: block !important;
}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 500px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">
<div id="language-list">
  <h2>Shortest Solution by Language</h2>
  <table class="language-list">
    <thead>
      <tr><td>Language</td><td>User</td><td>Score</td></tr>
    </thead>
    <tbody id="languages">

    </tbody>
  </table>
</div>
<div id="answer-list">
  <h2>Leaderboard</h2>
  <table class="answer-list">
    <thead>
      <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>
    </thead>
    <tbody id="answers">

    </tbody>
  </table>
</div>
<table style="display: none">
  <tbody id="answer-template">
    <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>
<table style="display: none">
  <tbody id="language-template">
    <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>

\$\endgroup\$
  • 4
    \$\begingroup\$ @w0lf: No, it says "up to 5 programs" and "length of all programs", which I read as "there can be only one program and its length counts in this case". \$\endgroup\$ – schnaader Apr 24 '12 at 11:09
  • 9
    \$\begingroup\$ @PeterTaylor: You don't think having to avoid using vowels in your syntax is a unique challenge? As a JS programmer, it's especially interesting :) \$\endgroup\$ – mellamokb Apr 24 '12 at 13:51
  • 2
    \$\begingroup\$ Are newlines acceptable in the output (i.e. one per character)? I can shorten some of my code if that is the case... \$\endgroup\$ – Gaffi Apr 24 '12 at 21:17
  • 2
    \$\begingroup\$ Is uppercase output allowed? \$\endgroup\$ – Erik the Outgolfer Sep 16 '16 at 11:09
  • 2
    \$\begingroup\$ I'm the OP. Uppercase not allowed. \$\endgroup\$ – shamp00 Sep 17 '16 at 5:21

117 Answers 117

1 2 3
4
1
\$\begingroup\$

Groovy, 15 + 10 = 25 bytes

{'\u0061'..'z'}

Defines an anonymous function that returns the alphabet. Does not use a, e, i or o.

{'a'..'z'}

Defines an anonymous function that returns the alphabet. Does not use e, i, o or u.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Jelly, 7 chars

”Ø;97ỌV

Try it online!

Seems like this should (not (non-competing)) be accepted instead of GolfScript.

Note:

Ø and are not O, so this is valid. Here is how I built it:

My initial program (2 bytes) was:

Øa

But, since it contained an a, I had to change it.

This could have been a valid 6-char program if uppercase output was allowed:

65r90Ọ
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ The language is way newer than the challenge, so no, it should not be accepted instead of Golfscript. See this meta \$\endgroup\$ – Sanchises Sep 16 '16 at 14:31
  • \$\begingroup\$ @sanchises Oh, if it is newer, then OK. I thought it was appropriate, since I neither knew when the first commit was made nor when the required commit for this to work was made. \$\endgroup\$ – Erik the Outgolfer Sep 16 '16 at 14:40
  • \$\begingroup\$ I guess the purpose of that rule is also to prevent flooding of old challenges with new languages - golfing languages are now much more commonplace. \$\endgroup\$ – Sanchises Sep 16 '16 at 15:38
  • \$\begingroup\$ @sanchises I don't think it's there for that reason; it's there to prevent cheating by creating languages which just do the task on encountering the empty program. \$\endgroup\$ – Erik the Outgolfer Sep 16 '16 at 21:04
  • \$\begingroup\$ Note: "I guess (...) also (...)". I know what the main reason is for the rule, but it's strictness has some side effects that I'm sure were considered, and not seen as a deal-breaker for making the rule so strict, which generally means the side-effects were considered at least somewhat beneficent. But that's just my interpretation of ppcg politics. ;) \$\endgroup\$ – Sanchises Sep 16 '16 at 21:17
1
\$\begingroup\$

Python 2, 91 bytes

Vowels are escaped with octal where necessary.

No ae

print"\141bcd\145fghijklmnopqrstuvwxyz"

No iou

exec"pr\151nt''.j\157\151n(map(chr,range(97,123)))"
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

05AB1E, 4 bytes

žpRl

Try it online!

Explanation:

žp     Push 'ZYXWVUTSRQPONMLKJIHGFEDCBA'
  R    Reverse string - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
   l   Lowercase - 'abcdefghijklmnopqrstuvwxyz'
       Implicitly print
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Perl 6, 49 bytes

("a".."z").map(*.print) # 23 bytes, no E, O, or U
$*OUT.put((97..122)>>.chr) # 26 bytes, no A, E, or I
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Bean (non-competing), 38 bytes

Hexdump:

00000000 37 cd a0 5e 80 25 81 00 cc a0 5e 84 25 81 01 80  7Í ^.%..Ì ^.%...
00000010 26 4d a0 5d 81 53 d0 80 a0 0e 20 80 24 4b 80 20  &M ].SÐ. . .$K. 
00000020 5e b9 37 b1 b2 33                                ^¹7±²3
00000026

The equivalent JavaScript is:

for(b=97;b<123;)a+=String.fromCharCode(b++);

Alternatively, another 38 byte solution is:

00000000 bc 81 3d a0 5e 25 81 00 35 cc a0 5e 84 25 81 01  ¼.= ^%..5Ì ^.%..
00000010 26 4d a0 5d 81 53 d0 80 a0 0e 20 80 24 4b 80 20  &M ].SÐ. . .$K. 
00000020 5e b9 37 b1 b2 33                                ^¹7±²3
00000026

which is equivalent to the JavaScript:

var b=97;while(b<123)a+=String.fromCharCode(b++);

This takes advantage of the fact that a is defined as "" when there is no input, and that the last executed a+=... is implicitly printed, and contains the full string of the alphabet.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

V, 5 bytes, non-competing

¬`{Ó×

Try it online!

Explanation

¬`{                         " inserts characters in range `to {

This outputs

`abcdefghijklmnopqrstuvwxyz{

To remove the extraneous output, we can use a replacement

Ó×                          " remove every non-alphanumeric character in this line

                            " synonym of vim's :s/\W//g

Alternatives

¬`z|x                       " prints every character from ` to z and
                            " removes the first character
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Befunge-98, 19

'`1+>:#;,1+:'{-#;_@

Explanation:

'`1+                   Initialize stack with ascii value for 'a'
     :  ,              Duplicate top of stack, print it
         1+:'{-        Increment top of stack, push zero if ascii value after 'z'
    > #;       #;_@    Loop until top of stack is zero, then end
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Befunge, 16 bytes

1+:"`"+,:55*`#@_

Try it online!

Explanation

1+                  Increment the loop index which start with an implicit zero.
  :"`"+             Make a duplicate and add 96 to convert that into a lowercase letter.
       ,            Write the letter to stdout.
        :55*`       Check if the index is greater than 25 (i.e. it's the last letter).
             #@_    If so, branch left and exit, otherwise branch right and loop.   
   
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

DUP, 16 bytes

97[$123<][$,1+]#

Explanation:

97                  {push ASCII for “a” on stack}
  [     ][    ]#    {while [this is not 0][do this]}
   $                {duplicate top stack element}
    123             {push 123 on stack (ASCII value of “z”+1}
       <            {2nd element < top element? if true then push -1, if false then push 0}
          $         {duplicate top stack element}
           ,        {print character of top stack element to STDOUT}
            1+      {add 1 to top stack element}

Online DUP interpreter is available here.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Recursiva, 1 byte

)

Try it online!

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ Why would this be non-competing? \$\endgroup\$ – LyricLy Sep 11 '17 at 5:07
  • \$\begingroup\$ @LyricLy Because The feature(in fact the whole language) was made later to the problem? :D I am unsure though! \$\endgroup\$ – officialaimm Sep 11 '17 at 6:10
  • 1
    \$\begingroup\$ We have consensus that newer languages are no longer non-competing. \$\endgroup\$ – LyricLy Sep 11 '17 at 6:48
1
\$\begingroup\$

Kotlin, 112 111 bytes

No E O U (29 bytes)

{('A'..'Z').map{println(it)}}

No A (39 bytes)

{(('B'-1)..'Z').filter{print(it);2>=1}}

No I (44 bytes)

{('A'..'Z').map{z->System.out.format(""+z)}}
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

VBA, 70 Bytes

Unfortunately having one brute force solution was better than having multiple looping solutions :(

Anonymous VBE immediate window function that takes no input and outputs the capitalized alphabet to the VBE immediate window

?Chr(97)"bcd"Chr(101)"fgh"Chr(105)"jklmn"Chr(111)"pqrst"Chr(117)"vwxyz
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Braingolf, 12 bytes

62g[59gl+]&@

Try it online!

As I have just learned this language, its probably golfable.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Sinclair ZX80 BASIC, ~26 [tonkenized] BASIC bytes

 1 FOR O=38 TO 63
 2 PRINT CHR$(O);
 3 NEXT O

No A or U in this answer. Sinclair ZX80 and ZX81 character codes begin at 38, which is non-ASCII compliant.

Sinclair ZX80 BASIC (only using I), 237 ~73 [tonkenized] BASIC bytes

 1 PRINT CHR$(38);"BCD";CHR$(42);"FGHIJKLMN";CHR$(52);"PQRST";CHR$(58);"VWXYZ"
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Nice. You need to add the bytes from programs with no I and no O. \$\endgroup\$ – shamp00 Dec 20 '17 at 23:02
  • \$\begingroup\$ For other solutions, I'll have to use assembly, so I'm thinking about that one, I'll update shortly. \$\endgroup\$ – Shaun Bebbers Dec 21 '17 at 10:33
1
\$\begingroup\$

Pyt, 1 byte

ɫ

Implicitly prints "abcdefghijklmnopqrstuvwxyz"

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Pushy, 4 bytes

Only requires a single program:

26XQ

Try it online!

26X   \ Push range(0, 26), E(X)clusive.
   Q  \ Convert to relative uppercase alphabet letters and print.
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Jelly, 7 bytes

”Ø;“b»V

Try it online!

Uses Jelly string compression to get A, prepends Ø to get alphabet from alphabet constant (ØA), and evals.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Java 8, 517 262 characters

-255 bytes thanks to @OlivierGrégoire.

No aeio (165):

\u0069nt\u0065rf\u0061c\u0065 M{st\u0061t\u0069c v\u006F\u0069d m\u0061\u0069n(Str\u0069ng[]b){f\u006Fr(ch\u0061r c=97;c<123;)Syst\u0065m.\u006Fut.pr\u0069nt(c++);}}

Try it online.

No u (97):

interface A{static void main(String[]a){for(char c=97;c<123;)System.console().printf("%c",c++);}}

Note that the program for u makes use of System.console(), which will return null (and thus cause the code to throw a NullPointerException) if you call it from anything other than your OS' native terminal (cmd on Windows, bash on Linux/OSX, etc.)

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ You can use System.err.printf("%c",c++); for u source code in place ofSystem.console().printf("%c",c++); \$\endgroup\$ – Numberknot Oct 26 '16 at 16:52
  • 1
    \$\begingroup\$ You should mash them all in 2 programs: one without a, e, i, o and another without u. \$\endgroup\$ – Olivier Grégoire Sep 11 '17 at 5:53
1
\$\begingroup\$

Gol><>, 9 bytes

`z9sF:M|H

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Ahead, 12 bytes

"bz"69M:1-W@

"bz"          push b (98) then z (122)
    69M       push 69 (charcode for E) then evaluate (E = expand range)
       :1-    dup stack top then sub 1 to get a
          W@  print all chars then exit

Try it online!

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

AWK,35 (using o,i)

END{for(_=0;_++<26;)printf"%c",96+_}

neglected E from the count considering 'E'!='e'

;)

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Julia, 12

['b'-1:'z']

Though the output doesn't look all that nice.

26-element Array{Char,1}:
'a'
'b'
'c'
.
.
.
'z'
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

JS, 43

Run this in the browser's console or nodeJS. Uses no vowels.

Outputs happens in the console.

To output it in the browser, add alert or document.write around it, but it's longer.

"\141bcd\145fgh\151jklmn\157pqrst\165vwxyz"

or

"\x61bcd\x65fgh\x69jklmn\x6fpqrst\x75vwxyz"
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

beeswax, 28 chars

Non-competing answer. I created beeswax in December 2015, long after the challenge was posted. Just trying out how well beeswax is able to perform in comparison to other languages.

>@5~5.P@>}@Mq
dP(6~4_#dP@#"<

You can clone my GitHub repository, containing the interpreter, written in Julia, the language specs and examples.

| improve this answer | |
\$\endgroup\$
-2
\$\begingroup\$

Python 48 chars without a e o u

print'\x61bcd\x65fgh\x69jklmn\x6fpqrst\x75vwxyz'
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ What about no i? It is surely possible. Something like exec'pr\x69nt...'. Also, the header should say "Python 2", if you want to be exact. \$\endgroup\$ – Erik the Outgolfer Sep 16 '16 at 21:18
-3
\$\begingroup\$

JavaScript, 43 Chars (run in terminal)

"\141bcd\145fgh\151jklmn\157pqrst\165vwxyz"
| improve this answer | |
\$\endgroup\$
  • 2
    \$\begingroup\$ This just generates the alphabet, not outputs it as required. \$\endgroup\$ – manatwork Apr 9 '13 at 16:31
1 2 3
4

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