# Print a Tabula Recta!

The Tabula Recta (sometimes called a 'Vigenere Table'), was created by Johannes Trithemius, and has been used in several ciphers, including all variants of Bellaso's Vigenere cipher and the Trithemius cipher. It looks like this:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
BCDEFGHIJKLMNOPQRSTUVWXYZA
CDEFGHIJKLMNOPQRSTUVWXYZAB
DEFGHIJKLMNOPQRSTUVWXYZABC
EFGHIJKLMNOPQRSTUVWXYZABCD
FGHIJKLMNOPQRSTUVWXYZABCDE
GHIJKLMNOPQRSTUVWXYZABCDEF
HIJKLMNOPQRSTUVWXYZABCDEFG
IJKLMNOPQRSTUVWXYZABCDEFGH
JKLMNOPQRSTUVWXYZABCDEFGHI
KLMNOPQRSTUVWXYZABCDEFGHIJ
LMNOPQRSTUVWXYZABCDEFGHIJK
MNOPQRSTUVWXYZABCDEFGHIJKL
NOPQRSTUVWXYZABCDEFGHIJKLM
OPQRSTUVWXYZABCDEFGHIJKLMN
PQRSTUVWXYZABCDEFGHIJKLMNO
QRSTUVWXYZABCDEFGHIJKLMNOP
RSTUVWXYZABCDEFGHIJKLMNOPQ
STUVWXYZABCDEFGHIJKLMNOPQR
TUVWXYZABCDEFGHIJKLMNOPQRS
UVWXYZABCDEFGHIJKLMNOPQRST
VWXYZABCDEFGHIJKLMNOPQRSTU
WXYZABCDEFGHIJKLMNOPQRSTUV
XYZABCDEFGHIJKLMNOPQRSTUVW
YZABCDEFGHIJKLMNOPQRSTUVWX
ZABCDEFGHIJKLMNOPQRSTUVWXY


I frequently need this, but can't find it anywhere on the internet to copy and paste from. Because the square table is so long, and takes frigging ages to type, your code must be as short as possible.

### 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


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

/* Configuration */

var QUESTION_ID = 86986; // 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 = 53406; // This should be the user ID of the challenge author.

/* App */

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;
}

jQuery.ajax({
method: "get",
dataType: "jsonp",
crossDomain: true,
success: function (data) {
data.items.forEach(function(a) {
var id = +a.share_link.match(/\d+/);
});
if (!data.has_more) more_answers = false;
comment_page = 1;
}
});
}

jQuery.ajax({
method: "get",
dataType: "jsonp",
crossDomain: true,
success: function (data) {
data.items.forEach(function(c) {
if (c.owner.user_id === OVERRIDE_USER)
});
else process();
}
});
}

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 = [];

var body = a.body;
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],
});

});

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;

.replace("{{NAME}}", a.user)
.replace("{{LANGUAGE}}", a.language)
.replace("{{SIZE}}", a.size)

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)
language = jQuery(language);
jQuery("#languages").append(language);
}

}
body { text-align: left !important}

width: 290px;
float: left;
}

#language-list {
width: 290px;
float: left;
}

font-weight: bold;
}

table td {
}
<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">
<tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>

</tbody>
</table>
</div>
<div id="language-list">
<h2>Winners by Language</h2>
<table class="language-list">
<tr><td>Language</td><td>User</td><td>Score</td></tr>
<tbody id="languages">

</tbody>
</table>
</div>
<table style="display: none">
</tbody>
</table>
<table style="display: none">
<tbody id="language-template">
</tbody>
</table>

• Regarding rule 1: do we have to include each header for each function we use? – owacoder Jul 30 '16 at 15:59
• I meant if we use printf, we need to include stdio.h, if isalpha is used, ctype.h is needed, etc. Is this correct? – owacoder Jul 30 '16 at 16:03
• You should probably put "lowercase is allowed" in the challenge specification itself. Just so people are less likely to miss it if they don't see these comments. – Sherlock9 Jul 30 '16 at 18:25
• do i have to print it or can i return a string/char array – downrep_nation Jul 30 '16 at 19:57
• Thanks for the question for making me stay awake all night. (+1) – Anastasiya-Romanova 秀 Aug 22 '16 at 18:45

# Dyalog APL, 10 11 bytes

(↑⍳∘⍴⌽¨⊂)⎕A


TryAPL online!

Requires ⎕IO←0 which is standard on many systems.

The generalized 7-char function is just ↑⍳∘⍴⌽¨⊂:

↑ make the following list of strings into a character table:
⍳the indices
∘ of
⍴ the length of the argument, i.e [1, 2, 3, ..., 26]
⌽¨ each rotate
⊂ the entire argument

With the argument of ⎕A (uppercase alphabet) we get the desired result, but any argument can be fed to get the corresponding cipher:

      f←↑⍳∘⍴⌽¨⊂
f'o+×'
o+×
+×o
×o+


In fact, even strings and numbers are allowed:

      f'Alpha' 'Bravo' 'Charlie' 'Delta'
┌───────┬───────┬───────┬───────┐
│Alpha  │Bravo  │Charlie│Delta  │
├───────┼───────┼───────┼───────┤
│Bravo  │Charlie│Delta  │Alpha  │
├───────┼───────┼───────┼───────┤
│Charlie│Delta  │Alpha  │Bravo  │
├───────┼───────┼───────┼───────┤
│Delta  │Alpha  │Bravo  │Charlie│
└───────┴───────┴───────┴───────┘
f⍳8
0 1 2 3 4 5 6 7
1 2 3 4 5 6 7 0
2 3 4 5 6 7 0 1
3 4 5 6 7 0 1 2
4 5 6 7 0 1 2 3
5 6 7 0 1 2 3 4
6 7 0 1 2 3 4 5
7 0 1 2 3 4 5 6


# PHP, 64 62 61 bytes

for($a=join(range(A,Z));$i<26;)echo"
",substr($a.$a,$i++,26);  • I don't know how I haven't seen this solution before! Also, you can use range(A,Z), to save you 4 bytes. (Warnings are ignored, so, don't worry about those. If you are worried, use range(@A,@Z) and save 2 bytes) – Ismael Miguel Oct 2 '16 at 8:27 • You can save one byte with a leading linebreak: echo"\n",substr(...); – Titus Nov 11 '16 at 11:18 # PHP, 24168 64 bytes @Jörg Hülsermann kindly offered me this solution. The last one was pretty ridiculous. for($r=range(A,Z);$i++<26;$r[]=array_shift($r))echo" ",join($r);


Thanks to @Titus for saving me 4 bytes!

@Jörg Hülsermann also provided the following (and longer, with 74 bytes) version:

foreach($a=range(A,Z)as$r)echo strstr($j=join($a),$r),strstr($j,$r,1)," ";  Thank you a lot! You can try both solutions on http://sandbox.onlinephpfunctions.com/code/1a6a890887d8e817d5e9abbf521885b9306e2186 • You can shorten it to 201 Bytes echo gzdecode(base64_decode('H4sIAAAAAAAAA3XJyRGCAAAEwf9UbVDIIch9CuYfiBFMf7t4lVXdvNvu0w/jNC/rth/n9b2fX9AqgtYraJVBqwpaddBqgtY7aLVBqwtan6DVB60haI1Bawpac9BagtYatLagtQetI2idQesKWt+gdQet5w9+9/hy1gIAAA==')); – Jörg Hülsermann Oct 1 '16 at 13:00 • Other ideas for($r=range(A,Z),$i=26;$i--;$r[]=array_shift($r))echo join($r)."\n"; foreach($a=range(A,Z)as$r)echo strstr($j=join($a),$r).strstr($j,$r,1)."\n"; – Jörg Hülsermann Oct 1 '16 at 14:14
• @JörgHülsermann If you want, post it as your own answer and I will make sure to upvote. – Ismael Miguel Oct 1 '16 at 20:57
• @JörgHülsermann I don't think that that is fair. You had all the work to redude the code significantly. Also, all new answers show at the top. – Ismael Miguel Oct 1 '16 at 21:54
• @JörgHülsermann Are you sure about it? You really should make it your own answer. – Ismael Miguel Oct 2 '16 at 0:16

# Perl6, 36 bytes

say [~] rotate ["A".."Z"],$_ for ^26  rotate takes a list and an integer, and rotates the list by that number of elements. A postfix loop of ^26 (up to 26) assigns the current loop variable (in this case, a number in the range 0..15) which rotates the list 'A'..'Z' by that amount. Finally, I use the concatenate operator ~ as a reduce operator by wrapping it in square brackets, which gets applied to the list. Thanks to smls for the help. • You can use [~] to make the second version produce the correct output, and still be shorter than the first: say [~] rotate ["A".."Z"],$_ for ^26 – smls Jan 21 '17 at 5:38

ØAṙ1$ÐĿj⁷  Try it online! # Brainfuck, 203 bytes Code: >++[<+++++++++++++>-]<[>[>+>+>+<<<-]>>>[<<<+>>>-]<<<<[>>>>+>+<<<<<-]>>>>>[<<<<<+ >>>>>-]>+++++[<+++++++++++++>-]<<<<[>>>+<<<-]>>[>.+<-]>[-]>+++++[<+++++++++++++> -]<<<[>>.+<<-]>>[-]++++++++++.[-]<<<<+<-]  Explanation: At #0 >++[<+++++++++++++>-]< Put 26 in #0 [ 26 times do === Get #1 and #2 and #3 to hold count > At #1 [>+>+>+<<<-] Clone #1 into #2 and #3 and #4 >>>[<<<+>>>-]<<< Move #4 into #1 === Get #4 to hold 26 minus count which is stored in #0 < At #0 [>>>>+>+<<<<<-] Clone #0 into #4 and #5 >>>>>[<<<<<+>>>>>-]<<<<< Move #5 into #0 === Now put (count plus 65) into number #5 thereby emptying #2 === This is the starting number >>>>> At #5 >+++++[<+++++++++++++>-]< Put 65 in #5 <<<[>>>+<<<-]>>> Add value from #2 to #5 === Output first '#4' chars starting at #5 < At #4 [ >.+< Output and increase #5 -] === Put 65 in #5 > At #5 [-] Empty #5 >+++++[<+++++++++++++>-]< Put 65 in #5 === Output first count (#3) chars starting at 65 << At #3 [ >>.+<< -] === Empty #5 and output newline >> At #5 [-] ++++++++++. [-] === Increase count and prepare end of loop <<<<+ At #1 increase < At #0 -] end  Try it online! # VBA, 8977 76 bytes Function v:For i=0To 701:v=v &IIf(26=i Mod 27,vbLf,Chr(65+(i Mod 26))):Next  ... the last byte being enter at the end of the line which auto-generates the End Function. Essentially 27 copies of the alphabet with line-feeds overwritten into appropriate spots. Invoke in the Immediate window with ?v ?v ABCDEFGHIJKLMNOPQRSTUVWXYZ BCDEFGHIJKLMNOPQRSTUVWXYZA CDEFGHIJKLMNOPQRSTUVWXYZAB DEFGHIJKLMNOPQRSTUVWXYZABC EFGHIJKLMNOPQRSTUVWXYZABCD FGHIJKLMNOPQRSTUVWXYZABCDE GHIJKLMNOPQRSTUVWXYZABCDEF HIJKLMNOPQRSTUVWXYZABCDEFG IJKLMNOPQRSTUVWXYZABCDEFGH JKLMNOPQRSTUVWXYZABCDEFGHI KLMNOPQRSTUVWXYZABCDEFGHIJ LMNOPQRSTUVWXYZABCDEFGHIJK MNOPQRSTUVWXYZABCDEFGHIJKL NOPQRSTUVWXYZABCDEFGHIJKLM OPQRSTUVWXYZABCDEFGHIJKLMN PQRSTUVWXYZABCDEFGHIJKLMNO QRSTUVWXYZABCDEFGHIJKLMNOP RSTUVWXYZABCDEFGHIJKLMNOPQ STUVWXYZABCDEFGHIJKLMNOPQR TUVWXYZABCDEFGHIJKLMNOPQRS UVWXYZABCDEFGHIJKLMNOPQRST VWXYZABCDEFGHIJKLMNOPQRSTU WXYZABCDEFGHIJKLMNOPQRSTUV XYZABCDEFGHIJKLMNOPQRSTUVW YZABCDEFGHIJKLMNOPQRSTUVWX ZABCDEFGHIJKLMNOPQRSTUVWXY  • @Joffran, this is a very clever abuse of the nature of Modulus... I applaud you... bravo! – Eliseo D'Annunzio Aug 1 '16 at 1:28 • Somehow, I tried to run your program but nothing returned. What happened? FWIW, I managed to obtain VBA code with a length exactly 76 bytes. Here is my code: for j=1to 26:a="ABCDEFGHIJKLMNOPQRSTUVWXYZ":?mid(a,j,27-j)&mid(a,1,j-1):next – Anastasiya-Romanova 秀 Aug 22 '16 at 18:16 • – Anastasiya-Romanova 秀 Aug 22 '16 at 18:43 • @Anastasiya-Romanova秀 Each submission should be either a full program or function. – Joffan Aug 23 '16 at 6:43 • @Joffan It is a full program, try it. Anyway, why I couldn't get output from your code? – Anastasiya-Romanova 秀 Aug 23 '16 at 6:47 # Julia, 49 bytes println.(join.((n->circshift('A':'Z',n)).(0:25)))  Requires julia v0.5 or better for the .() broadcasting function calls. # 8086 machine code, 44 bytes 00000000 bf 2c 01 57 b0 1b 98 89 c1 51 b1 1a 89 cb b0 41 |.,.W.....Q.....A| 00000010 aa fe c0 e2 fb 59 e2 f1 89 d9 5f 57 8d 39 b0 0a |.....Y...._W.9..| 00000020 aa e2 f9 c6 05 24 b4 09 5a cd 21 c3 |.....$..Z.!.|
0000002c


How it works:

            |   org 0x100
|   use16
bf 2c 01    |       mov di, string
57          |       push di
b0 1b       |       mov al, 27
98          |       cbw
89 c1       |       mov cx, ax
51          |   a:  push cx
b1 1a       |       mov cl, 26
89 cb       |       mov bx, cx
b0 41       |       mov al, 'A'
aa          |   @@: stosb
fe c0       |       inc al
e2 fb       |       loop @b
59          |       pop cx
e2 f1       |       loop a
89 d9       |       mov cx, bx
5f          |       pop di
57          |       push di
8d 39       |   @@: lea di, [di+bx]
b0 0a       |       mov al, 0x0a
aa          |       stosb
e2 f9       |       loop @b
c6 05 24    |       mov byte [di], '$' b4 09 | mov ah, 0x09 5a | pop dx cd 21 | int 0x21 c3 | ret | string rb 0  • so amazing, teach me senpai :p – NTCG Jul 15 '18 at 21:54 # Common Lisp, SBCL, 9794 90 bytes (dotimes(i 26)(format t"~a~a "(#1=subseq #2="ABCDEFGHIJKLMNOPQRSTUVWXYZ"i 26)(#1##2#0 i)))  Try it online! ### Explanation #2="ABCDEFGHIJKLMNOPQRSTUVWXYZ";save alphabet to #2# and return it (dotimes(i 26);loop from i=0 to i=25 (format t"~a~a "(#1=subseq #2="ABCDEFGHIJKLMNOPQRSTUVWXYZ"i 26)(#1##2#0 i)));display concatenation of subseqences of alpabet (#1##2#0 i) works like (subseq "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 0 i)  Ideas for improvement are welcomed. Could rotatef be better here? -1 byte thanks to Renzo explicitly -3 bytes by applying knowledge from Renzo's comment, using #2# for alphabet instead of using set and using <enter> instead of ~%. • You can save 1 byte (!) with the sharpsign-number: (dotimes(i 26)(format t"~a~a~%"(#1=subseq(set's"ABCDEFGHIJKLMNOPQRSTUVWXYZ")i 26)(#1#s 0 i))) – Renzo Jul 21 '17 at 14:40 • @Renzo Thank you! I didn't know you can write #1#s with no space between #1# and s. That can save me some bytes in other challenges. Using that knowledge and also changing set into #N= macro and using <enter> instead of ~% additional 3 bytes can be saved:) – user65167 Jul 21 '17 at 21:58 # QBasic, 57 bytes FOR i=0TO 701 ?CHR$(10-(i MOD 27<26)*(55+i MOD 26));
NEXT


Basically the same as Anders Kaseorg's Python 2 answer, though independently derived: Run a single loop from 0 to 701; the letter to print is the loop index mod 26; but every 27th iteration, instead of printing the letter, print a newline. Saves 3 bytes over the naive nested-loop approach.

Note that QBasic's display is 25 lines tall by default, so you won't see the whole table. One way to resolve this is to add SCREEN 11 at the beginning, since screen mode 11 is 30 lines tall.

## Knight, 53 bytes

;=s*"ZABCDEFGHIJKLMNOPQRSTUVWXY"=i 26WiO Gs*25=i-iT26


Native Knight doesn't (currently) have a way to convert to and from ascii (there's discussions about adding one, though). As such, we have to just write the entire alphabet out. Expanded out:

# just make a massive string that we'll index into.
; = str * "ZABCDEFGHIJKLMNOPQRSTUVWXY" (= i 26)
: WHILE i # while nonzero
: OUTPUT GET (
s # get from s
(* 25 (= i (- i 1)) # starting at position 25 * --i
26) # and get 26 characters

• 50 bytes: ;=i 0W>26iO G*"ZABCDEFGHIJKLMNOPQRSTUVWXY"2=i+iT26 – EasyasPi May 26 at 18:07

# JavaScript, 110 bytes

My answer might be sub-optimal, but I think my method is cool enough to warrant using it.

a="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
b=a.split("")
b.map((n,m)=>b.map((o,p,q,r=m)=>a[(q+p)%26].join("")).join("\n")


Tested in the Firefox browser console.

• This is neat. I tried to auto-generate my seed A-Z, but you've inspired me to just include it as a string. Thanks for the input! – Polyducks Jul 30 '16 at 21:36
• b and a have the same characters at the same indices, so you don't need to store the string into a. In fact, you don't even have to store the array into b either - it's the 3rd parameter to the map callback. Also, use [..."A...Z"] rather than "A...Z".split(""). – Neil Jul 30 '16 at 22:54
• Oh, and I forgot to mention you can use join instead of join("") and when you do that you can actually put a literal newline in the string rather than \n. – Neil Jul 30 '16 at 22:55

# Ruby, 42 36 bytes

-3 bytes from @MartinEnder, -3 bytes from @xsot

Try it online!

a=*?A..?Z
a.map{puts a*'';a.rotate!}

• It's a bit shorter if you rotate after printing: repl.it/ChtJ/1 – Martin Ender Jul 31 '16 at 11:10
• In addition to Martin's improvement, you can also change 26.times to a.map. – xsot Jul 31 '16 at 12:39

# ><>, 54 52 bytes

Prints two newlines after the grid, instead of one.

'6'd*1-::?!v1-60.
.2co-$'Z'%*r!d2< %,2'6':;!?l<~oa^?  Try it online! ## Explanation '6'd*1- push 701 onto stack ::?!v1-60. push numbers 700..0 onto the stack r reverse, stack top now contains 701. goto (1) -$'Z'%* !d2<            (2) calculate 'Z' - (stack top % 26)
o                        output letter
;!?l<                (1) if stack is empty, we're done
%,2'6':                     duplicate stack top, mod 27
~oa^?           if non-zero, goto (2), else print a newline and pop stack top.


# F#, 74 bytes

for i=0 to 25 do(for j=0 to 25 do printf"%c"<|char((j+i)%26+65));printfn""


Pretty straightforward

# Clojure, 1061058988 80 bytes

(print(apply str(map #(char(if(< 25(mod % 27))10(+ 65(mod % 26))))(range 702))))


Old version 87 bytes:

(for[i(range 26)](prn(String.(byte-array(flatten(reverse(split-at i(range 65 91))))))))


Mod approach pretty much minimized to the limit, still looking for a way to shorten the line version

# Awk, 73 bytes

awk 'BEGIN{for(a="ABCDEFGHIJKLMNOPQRSTUVWXYZ";i<26;)print substr(a a,++i,26)}'


Edit: Dennis saved me a few bytes. And I learned a new Awk trick.

• Welcome to Programming Puzzles & Code Golf! This is a standalone awk program; you don't have to count the invocation. Also, this saves a few more bytes. – Dennis Aug 3 '16 at 3:11

## Jellyfish, 19 17 bytes

Thanks to Zgarb for saving 4 bytes.

This answer is non-competing, since Zgarb fixed a few bugs to make this valid.

P& ,r"[Z
\26 'A


Try it online

### Explanation

r"[Z
'A


This creates the following array by threading range('A', ...) over the pair "[Z":

["ABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXY"]


Then , flattens this into a single string.

Finally this bit gets all substrings of length 26:

&
\26


And P prints the result in matrix format, one string per line.

# PHP, 47 42 bytes

for($s=" A";$p<702;$s++)echo$s[++$p%27>0];  using string increment. Run with -nr. hints: $s=_A;$s++; <=> $s=_B; and $s=_Z;$s++; <=> $s=_A;. I use newline instead of underscore to further exploit the indexing. 43 bytes with PHP >= 7.1 (for the negative indexing): for($s=A;$s<ZZ;$s++)echo++$p%27?$s[-1]:"
";


hints: $s=A;$s++; <=> $s=B;, $s=Z;$s++; <=> $s=AA; and $s=AZ;$s++; <=> $s=BA; older 47 bytes version: for(;$p++<702;)echo chr($p%27?($p-1)%26+65:10);


Why use "\n" if I already use chr()? :D

# oK, 16 bytes

c$26':51#65+!26  Explanation:  65+!26 / letters A to Z 51# / double the list, except for Z 26': / sliding window of size 26 c$              / convert to characters


# Japt, 10 9 bytes

8 bytes of code, +1 for the -R flag.

26Æ;BéXn


Try it online!

# Sinclair ZX81/Timex TS1000/1500, 127 bytes92 bytes 88 bytes (listing)

 1 LET A$="ABCDEFGHIJKLMNOPQSTUVWXYZ" 2 SCROLL 3 PRINT A$
4 LET A$=A$(2 TO)+A$(1) 5 GOTO 2  The string is declared in one line, rather than looping through the character set and building up the string from an empty one. It then manipulates the built string like a scrolly text, making this an easy challenge for 8 bit programmers. You can try it online by typing in the listing using JtyOne online emulator. Good luck with that. # R, 44 bytes Immediately outgolfed by Robert Hacken. write(matrix(LETTERS,27,26)[-27,],"",26,,"")  Try it online! ### Explanation of the golf: The other two R answers each use were using a cat-based approach, using some pretty clever indexing tricks. Using write, though, which is really a wrapper for cat, we automatically get to break the data into lines, and since there isn't a ... argument in write, we can use positional matching to shorten things like sep, although we do still have to specify file. So the only missing part is generating the data in a golfy way. matrix automatically recycles its argument (going down rows), so I originally had matrix(LETTERS,27,27), which generates ABCDEFGHIJKLMNOPQRSTUVWXYZA BCDEFGHIJKLMNOPQRSTUVWXYZAB CDEFGHIJKLMNOPQRSTUVWXYZABC DEFGHIJKLMNOPQRSTUVWXYZABCD EFGHIJKLMNOPQRSTUVWXYZABCDE FGHIJKLMNOPQRSTUVWXYZABCDEF GHIJKLMNOPQRSTUVWXYZABCDEFG HIJKLMNOPQRSTUVWXYZABCDEFGH IJKLMNOPQRSTUVWXYZABCDEFGHI JKLMNOPQRSTUVWXYZABCDEFGHIJ KLMNOPQRSTUVWXYZABCDEFGHIJK LMNOPQRSTUVWXYZABCDEFGHIJKL MNOPQRSTUVWXYZABCDEFGHIJKLM NOPQRSTUVWXYZABCDEFGHIJKLMN OPQRSTUVWXYZABCDEFGHIJKLMNO PQRSTUVWXYZABCDEFGHIJKLMNOP QRSTUVWXYZABCDEFGHIJKLMNOPQ RSTUVWXYZABCDEFGHIJKLMNOPQR STUVWXYZABCDEFGHIJKLMNOPQRS TUVWXYZABCDEFGHIJKLMNOPQRST UVWXYZABCDEFGHIJKLMNOPQRSTU VWXYZABCDEFGHIJKLMNOPQRSTUV WXYZABCDEFGHIJKLMNOPQRSTUVW XYZABCDEFGHIJKLMNOPQRSTUVWX YZABCDEFGHIJKLMNOPQRSTUVWXY ZABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZA This is almost the right answer, just I'd need to remove the last row and column, e.g., matrix(LETTERS,27,27)[-27,-27]. This is 47 bytes, which is as good as one of the R answers. But the recycling doesn't change for a 27x26 matrix, and that neatly drops the last column, allowing me to remove the second -27 index. # Stax, 5 bytes É,=■♦  Run and debug online! ## Explanation Bytes counted in CP437. Uses the unpacked version to explain. VAgl|( VA The alphabet gl Iterate until a loop is found, print each iteration on a separate line |( Left rotate by 1 element  # Fortran (GFortran), 91 bytes DO I=0,25 DO J=0,25 WRITE(*,'(A)',ADVANCE='NO')CHAR(MOD(J+I,26)+65) ENDDO PRINT*, ENDDO END  Try it online! # Python 3, 64 bytes e='ABCDEFGHIJKLMNOPQRSTUVWXYZ';exec('print(e);e=e[1:]+e[0];'*26)  Try it online! # sed 4.2.2 + bash, 48 + 2 (-rn) = 565451 50 bytes s/$/printf %c {A..Z}/e
:
P
s/^([^Z])(.+)/\2\1/
t


Try it online!

s/$/printf %c {A..Z}/e # Set the pattern space to "printf %c {A..Z}" and # set the result of that to the pattern space : # Unnamed label P # Print the pattern space s/^([^Z])(.+)/\2\1/ # Move the first letter (it should not be a Z) to the end of the first line t # Loop until the pattern space does not change # The -n flag suppresses implicit printing of the pattern space at the end of the program  # Pure sed 4.2.2, 57 + 2 (-rn) = 59 bytes s/$/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
:
P
s/^([^Z])(.+)/\2\1/
t


Try it online!

# T-SQL, 98 bytes

DECLARE @ CHAR(26)='ABCDEFGHIJKLMNOPQRSTUVWXYZ'a:PRINT @
SET @=RIGHT(@,25)+@ IF'A'<LEFT(@,1)GOTO a


A couple of things make this work like it does:

• Fixing the CHAR type at 26 means I don't have to manually trim the string after I double it.
• Found through testing that RIGHT() is shorter than SUBSTRING() or STUFF().
• Rearranging the order of my IF allowed me to save a character, plus one more by using < instead of <>, since that's a valid string comparison. (Although, strictly speaking, character ordering will depend on the SQL collation used; practically, though, I know of no collation that will order these particular characters differently.)

# Powershell, 54 bytes

-join[char[]](0..702|%{if($_%27){--$_%26+65}else{10}})

• There is the cool solution from @Joey – mazzy Jul 5 '18 at 19:07