Print/Output the L-phabet

66

7

Inspired by George Gibson's Print a Tabula Recta.

You are to print/output this exact text:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ

(Yes, I typed that by hand)

You are allowed to use all lowercase instead of all uppercase.

However, your choice of case must be consistent throughout the whole text.

Rules/Requirements

  • Each submission should be either a full program or function. If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. Anything else (e.g. headers in C), must be included.
  • If it is possible, provide a link to a site where your program can be tested.
  • Your program must not write anything to STDERR.
  • Standard Loopholes are forbidden.
  • Your program can output in any case, but it must be printed (not an array or similar).

Scoring

Programs are scored according to bytes, in UTF-8 by default or a different character set of your choice.

Eventually, the answer with the least bytes will win.

Submissions

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 leaderboard snippet:

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

Leaderboard

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

/* Configuration */

var QUESTION_ID = 87064; // 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 = 48934; // 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,]*[^\s,]),.*?(\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,
      });
    
  });
  
  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;
    if (/<a/.test(lang)) lang = jQuery(lang).text();
    
    languages[lang] = languages[lang] || {lang: a.language, 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 > b.lang) return 1;
    if (a.lang < b.lang) 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}

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

#language-list {
  padding: 10px;
  width: 290px;
  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="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">
<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>
<div id="language-list">
  <h2>Winners 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>
<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>

Leaky Nun

Posted 2016-07-31T14:00:16.450

Reputation: 45 011

1Related. – Leaky Nun – 2016-07-31T14:03:44.660

5Can the output (as the return value from a function) be an array of lines? – Doorknob – 2016-07-31T14:55:49.413

@Doorknob I would say no. – Leaky Nun – 2016-07-31T14:56:39.677

@GeorgeGibson Yes. – Leaky Nun – 2016-07-31T17:36:15.897

@LeakyNun Is a trailing newline allowed? – Jakube – 2016-08-01T10:58:13.233

@Jakube On the condition that the interpreter does not produce another trailing newline. – Leaky Nun – 2016-08-01T10:58:52.230

I'm tried of the "here's text X. Print this" kind of challenges. – Buffer Over Read – 2016-11-11T19:15:57.303

Answers

61

Excel, 19,604 bytes

=CHAR(64+MAX(COLUMN(),ROW()))

Paste this formula in A1, then drag all over A1:Z26.

Byte count:

  1. The formula is 27 bytes.
  2. You need to copy it 26^2 times. 27*26*26=19604.
  3. I and others thought the score should be lower because you don't really need to type the formula again and again. I now think it's irrelevant - we count the size of the program, not the work spent writing it.
  4. For comparison - see this 28,187 chars JS answer - obviously, someone generated it rather than typing all this, but it doesn't change its size.

ugoren

Posted 2016-07-31T14:00:16.450

Reputation: 16 527

22this made me laugh, you should post on meta sking how to count this – Rohan Jhunjhunwala – 2016-07-31T15:26:48.543

Just omit the cell reference; the default is the current cell. – Joffan – 2016-07-31T16:51:15.123

19A fair count for this would be 45: (1) type A1:Z26 in the Name Box (left of the formula bar) [7 bytes]; (2) type =CHAR(64+MAX(COLUMN(),ROW()))+enter in the formula bar [30 bytes]; (3) type Alt E I D Alt E I R to fill the selected range [8 bytes]. Total 7+30+8= 45. – Joffan – 2016-07-31T17:41:37.147

PErhaps some more bytes for moving the cursor – Rohan Jhunjhunwala – 2016-07-31T18:10:20.407

@Joffan (pcg thinks this improved the comment) – Rohan Jhunjhunwala – 2016-07-31T18:10:48.503

@RohanJhunjhunwala 46 keystrokes, then: f5 A1:Z26 enter =CHAR(64+MAX(COLUMN(),ROW())) enter Alt EID Alt EIR - except you can hit Tab after typing CH to get CHAR( and after typing COL to get COLUMN(, so maybe only 41 keystrokes? – Joffan – 2016-07-31T18:32:21.347

8I don't think that counting autocomplete as as a lesser amount of bytes. Then I could arguably shrink my java down by arguing netbeans autcomplete. I think the measure by keystrokes 46 keystrokes is more fair – Rohan Jhunjhunwala – 2016-07-31T18:38:58.347

I once had a submission which consisted of 2 files plus 62 identical copies. The prevailing view at the time was that each copy cost 1 byte. At that rate, this would cost around 700 bytes. – Neil – 2016-07-31T21:01:10.480

It's 18252 bytes. – Erik the Outgolfer – 2016-08-01T07:57:49.133

2{=CHAR(64+IF(COLUMN()>ROW(),COLUMN(),ROW()))} Saves the problem of duplicating the formula – Robin Gertenbach – 2016-08-01T08:58:36.713

3@rohan I, for one, would be perfectly fine with you calling Java + autocomplete a language. – John Dvorak – 2016-08-01T16:02:22.427

So would it be a language of its own? – Rohan Jhunjhunwala – 2016-08-01T17:16:01.913

@ugoren you should remove the parenthesis in your explanation now that you use the current cell as a reference. – Aaron – 2016-08-01T22:53:39.697

@RobinGertenbach I was looking at the array formula option but the MAX call was screwing it up, so well done. – Joffan – 2016-08-02T18:05:36.157

@RohanJhunjhunwala 33-4=29 bytes, not 27. – Joffan – 2016-08-02T18:07:16.927

@Joffan - if VBA is open, in the immediate window you could just set the range directly to the formula, possibly saving even more keystrokes – BruceWayne – 2016-08-03T06:53:26.580

1@BruceWayne Range("A1:Z26").Formula="=Char(64+Max(Row(),Column()))" is 55 bytes, but not a bad solution in its own right. – Joffan – 2016-08-03T13:27:00.150

If it is 27 bytes per formula, that this answer has a worth of 18k+ bytes – Anthony Pham – 2016-08-03T23:33:06.120

5@Joffan [A1:Z26]="=CHAR(64+MAX(COLUMN(),ROW()))" is 40 bytes and is still elegant – Anastasiya-Romanova 秀 – 2016-08-22T13:00:08.340

@Anastasiya-Romanova秀 nice golfing. – Joffan – 2016-08-23T06:40:58.913

Is it a "not try to golf"? – l4m2 – 2018-07-14T02:45:33.280

39

Vim, 43 bytes

:h<_↵jjYZZPqqlmaYp`ajyl:norm v0r♥"↵`ajq25@q

Here represents Return (0x0a) and represents Ctrl-R (0x12).

Not quite as short as my Tabula Recta answer, but…

enter image description here

Lynn

Posted 2016-07-31T14:00:16.450

Reputation: 55 648

3what. the. hell. is. this. godforsaken. magic. – haneefmubarak – 2016-08-04T21:27:47.460

1What help page are you opening? When I do h<_↵ It brings me to :help at_t – James – 2016-08-23T19:34:24.370

I’m opening v_b_<_example in Vim 7.4 for Cygwin. – Lynn – 2016-08-23T19:37:12.320

@haneefmubarak Yes, it is the magic of Vim. – Chromium – 2018-07-15T02:07:03.753

28

Jelly, 6 bytes

ØA»'j⁷

Try it here. If only I hadn’t been lazy yesterday and implemented that one-byte alternative to j⁷ (join by newlines)…

ØA      The uppercase alphabet.
  »'    Table of max(x, y).
    j⁷  Join by newlines.

Lynn

Posted 2016-07-31T14:00:16.450

Reputation: 55 648

7Argh, ninja'd by a few minutes... That alternative wouldn't have helped since the chain would fork. – Dennis – 2016-07-31T16:10:06.723

Stupid question, but if this is 6 bytes, what character set is it in? – Mr Lister – 2016-08-02T09:38:04.617

@MrLister: I added a link to the Jelly code page in the answer’s title. – Lynn – 2016-08-02T10:15:43.257

Join by linefeed is Y. – PurkkaKoodari – 2016-10-26T10:01:19.130

@Pietu1998 I think Y post dates the challenge though – caird coinheringaahing – 2017-08-29T22:21:07.713

17

brainfuck, 103 96 95 91 87 bytes

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

This uses Esolangs' brainfuck constant for 64. Try it online!

Dennis

Posted 2016-07-31T14:00:16.450

Reputation: 196 637

16

///, 141 94 92 82 bytes

/:/\\\\A//#/:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z://:/\/a#
\/a\///A/#

Try it online: Demonstration

Quite a fun language.

Explanation:

Shortend code to only print a 4x4 square:

/:/\\\\A//#/:b:c:d://:/\/a#
\/a\///A/#

The first replacement /:/\\\\A/ replaces : with \\A. This gives:

/#/\\Ab\\Ac\\Ad\\A//\\A/\/a#
\/a\///A/#

Then /#/\\Ab\\Ac\\Ad\\A//\\A/ replaces # with \Ab\Ac\Ad\A:

/\\A/\/a\Ab\Ac\Ad\A
\/a\///A/\Ab\Ac\Ad\A

Now /\\A/\/a\Ab\Ac\Ad\A<newline>\/a\// replaces each \A in the subsequent code by /aAbAcAdA<newline>/a/, so this results in:

/A//aAbAcAdA
/a/b/aAbAcAdA
/a/c/aAbAcAdA
/a/d/aAbAcAdA
/a/

Now the first part /A// removes all As.

abcd
/a/b/abcd
/a/c/abcd
/a/d/abcd
/a/

The first five characters abcd<newline> get printed. The next command /a/b/ replaces a by b, resulting in:

bbcd
/b/c/bbcd
/b/d/bbcd
/b/

Again the first five characters bbcd<newline> get printed. The next command /b/c/ replaces b by c:

cccd
/c/d/cccd
/c/

Again the first five characters cccd<newline> get printed. The next command /c/d/ replaces c by d:

dddd
/d/

The first five characters dddd<newline> get printed. And the next command /d/ is incomplete and therefore does nothing.

Jakube

Posted 2016-07-31T14:00:16.450

Reputation: 21 462

Damn, this is clever. Nice work. :) Any ideas for a solution along these lines to the tabula recta challenge? – Martin Ender – 2016-08-01T11:36:08.923

@MartinEnder No, not yet. I'll look at it in the evening. Extended the lunch break already to a full hour (twice as much a usual) because of this challenge. – Jakube – 2016-08-01T11:43:16.057

I figured something out (with a lot of help from your ideas, especially the way you modify subsequent instructions to process one character after the other). – Martin Ender – 2016-08-02T07:57:15.580

15

Dyalog APL, 11 bytes

⎕A[∘.⌈⍨⍳26]

A[...] pick elements from the uppercase alphabet according to
    ∘.⌈⍨ the maximum table of
    ⍳26 the first 26 integers

TryAPL online!

Adám

Posted 2016-07-31T14:00:16.450

Reputation: 37 779

10

Mathematica, 69 65 57 bytes

Saved 8 bytes due to @MartinEnder.

FromCharacterCode[64+Max~Array~{26,26}]~StringRiffle~"
"&

Anonymous function. Takes no input and returns a string as output. Basically just takes char('A' + max(x, y)) for all x, y from 1 to 26.

LegionMammal978

Posted 2016-07-31T14:00:16.450

Reputation: 15 731

5Congrats on 10k! – Loovjo – 2016-07-31T16:05:49.860

9

///, 348 bytes

/|/\/\///v/NNN|u/MMM|t/LLL|s/WXYZ|r/OOO|q/KLMa|p/RRRR|o/QQQQ|n/PPPP|m/SSS|l/EFGc|k/RSTb|j/UUUU|i/TTTT|h/WWW|g/VVV|f/XXXX|e/ZZZZZ|d/YYYYY|c/HIJq|b/UVs
|a/NOPQk/ABCDlBBCDlCCCDlDDDDlEEEElFFFFFFGcGGGGGGGcHHHHHHHcIIIIIIIIIJqJJJJJJJJJJqKKKKKKKKKKqttttMauuuuMavvvvNarrrrrPQknnnnQkooooQkppppRkmmmmmmSTbiiiiibjjjjjbgggggggVs
hhhhhhhWs
ffffffYZ
dddddZ
eeeeeZ

Try it online!

I've used the same technique to build this as for my /// answer to the challenge this was based on. However, I had to fix the CJam script because it didn't correctly handle substrings that can overlap themselves.

Martin Ender

Posted 2016-07-31T14:00:16.450

Reputation: 184 808

I really need to learn this language... – George Gibson – 2016-07-31T19:34:42.023

9

Retina, 41 bytes

Byte count assumes ISO 8859-1 encoding. The leading linefeed is significant.


26$*Z
{`^[^A].+
$&¶$&
}T0-2`L`_L`^(.)\1+

Explanation


26$*Z

Set the string to 26 copies of Z. Then the {...} instruct Retina to perform the remaining two instructions in a loop until the string stops changing.

{`^[^A].+
$&¶$&

Duplicate the first line if it doesn't start with an A.

}T0-2`L`_L`^(.)\1+

This is a transliteration stage. It is only applied if the string starts with at least two copies of the same character. If so, all but the last of those characters are decremented. The decrementing happens by mapping L (upper case alphabet) to _L (blank followed by upper case alphabet). The "all but the last" is indicated by the limit -2 which tells Retina only to transliterate all characters up to the second-to-last in the match.

Try it online!

Martin Ender

Posted 2016-07-31T14:00:16.450

Reputation: 184 808

2Congratz for 100k! :) – Yytsi – 2016-08-01T10:00:24.527

8

Haskell, 35 bytes

a=['A'..'Z']
unlines$(<$>a).max<$>a

Lynn

Posted 2016-07-31T14:00:16.450

Reputation: 55 648

8

Python 2, 59 bytes

n=0;exec'print bytearray([n+65]*n+range(n+65,91));n+=1;'*26

Test it on Ideone.

Dennis

Posted 2016-07-31T14:00:16.450

Reputation: 196 637

7

Sesos, 25 bytes

0000000: 2829c0 756fc6 aecae2 aecd9c 39e09e 099c63 7d8e3d  ().uo.......9....c}.=
0000015: 65a7c0 39                                         e..9

Try it online! Check Debug to see the generated SBIN code.

Sesos assembly

The binary file above has been generated by assembling the following SASM code.

add 26
jmp
    jmp
        rwd 1, add 1, rwd 1, add 1, fwd 2, sub 1
    jnz
    rwd 2, add 64
    jmp
        fwd 2, add 1, rwd 2, sub 1
    jnz
    fwd 1, sub 1
jnz
fwd 1
jmp
    jmp
        rwd 1, add 1, fwd 1, sub 1
    jnz
    nop
        rwd 1
    jnz
    fwd 1
    jmp
        put, add 1, fwd 1
    jnz
    fwd 1
    jmp
        put, fwd 1
    jnz
    add 10, put, get
    nop
        rwd 1
    jnz
    fwd 1
; jnz (implicit)

How it works

We start by initializing the tape to ABCDEFGHIJKLMNOPQRSTUVWXYZ. This is as follows.

Write 26 to a cell, leaving the tape in the following state.

                                                       v
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0

As long as the cell under the data head is non-zero, we do the following.

Copy the number to the two cells to the left and add 64 to the leftmost copy.

                                                   v
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 26 0 0

Move the leftmost copy to the original location, then subtract 1 from the rightmost copy.

                                                     v
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 90 0

The process stops after 26 iterations, since the rightmost copy is 0 by then. We move a cell to the right, so the final state of the tape after the initialization is the following.

     v
0 0 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 0

Now we're ready to generate the output, by repeating the following process until the cell under the data head is zero.

First, we move the content of the cell under the data head one unit to the left, then move left until the last cell with a non-zero content.

   v
0 65 0 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 0

Now, we print all cells, starting with the one under the data head and moving right until we find a 0 cell, incrementing each printed cell after printing it. After printing A, the tape looks as follows.

     v
0 66 0 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 0

Now we move right, again printing all cells until a 0 cell in encountered. After printing BCDEFGHIJKLMNOPQRSTUVWXYZ, the tape looks as follows.

                                                                                  v
0 66 0 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 0

Now, we write 10 to the current cell, print the corresponding character (linefeed) and zero the cell with a call to get on empty input, leaving the tape unchanged.

Finally, we move to the last non-zero to the left, preparing the tape for the next iteration.

        v
0 66 0 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 0

The next iteration is similar. We first move 66 one cell to the left, print both 66 cells (BB) and increment them to 67, then print the remaining non-zero cells to the right (CDEFGHIJKLMNOPQRSTUVWXYZ), and finally place the data head on 67, leaving the tape as follows.

           v
0 66 66 0 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 0

After 24 more iterations and after printing ZZZZZZZZZZZZZZZZZZZZZZZZZZ and a linefeed, the tapes is left in the following state.

                                                                                  v
0 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 0 0

Moving the data head to the left to the next non-zero cell will leave it in its current position, so the cell under it is 0 and the loop terminates.

Dennis

Posted 2016-07-31T14:00:16.450

Reputation: 196 637

7

J, 13 bytes

u:65+>./~i.26

Online interpreter.

Explanation

u:65+>./~i.26
         i.26  generate [0 1 ... 25]
       /~      build a table...
     >.        ...of maximum
  65+          add 65 to each element
u:             convert to unicode

Leaky Nun

Posted 2016-07-31T14:00:16.450

Reputation: 45 011

7

R, 58 bytes

l=LETTERS;for(i in 1:26){l[2:i-1]=l[i];cat(l,"\n",sep="")}

Thanks to operator precedence, 2:i-1 is equivalent to 1:(i-1). Uses the built-in constant LETTERS that contains the alphabet in upper case. Everything else is rather self-explanatory.
Usage:

> l=LETTERS;for(i in 1:26){l[2:i-1]=l[i];cat(l,"\n",sep="")}
ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ

plannapus

Posted 2016-07-31T14:00:16.450

Reputation: 8 610

A new user has a suggestion to golf your answer here

– user41805 – 2016-11-12T07:35:13.440

6

C#, 147 bytes

void e(){for(int i=0,j=97;i<26;i++,j++)Console.WriteLine(new string((char)j,i)+new string(Enumerable.Range(j,26-i).Select(n=>(char)n).ToArray()));}

sometimes i wonder why im even trying

edit: fixed it

Try it online

downrep_nation

Posted 2016-07-31T14:00:16.450

Reputation: 1 152

I actually dont because im also using Console which would require me to type System.Console which nobody does. – downrep_nation – 2016-07-31T14:35:44.577

consider setting j = 97 and i beilieve (char)j+i+"" may work and be shorter, but I only know java so i'm not sure – Rohan Jhunjhunwala – 2016-07-31T15:29:36.917

j is used as an offset for the first character. if i do j=97 i need to do j++ aswell – downrep_nation – 2016-07-31T17:24:59.350

Oh ok I didnt know C# behaved like that. – Rohan Jhunjhunwala – 2016-07-31T18:09:32.933

2what's sad is that its ~50% longer than the brainfuck solution – fyrepenguin – 2016-08-01T02:06:23.453

1This doesn't output the correct answer when I run it, can you add a link to try it? – TheLethalCoder – 2016-08-02T10:22:12.963

I also geht the wrong result in Visual Studio and in c#pad – raznagul – 2016-08-02T11:56:19.277

ill see whats wrong and fix it. – downrep_nation – 2016-08-02T11:59:19.093

You are missing j++ – raznagul – 2016-08-02T12:01:30.137

You can golf it by three more bytes like this: void e(){for(int i=0,j=97;i<26;)Console.WriteLine(new string((char)j,i)+new string(Enumerable.Range(j++,26-i++).Select(n=>(char)n).ToArray()));} – Kevin Cruijssen – 2016-11-04T10:43:11.770

6

Matlab / Octave, 43 39 bytes

1 byte removed thanks to @beaker's idea of using [...,''] to convert to char.

@()[91-rot90(gallery('minij',26),2),'']

This is an anonymous function that returns a 2D char array.

Try it on Ideone.

Explanation

gallery('minij',...) gives a matrix in which each entry equals the minimum of its row and column indices:

 1     1     1     1  ...
 1     2     2     2
 1     2     3     3
 1     2     3     4
 ...

This is rotated 180 degrees with rot90(...,2):

26    25    24    23  ...
25    25    24    23
24    24    24    23
23    23    23    23
...  

The 91-... operation gives the ASCII codes of uppercase letters:

65    66    67    68
66    66    67    68
67    67    67    68
68    68    69    68 ...
...

Finally [...,''] concatenates horizontally with an empty string. This has the effect of converting to char.

Luis Mendo

Posted 2016-07-31T14:00:16.450

Reputation: 87 464

1Very clever use of gallery – Suever – 2016-07-31T14:51:56.377

2Too bad there'snogallery('maxij',...)`, huh? ;) – Martin Ender – 2016-07-31T14:59:42.187

@MartinEnder Totally! :-) BTW, I'm waiting for the Mathematica builtin... – Luis Mendo – 2016-07-31T15:04:35.007

You're in for a long wait, this is a string-based challenge. :P – Martin Ender – 2016-07-31T15:07:30.170

6

PowerShell v2+, 76 52 40 bytes

65..90|%{-join[char[]](,$_*$i+++$_..90)}

Loops from 65 to 89. Each iteration, we're constructing an array using the comma-operator that consists of the current number $_ multiplied by post-incremented helper variable $i++, concatenated with an array of the current number $_ to 90. That's encapsulated in a char-array cast, and -joined together into a string. For example, for the first iteration, this array would be equivalent to 65..90, or the whole alphabet. The second iteration would be 66+66..90, or the whole alphabet with B repeated and no A.

Those are all left on the pipeline at program end (as an array), and printing to the console is implicit (the default .ToString() for an array is separated via newline, so we get that for free).

PS C:\Tools\Scripts\golfing> .\print-the-l-phabet.ps1
ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ

AdmBorkBork

Posted 2016-07-31T14:00:16.450

Reputation: 41 581

5

MATL, 10 bytes

lY2t!2$X>c

Online demo (If you have issues with this interpreter, ping me in the MATL chat. Also, here is the TIO link in case you have issues)

Explanation

lY2     % Push an array of characters to the stack: 'AB...Z'
t!      % Duplicate and transpose
2$X>    % Take the element-wise maximum between these two (with expansion)
c       % Explicitly convert back to characters
        % Implicitly display the result.

Suever

Posted 2016-07-31T14:00:16.450

Reputation: 10 257

5

Python 2, 76 70 68 bytes

a=range(65,91)
i=0
for c in a:a[:i]=[c]*i;i+=1;print'%c'*26%tuple(a)

Very similar to my answer to the linked question.

Saved 2 bytes thanks to @xnor (again)!

Copper

Posted 2016-07-31T14:00:16.450

Reputation: 3 684

1Just as before, it's shorter to turn exec into for to use the current character being iterated over: for c in a:a[:i]=[c]*i;i+=1;print'%c'*26%tuple(a). – xnor – 2016-08-01T00:20:10.530

Whoa, that's great :D – ABcDexter – 2016-08-02T07:15:55.253

4

R, 42 41 bytes

write(outer(L<-LETTERS,L,pmax),'',26,,'')

Try it online!

The next shortest R answer is still a bit too long since it prints out line by line. I was thinking about another question earlier today and realized a much shorter approach was possible for this one: I generate the matrix all at once using outer and pmax (parallel maximum) and then print it(*) in one step with write.

(*) technically, its transpose, but it's fortunately symmetric across its diagonal.

Giuseppe

Posted 2016-07-31T14:00:16.450

Reputation: 21 077

4

05AB1E, 9 bytes

Code:

AAv¬N×?=¦

Explanation:

AA         # Push the alphabet twice.
  v        # For each in the alphabet.
   ¬       # Get the first character and
    N×     # multiply by the iteration variable.
      ?    # Pop and print.
       =   # Print the initial alphabet without popping.
        ¦  # Remove the first character of the initial alphabet and repeat.

Uses the CP-1252 encoding. Try it online!.

Adnan

Posted 2016-07-31T14:00:16.450

Reputation: 41 965

4

Javascript ES6, 81 bytes

x=>[...a='ABCDEFGHIJKLMNOPQRSTUVWXYZ'].map((x,y)=>x.repeat(y)+a.slice(y)).join`
`

Self-explanatory.

Mama Fun Roll

Posted 2016-07-31T14:00:16.450

Reputation: 7 234

Would something like [..."LETTERS"].map be shorter? – MayorMonty – 2016-07-31T15:43:25.407

That was my original approach, but it's 2 bytes longer. – Mama Fun Roll – 2016-07-31T15:44:07.140

That was the approach I thought when I saw this challenge – MayorMonty – 2016-07-31T15:45:23.450

Generally, it's better to use replace over map when iterating over strings char-by-char. – Mama Fun Roll – 2016-07-31T15:46:34.313

1In a.slice(y) where does the variable a come from? – gcampbell – 2016-07-31T17:22:26.427

Is x=> even necessary? If you console.log everything after it, you get the desired output. That cuts out 3 bytes. – Rick Hitchcock – 2016-08-02T21:43:53.453

Mind showing me your code? I'm ending up at 83 bytes with the console. – Mama Fun Roll – 2016-08-02T22:02:02.303

See https://jsfiddle.net/yLc6d2z0/

– Rick Hitchcock – 2016-08-03T13:48:33.540

x=> is considered a valid form of output, as is console.log. console.log must be accounted for in the code if you decide to use it, meaning that using lambdas is almost always shorter than logging to the console. – Mama Fun Roll – 2016-08-03T14:19:32.717

Sorry, I'm still learning here. Your answer has been my inspiration for learning ES6. – Rick Hitchcock – 2016-08-03T15:54:32.193

Oh it's fine. Glad you could learn something! – Mama Fun Roll – 2016-08-03T18:37:07.550

4

Octave, 26 bytes

disp([max(L=65:90,L'),''])

Sample run on ideone.

beaker

Posted 2016-07-31T14:00:16.450

Reputation: 2 349

Very nice! I keep forgetting the [...,''] trick – Luis Mendo – 2016-07-31T16:01:53.950

1@LuisMendo It really only saves 1 byte, but it's flashy! :D – beaker – 2016-07-31T16:08:13.583

4

R, 56 bytes

Don't have the rep to comment, but @plannapus answer can be golfed-down a bit to:

for(i in 1:26)cat({L=LETTERS;L[1:i]=L[i];L},"\n",sep="")

resulting in the same output:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ

Though, if answer as a matrix is allowed (i.e. like here), we could do 49 bytes:

sapply(1:26,function(l){L=LETTERS;L[1:l]=L[l];L})

Nutle

Posted 2016-07-31T14:00:16.450

Reputation: 221

I left a comment on @plannapus' answer redirecting him to your answer – user41805 – 2016-11-12T07:35:38.873

This is good but there's still a shorter approach

– Giuseppe – 2017-10-06T12:57:20.010

3

Python 3, 71 65 bytes

Thanks to @LeakyNun for -6 bytes

r=range(26)
for i in r:print(''.join(chr(max(i,x)+65)for x in r))

A full program that prints to STDOUT.

How it works

We assign character codes to the letters of the alphabet, from 0 for A to 25 for Z. The program loops over the interval [0, 25] with a line counter i, which determines the current character to be repeated and the length of the repeated section, and a character index x. By calling max(i,x), all characters below the repeated character are clamped to the character code of the same. Adding 65 and calling chr converts the resultant character codes to their ASCII equivalents; ''.join concatenates the characters, and each line is printed to STDOUT.

Try it on Ideone

TheBikingViking

Posted 2016-07-31T14:00:16.450

Reputation: 3 674

3

Haskell, 53 46 bytes

unlines[(i<$['B'..i])++[i..'Z']|i<-['A'..'Z']]

Returns a single string with the L-phabet.

go through the chars i from A to Z and make a list of (length ['B'..i]) copies of i followed by [i..'Z']. Join elements with newlines in-between.

nimi

Posted 2016-07-31T14:00:16.450

Reputation: 34 639

3

, 12 chars / 15 bytes

ᶐⓢ⒨Ċ_+ᶐč_)ü⬬

Try it here (Chrome Canary only).

Basically a port of my ES6 answer.

Mama Fun Roll

Posted 2016-07-31T14:00:16.450

Reputation: 7 234

I'm not getting ZZZZZZZZZZZZZZZ... for the bottom line. Only getting one Z. – cwallenpoole – 2016-08-01T17:43:08.043

What browser are you using? – Mama Fun Roll – 2016-08-01T18:19:54.430

1

In fact, @cwallenpoole, screenshot of the code running in Chrome Canary.

– Mama Fun Roll – 2016-08-02T01:39:28.283

+1 to get rid of that negative score. Doesn't work in Google Chrome, but it does work in FireFox. – Kevin Cruijssen – 2016-08-02T07:13:21.083

Tried FF too, but it didn't work. Oh well. Removed -1. – cwallenpoole – 2016-08-02T14:50:11.397

3

Perl, 31 bytes

-6 byte thanks to @Denis Ibaev

say$_ x$A++,$_..Z for A..Z

Needs -M5.010 to run. So run with :

perl -M5.010 -e 'say$_ x$A++,$_..Z for A..Z'  

Dada

Posted 2016-07-31T14:00:16.450

Reputation: 8 279

Nice solution! You can save 1 byte though, using -65+ord instead of (ord)-65! – Dom Hastings – 2016-08-01T15:58:49.697

Right, I was looking for a way to get rid of all those parenthesis near ord, and you found it, thanks ! – Dada – 2016-08-01T16:58:37.100

Shorter: say$_ x$A++,$_..Z for A..Z. And use -E instead of -M5.010 -e. – Denis Ibaev – 2016-11-03T07:15:03.667

@DenisIbaev Nice one, thanks! The -M5.010 doesn't count in the bytecount, so it doesn't really matter whether I use it or -E. – Dada – 2016-11-03T09:59:08.247

3

Cheddar, 90 bytes

(|>26).map(i->String.letters.chars.map((j,k,l)->k<i?l[i]:j).fuse).vfuse.slice(1)

That String.letters is too long :/

Had to add a .slice(1) because leading newline is disallowed

Explanation

(|>26)       // Range from [0, 26)
.map(i->     // Loop through that range
 String.letters.chars // Alphabet array
  .map(               // Loop through alphabet
  (j,k,l) ->          // j = letter, j = index, l = alphabet
    k<i?l[i]:j        // Basically `l[max(k,i)]` 
  ).fuse     // Collapse the array
).vfuse      // Join on newlines

Cheddar, 65 bytes (non-competing)

(|>26).map(i->String.letters.map((j,k,l)->k<i?l[i]:j).fuse).vfuse

Works with the nightly branch. Non-competing... sad part is that I already had the changes... just never commited ;_;

Downgoat

Posted 2016-07-31T14:00:16.450

Reputation: 27 116

I thought something like 65@"90 works for String.letters – Conor O'Brien – 2016-08-04T07:27:26.900

3

C, 78 70 67 bytes

f(i,j){for(;++i<27;puts(""))for(j=0;++j<27;putchar((i>j?i:j)+64));}

The code makes use of the following golfing techniques for C:

  • omit basic includes (like stdio.h)
  • omit (return) types of functions and variables, making them default to int
  • use the ternary operator instead of if-else blocks
  • use the ASCII code of a letter instead of its char representation (i.e. 65 instead of 'A')
  • use putchar to output a single character
  • abuse main's argument list
  • use puts("") to output a newline

Also, the rule If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. does not forbid the function to be called with parameters (thanks to ABcDexter!).

Try it on Ideone

An ungolfed version (without any warnings with gcc) would look like this:

#include <stdio.h>

#define MAX(x, y) (x>y ? x : y)

int main()
{
    for(int i=0; i<26; i++)
    {
        for(int j=0; j<26; j++)
            printf("%c", MAX(i, j) + 'A');
        printf("\n");
    }
    return 0;
}

sigalor

Posted 2016-07-31T14:00:16.450

Reputation: 241

Save 8 bytes: f(i,j){for(i=0;++i<27;puts(""))for(j=0;++j<27;putchar((i>j?i:j)+64));}. You don't need a full program, just a function that has performs the same operations every time it is called (which this does). – owacoder – 2016-08-01T02:08:23.843

@owacoder Thanks, fixed it. – sigalor – 2016-08-01T07:34:59.880

Can you remove that i=0; and make the function call as f(0,0) ? – ABcDexter – 2016-08-02T07:33:52.093

1@ABcDexter Yep, that should work (the rule If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. does not seem to forbid this, because it doesn't say wheather parameters to the function call are allowed). I let main call just f(0) anyway, because the initialization for the second for loop (the one with j as counter) is necessary nonetheless. – sigalor – 2016-08-02T09:01:24.287

@sigalor Yes precisely. I was trying myself in C, but saw that your code is shorter :) – ABcDexter – 2016-08-02T09:03:13.363

3

PHP, 75 71 bytes

for($a=join(range(A,Z));$i<26;)printf("%'$a[$i]26s
",substr($a,$i++));

Crypto

Posted 2016-07-31T14:00:16.450

Reputation: 862

1"A" and "Z" need no quotes. (Notices are not output with the default config.) – Titus – 2016-11-11T11:13:31.633

3

R, 54 bytes

v=L=LETTERS;for(i in 2:26){L[1:i]=L[i];v=cbind(v,L)};v

This solution uses the R built-in constant LETTERS, that... well... lists the uppercase letters. There is also the constant letters for lowercase letters.

Frédéric

Posted 2016-07-31T14:00:16.450

Reputation: 2 059

I m being nitpicky a bit but this output a matrix, not the exact text desired (i. e. the desired output shouldn't have all the quotes, spaces, rownames, colnames etc). – plannapus – 2016-08-22T13:10:18.393

2

x86 assembly (32-bit), 50 bytes

fd 57 c8 00 01 00 89 ef 4f 31 c0 aa b0 5a aa 48
e0 fc b0 41 fd 31 c9 b1 1b 89 ef 4f f2 ae f3 aa
50 47 57 e8 .. .. .. .. 58 58 40 3c 5a 7e e5 c9
5f c3

Might be optimizable further, but I'm tired.

Source:

/* output the l-phabet (???) - 32 bit */
.globl main
main:
std
push %edi
enter $256, $0
/* we're actually going to have to be careful with the stack on this one, since that's where the data is going */
/* first write our initial string */
mov %ebp, %edi
dec %edi
xor %eax, %eax
stosb
mov $'Z', %al
str:
stosb
dec %eax
loopnz str

/* now start back at the end */
mov $'A', %al
replace:
std
xor %ecx, %ecx
mov $27, %cl
mov %ebp, %edi
dec %edi
repne scasb
rep stosb
/* print */
push %eax
inc %edi
push %edi
call puts
pop %eax    /* caller cleanup */
pop %eax    /* old eax */
inc %eax
cmp $'Z', %al
jle replace
leave
pop %edi
ret

ObsequiousNewt

Posted 2016-07-31T14:00:16.450

Reputation: 836

2

Pascal (FPC), 106 bytes

uses math;var c,d:word;begin for c:=65to 90do begin for d:=65to 90do write(chr(Max(c,d)));writeln;end;end.

Try it online!

AlexRacer

Posted 2016-07-31T14:00:16.450

Reputation: 979

2

CJam, 13 bytes

'[,65>_ffe>N*

Test it here!

Explanation

'[,   e# Get character range from null-byte to 'Z'.
65>   e# Discard everything up to 'A', so we've got the upper case alphabet.
_     e# Duplicate.
ffe>  e# Nested map: for every pair of letters, computes the maximum and arranges the
      e# results in a grid.
N*    e# Join with linefeeds.

Martin Ender

Posted 2016-07-31T14:00:16.450

Reputation: 184 808

2

Python 2, 61 bytes

a=range(65,91)
for c in a:print bytearray(max(c,i)for i in a)

Inspired by (xsot’s improvement to) this answer.

Lynn

Posted 2016-07-31T14:00:16.450

Reputation: 55 648

2

Bash + coreutils, 55 51 bytes

Thanks to H Walters for 4 bytes.

for i in {A..Z};{ printf %c {A..Z} '
'|tr A-$i $i;}

We output the string ABCDEFGHIJKLMNOPQRSTUVWXYZ (+newline) 26 times, and replace the first $i characters with the $ith on each iteration. We take advantage of tr repeating the last character of the replacement set to extend it as necessary.

Toby Speight

Posted 2016-07-31T14:00:16.450

Reputation: 5 058

Save 4 more bytes; replace do and done with { and } – H Walters – 2016-08-13T14:17:02.480

2

C, 65 63 bytes

i,k;a(j){for(;i++^702;j+=putchar(k?(j>k?j:k)+64:10)<11)k=i%27;}

Wandbox

o79y

Posted 2016-07-31T14:00:16.450

Reputation: 509

From the challenge: "Each submission should be either a full program or function. If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. Anything else (e.g. headers in C), must be included." I don't know C: does this answer follow that rule? – msh210 – 2016-08-01T19:27:24.747

2

VBA, 60 Bytes

an Anonymous VBE immediate window function that outputs the L-phabet the the VBE immediate window.

For I=65To 90:For J=65To 90:?Chr(IIf(J>I,J,I));:Next:?:Next

 

Taylor Scott

Posted 2016-07-31T14:00:16.450

Reputation: 6 709

2

PHP, 65 62 52 bytes

for($s=Z;$s++<ZZ;)echo"
"[$s[1]>A],max($s[0],$s[1]);

Why use chr when I can increment letters? Try it online.


old solution, 62 bytes:

for(;26>$b+=1/27;)echo chr(($a=++$a%27)?$a>$b?$a+64:$b+65:10);

similar approach as in my Tabula Recta answer

Titus

Posted 2016-07-31T14:00:16.450

Reputation: 13 814

1

Common Lisp, SBCL, 100 97 96 bytes

(dotimes(i 26)(format t"~26,,,v@a
"(code-char(+ 65 i))(subseq"ABCDEFGHIJKLMNOPQRSTUVWXYZ"i 26)))

Ungolfed

(dotimes(i 26);loop from i=0 to 26
(format t"~26,,,v@a
"(code-char(+ 65 i))(subseq"ABCDEFGHIJKLMNOPQRSTUVWXYZ"i 26)))
;output i times character with code 65+i followed by rest of alphabet

Ideas for improvement are welcomed

user65167

Posted 2016-07-31T14:00:16.450

Reputation:

1

q/kdb+, 20 14 bytes

Solution:

-1{x|/:x}.Q.A;

Example:

q)-1{x|/:x}.Q.A;
ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ

Explanation:

Takes the alphabet and then performs the max (|) of each character in turn over itself (/:). For the first pass, we compare A against each letter, as A < B < C we get the full alphabet ABCDE..., for the next we take B, B>A hence BBCDE... etc.

-1{x|/:x}.Q.A; / ungolfed
-1           ; / print result to stdout
         .Q.A  / "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  {     }      / lambda function 
   x|/:x       / x max (&) each-right (/:) x

streetster

Posted 2016-07-31T14:00:16.450

Reputation: 3 635

1

Excel VBA, 40 39 Bytes

Anonymous VBE immediate window function that takes no input and outputs to the ActiveSheet object

[A1:Z26]="=Char(Max(Column(),Row())+64)

Output

Taylor Scott

Posted 2016-07-31T14:00:16.450

Reputation: 6 709

1

uBASIC, 75 bytes

Anonymous uBASIC function that takes no input and outputs the L-phabet

0ForI=65To90:ForJ=65To90:K=J:IfI>JThenK=I
1?Left$(Chr$(K),1);:NextJ:?:NextI

Try it online!

Taylor Scott

Posted 2016-07-31T14:00:16.450

Reputation: 6 709

1

Japt v1.4.5 -R, 9 bytes

;B£BcwXc

Try it online!

Unpacked & How it works

;Bq mXYZ{BcwXc

;               Use an alternative set of predefined variables
 B              "ABC...Z"
  q mXYZ{       Split into chars and map...
         Bc       Map over uppercase alphabets' charcodes...
           wXc      Take max of this and charcode of X

-R              Join by newline before implicit output

Bubbler

Posted 2016-07-31T14:00:16.450

Reputation: 16 616

1

Lua, 83 bytes

Each iteration of the loop prints out the ith letter of the alphabet i times and then prints all of the letters after that.

a="ABCDEFGHIJKLMNOPQRSTUVWXYZ"for i=1,26 do print(a:sub(i,i):rep(i)..a:sub(i+1))end

GalladeGuy

Posted 2016-07-31T14:00:16.450

Reputation: 101

1Try it Online! – Taylor Scott – 2018-08-06T01:27:29.957

1

Pepe, 88 85 bytes

REeEeeeeeErEeEeEEeEerEERREEEEEREEEereeREEEErerEEREEEEEEErereeerEEEEEeeEReeereeERrEree

Try it online!

u_ndefined

Posted 2016-07-31T14:00:16.450

Reputation: 1 253

1

Javascript (using external library) (141 bytes)

w=>_.Range(65,26).WriteLine(x=>(_.Range(0,x-65).Write("",y=>String.fromCharCode(x))||"")+_.Range(x,91-x).Write("",z=>String.fromCharCode(z)))

Link to lib:https://github.com/mvegh1/Enumerable

Code explanation: Create char code range of integers, for each write complex predicate to new line. Predicate will create a range of (currentValue-65) values, which is the part that goes A,BB,CCC,...etc...for the case of A the Write may return null so we coerce that to an empty string. Concatenate that with the remaining sequence of the alphabet. So many bytes are coming from the String.fromCharCode lol... oh well!!!

enter image description here

applejacks01

Posted 2016-07-31T14:00:16.450

Reputation: 989

1

VBA, 88 bytes

Function L:For i=0To 701:m=i Mod 27:d=m-i\27:L=L &IIf(26=m,vbLf,Chr(65+m+d*(d<0))):Next

An extension of my Tabula Recta answer. Again the last byte counted is the enter which generates the End Function statement. Invoke in the VBA editor Immediate window with ?L.

Joffan

Posted 2016-07-31T14:00:16.450

Reputation: 832

1You don't need the space between 0 and To in For i=0 To 701 – Jerry Jeremiah – 2016-07-31T23:52:41.503

@JerryJeremiah - Unexpected... thanks! And I don't need the () after L either, which I usually remember... – Joffan – 2016-08-01T00:50:26.317

1

ListSharp, 233 bytes

ROWS s=ROWSPLIT "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z" BY [","]
[FOREACH NUMB IN 1 TO 26 AS k]
{
STRG t=GETLINE s [k]
[FOREACH NUMB IN 1 TO k AS o]
STRG p=p+t
ROWS x=GETLINES s [k+1 TO 27]
STRG p=p+x+<newline>
}
SHOW=p

There are actually some tricks to get this shorter like directly accessing indexes or using c# queries since you can embed c# code in listsharp with some tricks.

But i kept it as in vanilla as possible

downrep_nation

Posted 2016-07-31T14:00:16.450

Reputation: 1 152

Can't you split by empty string? Can't you use Egyptian bracket? – Leaky Nun – 2016-07-31T18:08:04.397

for egyptian brackets i would need to write {"a","b",..."z"}, which is longer and it uses the c# method String.Split which doesnt work with an empty string, i should probably use Regex.Split for that because that does work.

but too late for this challenge.. – downrep_nation – 2016-07-31T18:12:58.950

Eh, by "Egyptian brackets" I meant [FOREACH NUMB IN 1 TO 26 AS k]{ – Leaky Nun – 2016-07-31T18:14:01.540

ah no you cant do that ;) each line can only perform one function for readability. only few things can be embedded in listsharp but for eaxmple STRG p=p+t cannot be put in line 6 to save the temporary variable t due to the single action per line reason – downrep_nation – 2016-07-31T18:18:31.977

I see, thanks for teaching. – Leaky Nun – 2016-07-31T18:23:36.830

no problem, thanks for the interest in my quirky language – downrep_nation – 2016-07-31T18:52:27.543

1

Haskell, 43 41 bytes

l=['A'..'Z']
m=mapM(putStrLn.(<$>l).max)l

This defines a function that needs no imports and can just be run in a complete program by adding

main=m

Of course, we could also just name it main itself, but that is three more bytes.

Saved 2 bytes thanks to @wchargin. Depending on the interpretation of the task, we can save 2 more by deleting m= and saying that the remaining part is the function that you can put into main=...

Christian Sievers

Posted 2016-07-31T14:00:16.450

Reputation: 6 366

In GHC 7.10, you can replace (`map`l) with (<$>l). – wchargin – 2016-07-31T18:44:28.403

Oh I see, thanks. – Christian Sievers – 2016-07-31T19:52:20.950

1

Perl 6,  67  64 bytes

my @a;@a[.[0]][.[1]]=('A'..'Z')[.max]for ^26 X ^26;.join.put for @a
my @a;@a[.[0];.[1]]=('A'..*)[.max]for ^26 X ^26;.join.put for @a

Explanation:

my @a;

# @a[ $_.[0] ][ $_.[1] ]
@a[ $_.[0] ; $_.[1] ] = (

    # infinite Range that produces:
    #   'A',  'B',  'C' ...  'Y',  'Z',
    #  'AA', 'AB', 'AC' ... 'AY', 'AZ',
    #  'BA', 'BB', 'BC' ... 'BY', 'ZZ',
    # 'AAA','AAB','AAC' ... *」
    'A' .. *

)[
    # index the Range with the max value in the "Tuple" ( 2 element List )
    $_.max
]

    for # do the above with each of the following "Tuples"

        # 「(0,0),(0,1),(0,2)...(0,25),(1,0)...(25,25)」
        ^26 X ^26;

$_.join.put for @a
  • .method where a term is expected is an implicit method call on $_ the "default" scalar.
  • ^26 is short for 0 ..^ 26 which in this case is effectively the same as 0 .. 25
  • The meta infix operator X creates the cross product of two lists
    ( accepts an optional infix operator which it applies between the elements )

Brad Gilbert b2gills

Posted 2016-07-31T14:00:16.450

Reputation: 12 713

Do you need my $@? – User112638726 – 2016-08-01T13:52:25.967

@User112638726 Perl 6 requires you to declare your variables. – Brad Gilbert b2gills – 2016-08-01T18:10:23.970

1

K, 32 35 Bytes

3 more bytes to print the result without double quotes!

{-1,/[y#x@y-1;y _x]}[b]'1+!#b:.Q.A;
ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ

Explanation;

.Q.A                 --> uppercase alphabet
1+!#b:.Q.A           --> Indexes from 0 til (!) count (#) .Q.A (alphabet), and add 1 to them all. Also assign .Q.A to the variable b, so we don't have to type .Q.A again!
{}[b]'1 2 3 4 5....  --> we apply the function to b (alphabet) to each (') number i.e. 1 then 2 then 3 then 4
{,/[y#x@y-1;y _x]}   --> First time, y is 1;
    y#x@y-1              --> Use y-1 (0) to index (@) into x (alphabet), then take (#) y (1) of them i.e 1#"A" returns "A", 2#"A" returns "AA" etc.
    y _x                 --> drop (_) y many elements from x
,/[y#x@y-1;y _x]     --> flatten the result
-1 res;              --> Print the result

Chromozorz

Posted 2016-07-31T14:00:16.450

Reputation: 338

1

Brainfuck, 126 bytes

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

Still couldn't outgolf Dennis. Try it online!

Explanation

(The random plusses are to offset hyphens/minuses used in the explanation)

+++++ +++++[<+++++ ++++<+>>-]
 Set the first cell to 10 (for the newline)
 Set the seccond cell to 90 (char code of Z to match the end result of the main loop

>+++++[<+++++>-]<+
 Set the third cell to 26 (the number of lines to make)
 Tape:
  10 90 26
        ^^

[- Main loop: runs 26 times (represented by n)

  >>+++++[-<+++++<<----->>>]<+
   Bring the second cell back to 65 (char code of A)
   Set the fourth cell to 26 (the number of letters per line)
   Tape on first time through loop:
    10 65 26-n 26  0  n
+              ^^

  >>[-<+<<<+>>>>]<
   The sixth cell contains a counter n of the number of lines we've done (initially zero)
   Add n to 65 (cell 2) to skip over the letters covered by the repeated letter
   Move the counter to cell 5
    10 65+n 26-n 26  n  0
                     ^
  [->+<<-<<.>>>]>+<<
    Move the counter back to cell 6
    Output the repeated character n times
    Subtract the n from cell 4 to leave room for only the non-repeated characters
    Increment n for next time
     10 65+n 26-n 26-n  0  n
++                ^^^^

  [-<<.+>>]
   Fill the remaining spots in the line with the rest of the alphabet by outputting cell 2 and incrementing
    10 91 26-n  0  0  n
+               ^

  <<<.>-
   Put a newline (cell 1)
   Change 91 to 90 because it's easier to subtract 25 than 26 to reset it
    10 90 26-n  0  0  n
+      ^^
>]

NinjaBearMonkey

Posted 2016-07-31T14:00:16.450

Reputation: 9 925

1

><>, 77 bytes

v:1->:    ?!v!
>d2*^   v&:~<&o<
v!?&-1:&<o+'@':a!
>&~&>&:1+&d2*=?^&:&'@'+o43.

Try it online!

owacoder

Posted 2016-07-31T14:00:16.450

Reputation: 1 556

1

Matricks, 37 bytes

m:26:26;Fs::[m90-Q:26-Q:26-Q;];:1:26;

Simple enough. Sets it to a blank 26x26 matrix, then consecutively overwrites the top left square with the correct ascii value.

Run with python matricks.py lphabet.txt [[]] 0 --asciiprint

Blue

Posted 2016-07-31T14:00:16.450

Reputation: 1 986

1

Actually, 13 bytes

5Pτú;∙♂M╪k♂Σi

Try it online!

-4 bytes from Leaky Nun, and the inspiration for 4 more, then 4 more from him, and 1 more from me

Explanation:

5Pτú;∙♂M╪k♂Σi
5Pτ            push 26
   ú;∙         Cartesian product of lowercase alphabet with itself
      ♂M       maximum of each pair
        ╪k     list of length-26 sublists
          ♂Σ   concatenate each sublist
            i  flatten and implicitly print

Mego

Posted 2016-07-31T14:00:16.450

Reputation: 32 998

1

Sesos, 24 bytes

0000000: 28eb92 02fcfe 8cabb2 36def7 f59933 37e09d 3976c7  (........6....37..9v.
0000015: 867307                                            .s.

Try it online! Check Debug to see the generated SBIN code.

Sesos assembly

The binary file above has been generated by assembling the following SASM code.

add 10
rwd 1
add 26
jmp
    jmp
        rwd 3, add 1, fwd 3, sub 1
    jnz
    rwd 1, add 64, rwd 2
    jmp
        fwd 1, add 1, fwd 1, add 1, fwd 1, add 1, rwd 3, sub 1
    jnz
    fwd 1, sub 1
jnz
fwd 2
jmp
    jmp
        rwd 1, put, fwd 1, sub 1
    jnz
    fwd 1
    jmp
        put, fwd 2
    jnz
    rwd 2
    jmp
        rwd 1
    jnz
    fwd 2
jnz

How it works

We start by placing 10 (linefeed) and 26 on the tape, leaving it as follows.

 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
                                                                            v
 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 26 10  0

We're going to count down from 26 to 1, creating two copies of the counter: an unaltered one and one incremented by 64. We do this because we have to print the letter with character code 64 + n exactly n times before printing the remainder of the alphabet.

To count down as outlined above, we repeat the following process until the cell under the data head has a value of 0.

First, we move the content of the counter cell three units to the right.

 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
                                                                            v
 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 26  0  0  0 10  0

Now, we retrocede three cells, increment the first one by 64.

 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
                                                                   v
 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 26  0 64  0 10  0

Then, we (destructively) copy the content of the cell under the data head to the three closest cells to the right.

 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
                                                                   v
 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 26 90 26 10  0

Finally, we take a step to the right, decrement the counter, and repeat the process unless 0 is reached.

 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
                                                                      v
 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 25 90 26 10  0

We repeat this process 25 more times, then take two steps forward, leaving the tape as follows.

 0  0 65  1 66  2 67  3 68  4 69  5 70  6 71  7 72  8 73  9 74 10 75 11 76 12 77 13
          ^
78 14 79 15 80 16 81 17 82 18 83 19 84 20 85 21 86 22 87 23 88 24 89 25 90 26 10  0

Now we're ready to generate the output. We do so by repeating the following process until the cell under the data head has a value of 0.

First we decrement the counter until it reaches 0, printing the content of the cell to the left each time we decrement. After printing A and taking one step to the right, the tape looks as follows.

 0  0 65  0 66  2 67  3 68  4 69  5 70  6 71  7 72  8 73  9 74 10 75 11 76 12 77 13
             ^
78 14 79 15 80 16 81 17 82 18 83 19 84 20 85 21 86 22 87 23 88 24 89 25 90 26 10  0

We now print the content of the cell under the data head, take two steps to the right, and repeat until a 0 cell is reached. After printing BCDEFGHIJKLMNOPQRSTUVWXYZ\n and taking two steps to the left, the tape looks as follows.

 0  0 65  0 66  2 67  3 68  4 69  5 70  6 71  7 72  8 73  9 74 10 75 11 76 12 77 13
                                                                               v
78 14 79 15 80 16 81 17 82 18 83 19 84 20 85 21 86 22 87 23 88 24 89 25 90 26 10  0

We now go left until we find the next 0 cell, then take two steps to the right.

 0  0 65  0 66  2 67  3 68  4 69  5 70  6 71  7 72  8 73  9 74 10 75 11 76 12 77 13
                ^
78 14 79 15 80 16 81 17 82 18 83 19 84 20 85 21 86 22 87 23 88 24 89 25 90 26 10  0

In the next iteration, we'll print BB, then CDEFGHIJKLMNOPQRSTUVWXYZ\n and leave the tape as follows.

 0  0 65  0 66  0 67  3 68  4 69  5 70  6 71  7 72  8 73  9 74 10 75 11 76 12 77 13
                      ^
78 14 79 15 80 16 81 17 82 18 83 19 84 20 85 21 86 22 87 23 88 24 89 25 90 26 10  0

This process continues until all 26 lines are printed. After the last iteration, the data head is positioned on a 0 (see below), and the programs terminates.

 0  0 65  0 66  0 67  0 68  0 69  0 70  0 71  0 72  0 73  0 74  0 75  0 76  0 77  0
                                                                                  v
78  0 79  0 80  0 81  0 82  0 83  0 84  0 85  0 86  0 87  0 88  0 89  0 90  0 10  0

Dennis

Posted 2016-07-31T14:00:16.450

Reputation: 196 637

1

Lua, 108 85 86 Bytes

EDIT: saved 23 Bytes thanks to @LeakyNun

A Lua program without any spaces! It's so rare that I think it's worth telling it!

It simply outputs line by line to STDOUT.

s="ABCDEFGHIJKLMNOPQRSTUVWXYZ"for i=1,26 do s=s:sub(i,i):rep(i)..s:sub(i+1)print(s)end

Ungolfed

s="ABCDEFGHIJKLMNOPQRSTUVWXYZ"  -- shortest way to generate the alphabet is to hardcode it
for i=1,26                      -- loop once for each character
do 
  s=s:sub(i,i)                  -- replace the current string by using its i-th character
     :rep(i)                    -- repeating it i-th times
    ..s:sub(i+1)                -- and concatenating with the rest of the string
print(s)                        -- we then can print it out
end

Katenkyo

Posted 2016-07-31T14:00:16.450

Reputation: 2 857

It's got spaces in it after the edit – Blue – 2016-08-02T19:01:20.927

You are missing the letter N in the golfed version. – gwell – 2016-08-02T19:57:31.087

@gwell ooops, fixed! – Katenkyo – 2016-08-03T19:44:43.247

1

Pyth, 9 bytes

V._GXGNeN

Try it online: Demonstration

Explanation:

V._GXGNeN   implicit: G = "abc...xyz"
 ._G        all prefixes of G: ["a", "ab", "abc", ...]
V           for each prefix N:
    XGNeN      replace the letters of N in G by the last letter of N 

Another pretty interesting solution (12 bytes):

j.uXN.*<{N2G

First time that .* is useful!

Jakube

Posted 2016-07-31T14:00:16.450

Reputation: 21 462

1

Sprects, 316 bytes

:ABCDlBBCDlCCCDlDDDDlEEEElFFFFFFGcGGGGGGGcHHHHHHHcIIIIIIIIIJq00q11qttttMauuuuMavvvvNarrrrrPQknnnnQkooooQkppppRkmmmmmmSTbiiiiibjjjjjbgggggggVs
hhhhhhhWs
ffffffYZ
dddddZ
eeeeeZ:1KKKKK:0JJJJJ:dYYYYY:eZZZZZ:fXXXX:gVVV:hWWW:iTTTT:jUUUU:lEFGc:cHIJq:mSSS:nPPPP:oQQQQ:pRRRR:qKLMa:aNOPQk:kRSTb:bUVs
:rOOO:sWXYZ:tLLL:uMMM:vNNN

Basically Martin Ender's /// answer ported to Sprects and then golfed. \ns appear as spaces, this is the interpreter's error.

Erik the Outgolfer

Posted 2016-07-31T14:00:16.450

Reputation: 38 134

1

Lua, 81 80 bytes

Saved 1 byte thanks to manatwork

w=io.write for i=65,90 do for j=65,90 do w(('').char(math.max(i,j)))end w'\n'end

brianush1

Posted 2016-07-31T14:00:16.450

Reputation: 300

Why not iterate 65 to 90? – manatwork – 2016-08-01T11:58:10.243

1

QB64, 75 bytes

Not a winner, but not bad for BASIC. Too bad it doesn't have a built-in MAX function.

FOR y=65 TO 90
FOR x=65 TO 90
IF x>y THEN?CHR$(x);ELSE?CHR$(y);
NEXT
?
NEXT

GuitarPicker

Posted 2016-07-31T14:00:16.450

Reputation: 1 101

1

Pyth - 12 bytes

WG.[hG26G=tG

Explanation:

                    #G is autoinitialized to the lowercase alphabet
WG                  #while G is not empty
  .[                #left pad
        G           #G
    hG              #with the first letter of G
      26            #to a length of 26
                    #implicitly print that
         =tG        #remove the first letter of G

Cowabunghole

Posted 2016-07-31T14:00:16.450

Reputation: 1 590

Nice approach. =tG does not only perform the assignment, it will also return the new value. So you can use this expression during the .[ statement and save one byte: WG.[hG26=tG – Jakube – 2016-08-02T09:11:57.353

1

Ruby, 60 bytes

a=("A".."Z").to_a.join;(0..25).map{|i|puts(a[i]*i+a[i..-1])}

jose_castro_arnaud

Posted 2016-07-31T14:00:16.450

Reputation: 229

1Save a few bytes by doing [*a..b] instead of (a..b).to_a – Fund Monica's Lawsuit – 2016-08-02T06:48:23.010

1Also, you can use 25.times instead of (0..25).each – Fund Monica's Lawsuit – 2016-08-02T06:49:10.023

1Lastly, I think you can get rid of the parens around the arguments to puts if you have a space before them – Fund Monica's Lawsuit – 2016-08-02T06:50:12.763

1

F#, 70 bytes

for i in 'A'..'Z'do(for j in 'A'..'Z'do printf"%c"(max i j));printfn""

Pretty straightforward.

asibahi

Posted 2016-07-31T14:00:16.450

Reputation: 371

Can you use their codepoints to replace 'A' and 'Z'? – Leaky Nun – 2016-08-02T05:20:43.000

@LeakyNun I would need to cast to char so the net is 74 bytes : for i in 65..90 do(for j in 65..90 do printf"%c"(char<|max i j));printfn"" – asibahi – 2016-08-02T05:32:40.023

What does printf"%c"65 do? – Leaky Nun – 2016-08-02T05:35:32.627

throw an error. – asibahi – 2016-08-02T05:36:33.717

Alright, thanks for teaching. – Leaky Nun – 2016-08-02T05:36:43.817

1

Java 1.8, 96 91 bytes

I managed to flatten everything into one for-loop with a single print statement. Nothing Java 1.8 specific - just happens to be the version I compiled the code with.

void f(){for(int i=-1,j=0,k=i;++i<702;k=(i+1)%27)System.out.write(k>25?++j-j+10:65+(k>j?k:j));}

Surprisingly, removing variable k and introducing Math.max() skimmed off 5 bytes:

void f(){for(int i=-1,j=0;++i<702;)System.out.write(i%27>25?++j-j+10:65+Math.max(i%27,j));}

Or ungolf'ed:

interface C {
    static void main(String[] a) {
        f();
    }

    static void f() {
        for (int i = -1, j = 0; ++i < 702;) {
            System.out.write(i%27 > 25 ? ++j - j + 10 : 65 + Math.max(i%27,j));
        }
    }
}

Try it here.

Approach is based on my Tabula Recta answer. This leverages the fact that the System.out stream is line-buffered, causing an auto-flush whenever a line feed character (10) is written.

I have a feeling this can be golf'ed down further, mainly because of the way the values of certain variable are juggled with (i.e. j). Note to self: I was right!.

MH.

Posted 2016-07-31T14:00:16.450

Reputation: 261

1

Ruby, 49 47 Bytes

Shaved off two bytes thanks to a simple () removal as per @manatwork, though his answer is even better at 45 bytes (see comment)

a=?A..?Z;a.map{|x|a.map{|y|$><<[x,y].max};puts}

Ungolfed:

('A'..'Z').map{|x|
  ('A'..'Z').map{|y|
    print [x,y].max
  }
  puts
}

Or using a stabby lambda to print out character by it's index, 76 bytes:

l=->i,j{$><<(i+65).chr*j};26.times{|i|l[i,i];(26-i).times{|j|l[i+j,1]};puts}

Ungolfed:

def printChar(char,num)
  print (char+65).chr*num
end

26.times { |i|
  printChar(i,i)
  (26-i).times{|j| printChar(i+j,1)}
  puts
}

A less complicated version (that doesn't use the string * op) at 77 bytes:

l=->i{$><<(i+65).chr};26.times{|i|i.times{l[i]};(26-i).times{|j|l[i+j]};puts}

David Ljung Madison Stellar

Posted 2016-07-31T14:00:16.450

Reputation: 231

a=?A..?Z;puts a.map{|x|a.map{|y|x>y ?x:y}*""} – manatwork – 2016-08-02T16:36:05.530

1

Python 2.7, 79 bytes

x=[chr(y) for y in range(65,91)]
for y in range(26):print x[y]*y+''.join(x[y:])
  1. Generate a list of the characters.
  2. Loop through each showing the beginning character a certain amount of times.
  3. Then show the rest after that.

Koppany Horvath

Posted 2016-07-31T14:00:16.450

Reputation: 41

Nice answer, and welcome to the site! You can do map(chr,range(65,91)) to take a couple bytes off. – James – 2016-08-02T16:24:49.073

You could also take one byte off with y=0;exec"print x[y]*y+''.join(x[y:]);y+=1"*26 – James – 2016-08-02T16:26:09.330

1

JavaScript, 101 bytes

Not as short as the other and probably doesn't have much room for improvement without changing how it works, but this was the solution I came up with without looking at any of the other answers first.

s=String.fromCharCode
for(l=0;l<26;){o=s(65+l).repeat(l)
for(i=l++;i<26;)o+=s(65+i++)
console.log(o)}

Florrie

Posted 2016-07-31T14:00:16.450

Reputation: 831

1

Neoscript, 62 bytes (non-competing)

a='A:[]:'Zeach n=0:[]:25console:log(a[n]*n+a:slice(n):fuse());

TuxCrafting

Posted 2016-07-31T14:00:16.450

Reputation: 4 547

1

Brachylog, 20 19 bytes

@Ae:@Az:{ot.}acw@Nw\
@Ae:@Az:oa:tacw@Nw\

Try it online!

Leaky Nun

Posted 2016-07-31T14:00:16.450

Reputation: 45 011

1

TSQL, 107 bytes(boring version)

Golfed:

DECLARE @ INT=0z:PRINT STUFF('ABCDEFGHIJKLMNOPQRSTUVWXYZ',1,@,REPLICATE(CHAR(@+65),@))SET
@+=1IF @<26GOTO z

Ungolfed:

DECLARE @ INT=0
z:
PRINT STUFF('ABCDEFGHIJKLMNOPQRSTUVWXYZ',1,@,REPLICATE(CHAR(@+65),@))
SET @+=1
IF @<26GOTO z

Fancy solution as SELECT without looping:

Fiddle(boring solution)

TSQL, 168 bytes(the interesting solution)

USE MASTER will be necessary if you have set a default database for your sql user

Golfed:

USE MASTER;
WITH n(n)as(SELECT number FROM spt_values WHERE'P'=type and number<26)SELECT(SELECT char(65+IIF(x.n>n,x.n,n))FROM n FOR xml path(''),type).value('.','char(51)')FROM n x

Ungolfed:

USE MASTER;
WITH n(n)as
(
  SELECT number
  FROM spt_values
  WHERE'P'=type and number<26
)
SELECT
(
  SELECT char(65+IIF(x.n>n,x.n,n))
  FROM n
  FOR xml path(''),type).value('.','char(51)')
FROM n x

Fiddle for interesting solution

t-clausen.dk

Posted 2016-07-31T14:00:16.450

Reputation: 2 874

1

QBIC, 42 bytes

[26|D=Z[26|c=b~a>b|c=a]D=D+chr$$(c+64)|]?D

I should really make a CHR$ function in QBIC...

Output:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ

steenbergh

Posted 2016-07-31T14:00:16.450

Reputation: 7 772

1

Commodore 64 195 bytes 182 bytes 135 bytes 126 bytes 123 122 tokenised BASIC bytes

Here is a version for the Commodore 64 (will also work with other Commodore BASIC most likely) - although the machine only displays 25 rows in BASIC by default, you can at least see the first row as BASIC is slow.

 0 x=0:fory=i+65to90:on-(i>0)and-(x=0)gosub1:printchr$(y);:next:print:i=i+1:on-(i<26)goto:end
 1 x=1:forz=1toi:printchr$(y);:next:return

Written with CBM prg Studio. I'll see if I can work out a 6502 version at some point.

print 38911-(fre(0)-65536*(fre(0)<0)) shows 123 bytes used.

GuitarPicker's solution had me thinking of a better way; unfortunately there is no if/else in Commodore BASIC v2 but this is probably more efficient than my previous one. Althoug BASIC 7 does have this facility for the Commodore 128 (native).

I've taken out the infinite loop in the previous version and not initialised the i variable as you don't need to do that - saving 9 bytes.

Saved another byte because goto in CBM BASIC V2 assumes goto 0 if no number is entered, so removed the on...goto0 saving a whole token!

Further minimisation has meant that I could add end to like 0, hence removing 1 end and moving up line to for the sub-routine, saving another few bytes.

Shaun Bebbers

Posted 2016-07-31T14:00:16.450

Reputation: 1 814

Generally we include a byte count for code golf challenges. I have made some simple formatting edits to your answer to match how things are generally formatted however I left out the byte count because I am not familiar with scoring in Commodore 64. You can add one if you wish. It is generally paced in the title after the name of the language. Nice first post! – Post Rock Garf Hunter – 2016-11-03T18:08:19.280

line 2 goto2? If I remember correctly, there´s no need to input a space after the line number, and i doesn´t need initialization. x is not really used; but I guess it should be somewhere. – Titus – 2016-11-11T11:10:44.357

Keep forgetting that shift and enter for new line 2 end There is no need to put the line spaces after the line numbers but Commodore BASIC adds one anyway. You don't need to initialise i as zero, you are correct. x=0 is required as it's initialised on line 1 though, so there's a few bytes saved. To increase speed of Commodore BASIC, you should always initialise variables first. – Shaun Bebbers – 2016-11-11T11:19:29.593

You could use ? instead of print it I remember correctly. And every command can be abbreviated by using 2 characters, for example " e – G B – 2017-01-09T21:18:16.703

Using ? instead of PRINT has no effect on Commodore BASIC other than when you are typing in the listing. If you try 0 ?"HELLO DAVE";:GOTO into a C64 and list it, the listing will show 0 PRINT"HELLO DAVE";:GOTO – Shaun Bebbers – 2017-01-24T10:20:02.010

1

k, 29 bytes

o:{-1@(y#*x),x:y_x}[.Q.A]'!26

This prints to the console, without quotes. Setting the return to a variable ("o") suppresses the output of the function in the k interpreter, so nothing will be returned by the execution of the function.

Get kdb+ here

Paul Kerrigan

Posted 2016-07-31T14:00:16.450

Reputation: 189

1

Binary-Encoded Golfical, 105 88 83 bytes

This encoding can be converted back to Golfical's standard graphical format using the encoder/decoder provided in the Golfical github repo, or run directly by using the -x flag.

Hexdump of binary encoding:

00 D0 05 1C 00 5A 10 40 1B 14 1B 14 00 41 1A 14
1B 14 14 14 27 0C 05 14 14 14 14 0C 02 14 14 14
14 08 04 14 14 14 14 00 42 14 14 14 04 01 1B 04
01 08 02 1A 0A 02 27 0A 02 18 1D 50 0A 02 14 14
14 18 1B 04 01 1A 14 00 0A 27 18 1D 14 4F 1C 14
14 14 1D

Original image (the layout of the program can probably be compacted further):

enter image description here

Scaled up 36x:

enter image description here

SuperJedi224

Posted 2016-07-31T14:00:16.450

Reputation: 11 342

1

MySQL, 311 bytes

delimiter // create procedure t() begin declare p,r int;declare q varchar(726);set r:=0;set q:="";while r<26 do set p:=65+r;set q:=concat(q,rpad("",r,char(p)));while p<91 do set q:=concat(q,char(p));set p:=p+1;end while;set q:=concat(q,"\r\n");set r:=r+1;end while;select q from dual;end //
delimiter ;
call t()

Wahooka

Posted 2016-07-31T14:00:16.450

Reputation: 79

1

Befunge, 55 bytes

:39*%"A"+:"["/99**-,:"d"7*`#@_1+::39*/\39*%`55+*"%"+40p

Try it online!

James Holderness

Posted 2016-07-31T14:00:16.450

Reputation: 8 298

0

Pushy, 14 bytes

Non-competing as the language postdates the challenge.

A65vL:^K&Mkhv"

Try it online!

A     \ Push the uppercase alphabet
65v   \ Push 65 (char 'A') to the second stack, as a counter.
L:    \ Length (26) times do:
 ^K&M \   Make every character max(char, counter)
 khv  \   Increment the counter
 "    \   Print the characters

FlipTack

Posted 2016-07-31T14:00:16.450

Reputation: 13 242

0

Japt, 15 bytes

;B¬£B®<X?X:Z}÷

Test it online!

Japt, 12 + 1 = 13 bytes (non-competing)

;B¬£B®<X?X:Z

Non-competing because this requires the -R flag, which was just added. Test it online!

ETHproductions

Posted 2016-07-31T14:00:16.450

Reputation: 47 880

0

Pyth, 16 bytes

I'm guessing I'm doing it entirely wrong.

VlG=H>rG1N+*hHNH

Explanation:

VlG       For every letter in the alphabet.
 =H>rG1N  Get every entry past N in the uppercase alphabet (rG1) and store it in H.
 +*hHNH   Output the first letter times the iteration appended to the truncated uppercase alphabet.

Try it online!

Stan Strum

Posted 2016-07-31T14:00:16.450

Reputation: 436

0

Bubblegum, 118 bytes

00000000: e002 bc00 6c5d 0020 9084 76ba 8a75 cfb4  ....l]. ..v..u..
00000010: 0db2 e89f 1387 f805 577d ecad ee74 7800  ........W}...tx.
00000020: eec1 2f25 c599 ffad a853 3436 8feb d31b  ../%.....S46....
00000030: 82d8 8903 257e e382 db1a 762d 7165 8aff  ....%~....v-qe..
00000040: b5a1 0ce7 aef8 6f11 df37 a113 cae8 1bf5  ......o..7......
00000050: cb63 3fc8 6759 ad3c 9623 3ff4 eec3 aa59  .c?.gY.<.#?....Y
00000060: 0467 2b17 046c 0fa7 33a2 03aa d932 36b7  .g+..l..3....26.
00000070: 26fe c600 0d0a                           &.....

Try it online!

LyricLy

Posted 2016-07-31T14:00:16.450

Reputation: 3 313

0

Thotpatrol, 907 bytes

JACKING IN
DM THAUGHTY ALLIE 
DM THAUGHTY LAURA 
DM THOTTY KATY 
DM THOTTY MARINA
DM THAUGHTY KATE 
ALLIE  ©ABCDEFGHIJKLMNOPQRSTUVWXZY©
KATY   ™0™
MARINA  ™0™
❤PRIME ASSETS❤ MARINA  ™25™
LAURA  ©©
KATY   ™0™
❤PRIME ASSETS❤ KATY  ™25™
BRIEF KATY  MARINA
KATE  ALLIE  MARINA
LAURA  LAURA REDACTED KATE
DEBRIEF
BRIEF KATY  MARINA
KATE  ALLIE  KATY
LAURA  LAURA REDACTED KATE
DEBRIEF
KATY  KATY  ™1™
INTERCEPT MALIGNANT COMMUNICATIONS
  LAURA REDACTED ©
©
MARINA  MARINA  ™1™
INTERCEPT MALIGNANT COMMUNICATIONS
NAUGHTY THAUGHTY ALLIE
NAUGHTY THOTTY KATY
NAUGHTY THAUGHTY KATE
NAUGHTY THOTTY MARINA
REPORT UNPATRIOTIC ACTIVITY

I challenge others to optimize this further. Thotpatrol is not an efficiency-friendly language.

Link to interpreter: https://github.com/MindyGalveston/thotpatrol-

Mr. Negi

Posted 2016-07-31T14:00:16.450

Reputation: 75

1Challenge accepted – MickyT – 2017-09-05T20:11:42.403

0

K (oK), 21 19 bytes

Solution:

`0:`c$a|/:a:65+!26;

Try it online!

Explanation:

K port of my q/kdb+ answer.

`0:`c$a|/:a:65+!26; / solution
`0:               ; / write to stdout and swallow return value
               !26  / til 26, range 0..25
            65+     / add 65 (vectorised), ASCII A = 65
          a:        / save in variable a
      a|/:          / a max (&) each-right (/:) a
   `c$              / cast to string

streetster

Posted 2016-07-31T14:00:16.450

Reputation: 3 635

0

Thotpatrol, 576 bytes

JACKING IN
DM THAUGHTY AI
AI  ©ABCDEFGHIJKLMNOPQRSTUVWXYZ©
DM THOTTY AN
DM THOTTY FE
FE  ™0™
❤PRIME ASSETS❤ FE  ™25™
AN  ™0™
❤PRIME ASSETS❤ AN  ™25™
BRIEF AN  FE
  AI  FE
DEBRIEF
BRIEF AN  FE
  AI  AN
DEBRIEF
AN  AN  ™1™
INTERCEPT MALIGNANT COMMUNICATIONS
  ©
©
FE  FE  ™1™
INTERCEPT MALIGNANT COMMUNICATIONS
REPORT UNPATRIOTIC ACTIVITY

Pretty much the same sort of logic as @Mr.Negi except I have scrapped a number of unnecessary commands, used shorter variable names and printed directly rather than putting value into a variable first.

MickyT

Posted 2016-07-31T14:00:16.450

Reputation: 11 735

0

Common Lisp, 84 bytes

(dotimes(i 26)(format t"~a
"(fill #1="ABCDEFGHIJKLMNOPQRSTUVWXYZ"(elt #1#i):end i)))

Try it online!

Renzo

Posted 2016-07-31T14:00:16.450

Reputation: 2 260

0

VBA (EXCEL) , 111 Bytes

Sub c()

For x=0 To 25
For y=0 To 25
b=y
If y<x Then b=x
a=a&Chr(65+b)
Next
a=a&vbNewLine
Next
MsgBox a
End Sub

remoel

Posted 2016-07-31T14:00:16.450

Reputation: 511

0

Charcoal, 10 bytes

F⮌αB⁻℅ι⁶⁴ι

Try it online!

Explanation:

F           For each
 ⮌α          letter in the reversed uppercase alphabet
   B         draw a box
     ⁻℅ι⁶⁴    of size the ascii code of the letter minus 64
     ι        and use the iterated char as border

Charlie

Posted 2016-07-31T14:00:16.450

Reputation: 11 448

0

SOGL V0.12, 18 bytes

Zl∫ZFH⌡k±JM*+Z⁄m±P

Try it Here!

SOGL doesn't have string comparison :/

dzaima

Posted 2016-07-31T14:00:16.450

Reputation: 19 048

0

J, 24 bytes

(,~{.#~26-#)\.65}.91{.a.

Try it online!

              65}.91{.a.   the alphabet
            \.             for each suffix starting from the longest
(      26-#)               subtract length from 26
(  {.      )               first character
(    #~    )               repeated n times
(,~        )               prepend

FrownyFrog

Posted 2016-07-31T14:00:16.450

Reputation: 3 112

Here's a 13 bytes solution

– FrownyFrog – 2017-10-07T16:29:17.607

0

Jelly, 13 bytes

ØAxJŒgżṫJ‘$$Y

Try it online!

ellie

Posted 2016-07-31T14:00:16.450

Reputation: 131

0

MY-BASIC, 79 bytes

Anonymous function that takes no input and outputs to the console

For I=65 To 90
For J=65 To 90
K=J
If I>K Then K=I
Print Chr(K)
Next
Print;
Next

Try it online!

Taylor Scott

Posted 2016-07-31T14:00:16.450

Reputation: 6 709

0

Visual Basic .NET (.NET Core), 127 bytes

Declared function that takes no input and outputs the L-phabet to the console.

Module M
Sub Main
Dim S
For I=65To 90
S=""
For J=65To 90
S+=ChrW(If(I>J,I,J))
Next
Console.WriteLine(s)
Next
End Sub
End Module

Try it online!

Taylor Scott

Posted 2016-07-31T14:00:16.450

Reputation: 6 709

0

Yabasic, 53 bytes

Takes no input and outputs to STDOUT

For I=65To 90
For J=65To 90?Chr$(Max(J,I));Next
?Next

Try it online!

Taylor Scott

Posted 2016-07-31T14:00:16.450

Reputation: 6 709

0

QBasic, 69 bytes

An undeclared subroutine that takes no input and outputs to STDOUT

For I=65To 90
For J=65To 90
K=J
If I>K Then K=I
?Chr$(K);
Next
?
Next

Taylor Scott

Posted 2016-07-31T14:00:16.450

Reputation: 6 709

0

Small Basic, 107 bytes

Script that takes no inpu and outputs to the TextWindow

For I=65To 90
s=""
For J=65To 90
s=s+Text.GetCharacter(Math.Max(J,I))
EndFor
TextWindow.WriteLine(s)
EndFor

Output

output

Taylor Scott

Posted 2016-07-31T14:00:16.450

Reputation: 6 709

0

Gol><>, 41 28 bytes

asFaLF"Z"L-|Lm*jasL-F"Z"+||H

Try it online!

Gegell

Posted 2016-07-31T14:00:16.450

Reputation: 81

0

JavaScript (ES6), 89 bytes

for(i=0;i++<26;){s="";for(j=27;--j;)s=String.fromCharCode(64+(j<i?i:j))+s;console.log(s)}

Naruyoko

Posted 2016-07-31T14:00:16.450

Reputation: 459

0

MUMPS, 63 56 bytes

f i=1:1:26 w ! f j=1:1:26 w:j>i $c(j+64) w:j<=i $c(i+64)

Tested as Intersystems Caché Objectscript

João the Clown

Posted 2016-07-31T14:00:16.450

Reputation: 31

0

Japt -R, 9 bytes

;B£BhXpY

Try it

;B            :Uppercase alphabet
  ¬           :Split
   £          :Map each X at 0-based index Y
    B         :  Uppercase alphabet
     h        :  Replace as many characters as necessary at the start of that string with
      XpY     :    X repeated Y times
              :Implicit output, joined with newlines

Shaggy

Posted 2016-07-31T14:00:16.450

Reputation: 24 623

0

Java 8, 93 95 85 bytes

o->{String r="";for(char i=64,j;++i<91;r+="\n")for(j=64;++j<91;)r+=i>j?i:j;return r;}

Explanation:

Try it here.

o->{                   // Method with an empty unused parameter and a String return-type
  String r="";         //  Result-String
  for(char i=64,j;     //  Index characters
      ++i<91;          //  Loop (1) from 'A' through 'Z'
      r+="\n")         //    And append a new-line after every iteration
    for(j=64;++j<91;)  //   Inner loop (2) from 'A' through 'Z'
      r+=i>j?          //    If `i` comes later in the alphabet than `j`
          i            //     Append the result-String with `i`
         :             //    Else:
          j;           //     Append the result-String with `j`
                       //   End of inner loop (2) (implicit / single-line body)
                       //  End of loop (1) (implicit / single-line body)
  return r;            //  Return result-String
}                      // End of method

Kevin Cruijssen

Posted 2016-07-31T14:00:16.450

Reputation: 67 575

I'm afraid your golfed code won't work. – Leaky Nun – 2016-08-01T08:01:33.147

I'm pretty sure this doesn't meet the requirement that says "If it is a function, it must be runnable by only needing to add the function call to the bottom of the program": Just adding c() to the program will not print anything. As such, your print statement should also be counted towards the total byte count. – MH. – 2016-08-02T07:04:38.230

1@MH. By our defaults a function that returns the result is absolutely fine. – a spaghetto – 2016-08-03T20:07:27.527

0

C# (6.0), 173 148 Bytes

Reduced by 25 Bytes thanks to asibahi

First time code-golfing.

namespace System{class P{static void Main(){for(var i=65;i<91;++i){var a="";for(var j=65;j<91;++j)a+=(char)(Math.Max(i,j));Console.WriteLine(a);}}}}

In "readable":

namespace System
{
  class P
  {
    static void Main()
    {
      for (var i = 65; i < 91; ++i)
      {
        var a="";
        for (var j = 65; j < 91; ++j)
          a+=(char)(Math.Max(i,j));
        Console.WriteLine(a);
      }
    }
  }
}

I obviously cannot compete with other answers, but C# doesn't give much more opportunity ;-)

Alexander Mills

Posted 2016-07-31T14:00:16.450

Reputation: 101

1You're better off without both using static, and only a using System;. Also you could just place it in the global namespace. Finally .. the modifiers internal and private are redundant. – asibahi – 2016-08-02T05:05:12.180

Yay I beat C#!! – None – 2016-08-05T00:49:00.257

0

Pyke, 14 11 10 bytes

GFoj*Gj>ns

Try it here!

Blue

Posted 2016-07-31T14:00:16.450

Reputation: 26 661

0

Scratch (scratchblocks), 323 bytes

when gf clicked
set [a v] to [ABCDEFGHIJKLMNOPQRSTUVWXYZ
set [l v] to [1
repeat (26
  set [o v] to [
  repeat (l
    set [o v] to (join (o) (letter (l) of (a
  end
  set [i v] to (l
  repeat ((26) - (l
    change [i v] by (1
    set [o v] to (join (o) (letter (i) of (a
  end
  say (o) for (1) secs
  change [l v] by (1
end

scratchblocks

Proof the scratchblocks works (assuming the add "to backpack" feature still exists!), and a project demoing it.

EDIT: At a certain width, Scratch hard-wraps speech bubbles, which I use for output. There isn't really anything I can do about that.


Scratch, 74 bytes

when gf clicked
replace item (1 v) of [l v] with ([costume name v] of [_ v

A project demoing it.

This is definitely a hack!

(It could actually be shortened a bit but then it would break if you ran the project twice. This relies on a project that is.. well, exactly as the demo project!)

Florrie

Posted 2016-07-31T14:00:16.450

Reputation: 831

0

C++, 147 bytes

._. No idea why this is too long but here u go

#include <iostream>
int i;main(){for(;i<26;i++){int j;for(j=0;j++<=i;){putchar('a'+i);}for(j=i+1;j++<26;){putchar('a'+j-1);}std::cout<<std::endl;}}

user54200

Posted 2016-07-31T14:00:16.450

Reputation:

0

C, 75 bytes

Assuming ASCII (or compatible) encoding:

F(i,j){for(i=65;i<91;++i){for(j=65;j<91;++j)putchar(j<i?i:j);putchar(10);}}

Test main:

int main() { F(); }

Stefano Sanfilippo

Posted 2016-07-31T14:00:16.450

Reputation: 1 059

0

C#, 139 136 134 131 bytes

void a(){for(char i='A';i<'[';i++){char j;for(j='A';j<i;j++)Console.Write(i);for(;j<'[';j++)Console.Write(j);Console.WriteLine();}}

Ungolfed:

void a()
{
    for (char i = 'A'; i < '['; i++)
    {
        char j;

        for (j = 'A'; j < i; j++)
            Console.Write(i);

        for (; j < '['; j++)
            Console.Write(j);

        Console.WriteLine();
    }
}

EDIT1: Sharing j variable by inner loops maked profit of 3 bytes.

EDIT2: Changing i <= 'Z' to i < '[' maked profit of 2 bytes.

EDIT3: Removal of j initialization in second inner loop maked profit of 3 bytes.

paldir

Posted 2016-07-31T14:00:16.450

Reputation: 109

I think you could move the char j into the loop after it. – Loovjo – 2016-11-03T12:14:43.783

for (char j = ...)? Moving declaration of loop control variable into inner loops makes code 3 bytes longer. – paldir – 2016-11-03T12:30:13.323

Oh sorry, my mistake – Loovjo – 2016-11-03T12:31:10.163

0

Commodore 128 (BASIC 7) 52 bytes

This is based on GuitarPicker's soltion above. In fact, it's a carbon copy but with line numbers, also then should be added after if conditions in Commodore BASIC.

    0 fory=65to90:forx=65to90:ifx>ythenprintchr$(x);:elseprintchr$(y);
    1 next:print:next

This might also be compatible with the Commodore Plus/4 and C16/116 (which has BASIC 3.5)

Shaun Bebbers

Posted 2016-07-31T14:00:16.450

Reputation: 1 814

0

PHP, 120 bytes

<?$a='ABCDEFGHIJKLMNOPQRSTUVWXYZ';$b=65;$c=26;while($c>0){echo str_repeat(chr($b++),26-$c).substr($a,26-$c--).'<br>';}?>

undefined

Posted 2016-07-31T14:00:16.450

Reputation: 211

>

  • 'AB...YZ' needs no quotes (and join(range(A,Z)) is another 10 bytes shorter). 2) You can remove the <? tag if You use -r. 3) >0 is unnecessary 4) for($c=26;$c;) instead of $c=26;while($c) 5) You should loop $c from 0 to 26 and use $c / $c++ instead of 26-$c / 26-$c--. 6) Try str_pad(substr($a,...),26,chr($b++),0) instead of the str_repeat. 7) Use "\n" instead of '<br>' 8) the closing ?> tag is unnecessary
  • < – Titus – 2016-11-11T12:29:17.707

    start="9">

  • the curlys are unnecessary 10) You can find more gpolfing ideas at http://ideone.com/UUMshw to get this down to 70 bytes. Nice approach!
  • – Titus – 2016-11-11T13:01:00.683

    Found another 8 bytes: for($c=A;$c!=AA;)echo"\n",str_pad(join(range($c,Z)),26,$c++,0);, and use a physical linebreak for 62 bytes. – Titus – 2016-11-11T14:04:26.440

    0

    Racket 117 bytes

    (let((d display)(g integer->char))(for((i 26))(for((j i))(d(g(+ i 65))))(for((k(range i 26)))(d(g(+ k 65))))(d"\n")))
    

    Ungolfed:

    (define(f)
      (let ((d display)
            (g integer->char))
        (for ((i 26))
          (for ((j i))
            (d (g (+ i 65))))
          (for ((k (range i 26)))
            (d (g (+ k 65))))
          (d"\n"))))
    

    Testing:

    (f)
    

    Output:

    ABCDEFGHIJKLMNOPQRSTUVWXYZ
    BBCDEFGHIJKLMNOPQRSTUVWXYZ
    CCCDEFGHIJKLMNOPQRSTUVWXYZ
    DDDDEFGHIJKLMNOPQRSTUVWXYZ
    EEEEEFGHIJKLMNOPQRSTUVWXYZ
    FFFFFFGHIJKLMNOPQRSTUVWXYZ
    GGGGGGGHIJKLMNOPQRSTUVWXYZ
    HHHHHHHHIJKLMNOPQRSTUVWXYZ
    IIIIIIIIIJKLMNOPQRSTUVWXYZ
    JJJJJJJJJJKLMNOPQRSTUVWXYZ
    KKKKKKKKKKKLMNOPQRSTUVWXYZ
    LLLLLLLLLLLLMNOPQRSTUVWXYZ
    MMMMMMMMMMMMMNOPQRSTUVWXYZ
    NNNNNNNNNNNNNNOPQRSTUVWXYZ
    OOOOOOOOOOOOOOOPQRSTUVWXYZ
    PPPPPPPPPPPPPPPPQRSTUVWXYZ
    QQQQQQQQQQQQQQQQQRSTUVWXYZ
    RRRRRRRRRRRRRRRRRRSTUVWXYZ
    SSSSSSSSSSSSSSSSSSSTUVWXYZ
    TTTTTTTTTTTTTTTTTTTTUVWXYZ
    UUUUUUUUUUUUUUUUUUUUUVWXYZ
    VVVVVVVVVVVVVVVVVVVVVVWXYZ
    WWWWWWWWWWWWWWWWWWWWWWWXYZ
    XXXXXXXXXXXXXXXXXXXXXXXXYZ
    YYYYYYYYYYYYYYYYYYYYYYYYYZ
    ZZZZZZZZZZZZZZZZZZZZZZZZZZ
    

    rnso

    Posted 2016-07-31T14:00:16.450

    Reputation: 1 635