74
\$\begingroup\$

Our task is to, for each letter of the (English) alphabet, write a program that prints the alphabet, in a language whose name starts with that letter.

Input: none

Output:

abcdefghijklmnopqrstuvwxyz

uppercase and trailing newline optional

Rules:

  • The scoring metric is the length of the programming language name, plus the length of the code. Hence, C will be assessed a "penalty" of 1, while GolfScript will be assessed a penalty of 10.
  • One language/implementation per answer. Multiple answers are encouraged.
  • If a programming language name's first letter is not an English letter, it should not be coerced into one. It will be treated as a separate letter (meaning less competition).
  • No answer will be accepted until every English letter has a solution.

Current rankings:

Tell me if I'm missing anybody.

Automatic leaderboard (experimental)

var QUESTION_ID=2078;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&r.indexOf('non-competing')===-1&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],lang:/<a/.test(a[1])?jQuery(a[1]).text():a[1],link:s.share_link})}),e.sort(function(e,s){var d=e.lang[0].toLowerCase(),a=s.lang[0].toLowerCase();return(d>a)-(d<a)||e.size-s.size});var s={},a=null,n="A";e.forEach(function(e){n=e.lang[0].toUpperCase(),a=e.size;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+" is for").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.lang,p=o[0].toUpperCase();s[p]=s[p]||{language:e.language,lang:e.lang,letter:p,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return(e.letter>s.letter)-(e.letter<s.letter)});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.language).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),jQuery("#languages").append(jQuery(i))}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*(?:<[^>]+>)?(?:[^]+?for )?((?:<a[^>]*?>)?(?:(?! [(=→-])[^\n,:])*[^\s,:])(?:[,:]| [(=→-]).*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px} /* font fix */ body {font-family: Arial,"Helvetica Neue",Helvetica,sans-serif;} /* #language-list x-pos fix */ #answer-list {margin-right: 200px;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Winners by Letter</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <h2>Everything</h2> <table class="answer-list"> <thead> <tr><td></td><td>Language</td><td>Author</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <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\$
9
  • 1
    \$\begingroup\$ Are we allowed to print junk to stderr? \$\endgroup\$ Apr 18, 2011 at 22:02
  • \$\begingroup\$ @Peter Taylor: Go nuts. To answer your question, yes, printing junk to stderr is fine (as long as stdout is correct). \$\endgroup\$
    – Joey Adams
    Apr 18, 2011 at 22:05
  • \$\begingroup\$ Is it OK to print the alphabet IN BIG LETTERS? \$\endgroup\$
    – SE is dead
    Jun 21, 2016 at 18:25
  • \$\begingroup\$ Funge is distinct from Befunge. Surely my pedanticism will be rewarded on a site dedicated to feats of it! \$\endgroup\$
    – tngreene
    Mar 23, 2017 at 19:53
  • 7
    \$\begingroup\$ Is *0*5AB1E the same as *o*sabie :P? \$\endgroup\$ Jun 6, 2019 at 14:58

164 Answers 164

1 2 3 4 5
6
0
\$\begingroup\$

Jsonnet (with -S), 37 characters, score: 44

std.repeat("%c",26)%std.range(97,122)

Sample run:

bash-5.0$ jsonnet -Se 'std.repeat("%c",26)%std.range(97,122)'
abcdefghijklmnopqrstuvwxyz
\$\endgroup\$
0
\$\begingroup\$

C is for C, 34 bytes + 1 = 35

c(i){for(i=26;i;)putchar(91-i--);}
\$\endgroup\$
1
  • \$\begingroup\$ 33 bytes \$\endgroup\$
    – jdt
    Sep 24, 2021 at 14:49
0
\$\begingroup\$

X is for XJam, 6 + 4 = 10

'[,65>

What is XJam, you may ask? It's a language I started creating earlier this year and gave up before doing anything really interesting. It technically does fulfill its design criteria though, which is to be a version of CJam which adapts to the informal specification in the xkcd comic X. It accomplishes this by using a custom charset where Unicode characters representing variations on the letter X fill the top 32 slots in what's otherwise standard 7-bit ASCII. Those characters are then the only ones which can be used as variables. It also happens to be perfect for this challenge, beating the previous x answer by two. (Sorry Peter Cordes, that x86 answer was great!)

Credit where it's due, the code is taken from Lynn's answer on a different question here. It doesn't use variables so it ports over perfectly.

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

Eso2D, 15 bytes + 5 = 20

2v
,>#1~5
@#,5<

Eso2D is a language starting with E that has a relatively short name and an instruction set very good for string construction that I found on the esolang wiki. This could probably be improved further, but it's more than enough for a new best E.

Explanation:

2v        Increment the accumulator by 97 and move down to the second row
,>#1~5    Loop (from wrapping): print num to char, add 50, check if > 170, decrement by 49 otherwise.
@#,5<     Once it hits 171, decrement by 49 and print one last time before stopping.
\$\endgroup\$
0
\$\begingroup\$

Foo, 11 bytes, score 14

&65(91$c+1)

Try it online!

&65(91$c+1)

&65           # Set current cell to 'A'
   (91    )   # While current cell != 'Z'+1
      $c      # Print ASCII of current cell 
        +1    # Increment current cell

Beats the previous Foo answer by not using another cell.

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

P is for Pyt, 4 bytes

ɫ

Try it online!

Gotta love builtins

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

T is for Thunno, 2 + 6 = 8

Az

Attempt This Online!

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

G is for gs2, 1 + 3 = 4 bytes

à

Uses the CP437 encoding.

Hexdump:

85

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

B is for BQN, 7 bytes + 3 = score 10

'a'+↕26

Try it at BQN REPL

    ↕26     # range from 0 to 25
   +        # add to 
'a'         # character 'a'
\$\endgroup\$
0
\$\begingroup\$

U is for Uiua, 6 bytes, Score 10

+@A⇡26

First Non-Vyxal answer

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

E is for ESMin, 2 Bytes, Score 2+5 = 7

Try it online, firefox only

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

O is for Ohm v2, 3 bytes, 6+3 = 9

αa,

Try it online!

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

RProgN, 1 byte, 6+1=7

a

Try it online!

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

Implicit, 7 bytes, 7+8=15

26¡"é64

Try it online!

26¡"é64­⁡​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‎⁡⁠⁣‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌­
26¡      # ‎⁡range [1,26]
   "     # ‎⁢convert entire stack to ascii character
    é64  # ‎⁣increment each character by 64
💎

Created with the help of Luminespire.

\$\endgroup\$
1 2 3 4 5
6

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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