95
\$\begingroup\$

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

Leaderboard

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 */

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>

\$\endgroup\$
14
  • \$\begingroup\$ Regarding rule 1: do we have to include each header for each function we use? \$\endgroup\$
    – owacoder
    Jul 30, 2016 at 15:59
  • \$\begingroup\$ I meant if we use printf, we need to include stdio.h, if isalpha is used, ctype.h is needed, etc. Is this correct? \$\endgroup\$
    – owacoder
    Jul 30, 2016 at 16:03
  • 3
    \$\begingroup\$ 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. \$\endgroup\$
    – Sherlock9
    Jul 30, 2016 at 18:25
  • 2
    \$\begingroup\$ do i have to print it or can i return a string/char array \$\endgroup\$ Jul 30, 2016 at 19:57
  • 1
    \$\begingroup\$ Thanks for the question for making me stay awake all night. (+1) \$\endgroup\$ Aug 22, 2016 at 18:45

173 Answers 173

1
\$\begingroup\$

Jelly, 6 bytes

ØAṙƬ1Y

Try it online!

How it works

ØAṙƬ1Y - Main link. Takes no arguments
ØA     - Yield the uppercase alphabet
   Ƭ   - Until a repeated value is found, collecting all intermediate values:
  ṙ 1  -   Rotate the uppercase alphabet once to the left
     Y - Join by newlines and implicitly print
\$\endgroup\$
1
\$\begingroup\$

BRASCA, 24 bytes

D:e{+re[a0,[:om]loxm,A{]

Try it online!

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

Stax, 21 8 bytes

Ç╙Ö&XΔ┼§

Run and debug it

old solution

É%≡m√£¿oR'ñ÷►H◘Æ£╠◄µ-
\$\endgroup\$
1
\$\begingroup\$

Vyxal jrṀ, 5 bytes

₄ƛkAǓ

Try it Online!

Or a flagless alternative for 6 bytes.

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

Elixir, 64 bytes

Experimenting with learning Elixir, there's probably a better way, but this is the best I've come up with so far...

import Enum
a=?A..?Z
map 0..25,&IO.puts slice(concat(a,a),&1,26)

Try it online!

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

Excel, 65 bytes

=LET(x,ROW(1:701),CONCAT(IF(MOD(x,27),CHAR(MOD(x-1,26)+65),"\n")))

/n represents a line break input with Alt+Enter.

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

Bash + coreutils (tr), 58 bytes

-5 bytes thanks to @pxeger!

for c in {A..Z};{
eval "echo {$c..Z} $e|tr -d ' '"
e+=$c
}

Try it online!

\$\endgroup\$
3
  • \$\begingroup\$ Using this tip, you can shrink the loop to tio.run/##S0oszvj/Py2/…; you can also change e=$e$c to e+=$c. And you can shrink the loop a bit more, and get rid of the eval if you switch to Zsh: ato.pxeger.com/… \$\endgroup\$
    – pxeger
    Oct 21, 2021 at 16:25
  • \$\begingroup\$ @pxeger thank you! You know I tried using {...} but missed the ; before the { and figured I was misremembering and must be confusing the syntax with functions... Thanks for the reminder. I also didn't know += existing in Bash so that's awesome! \$\endgroup\$ Oct 22, 2021 at 8:30
  • 1
    \$\begingroup\$ @pxeger I think that Zdh answer deserves it's own spot to be honest... \$\endgroup\$ Oct 22, 2021 at 8:35
1
\$\begingroup\$

Zsh, 47 bytes

for c ({A..Z}){echo {$c..Z} $e|tr -d \ ;e+=$c;}

Attempt This Online!

Thanks to Dom Hastings!

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

Pip, 12 bytes

P*z@$+GMC26u

Try It Online!

Explanation

       MC26   Map this function to a 26x26 grid of coordinate pairs:
    $+          Sum
      G         the two coordinates
   @            Use that as a (cyclical) index into
  z             the lowercase alphabet
P*            Print each row of the grid
           u  Suppress autoprinting
\$\endgroup\$
1
\$\begingroup\$

Vyxal 3 j,, 4 bytes

nᶨṘS

Try it Online!

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

Python 2, 60 bytes

print''.join(chr(10+(-~i%27and 55+i%26))for i in range(701))

Similar to my C answer: a single loop, printing the alphabet every 26 characters but with every 27th character replaced by a newline.

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

Racket, 130 bytes

(display(string-join(build-list 26((λ(l)(λ(n)(list->string(append(drop l n)(take l n)))))(map integer->char(range 65 91))))"
"))

Racket doesn't have a cycle-like function for its lists, so I have to make do.

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

C#, 100 bytes

Supplied because I think the other C# answer is invalid, and this is a different way of generating the table entirely. Full program because I don't like supplying just functions... and because it's 100bytes. Appears to use the same method as the VBA answer provided by Joffan.

class P{static void Main(){for(int i=0;i<702;i++)System.Console.Write((char)(i%27>25?10:i%26+65));}}

Optional trailing \n (change 702 to 701 to get rid of it). Very simple: works by counting from 0 to 26*27 (26 letters + 1 newline, 26 times). Each count of i, it prints the char value of either 10 (LF) if it is newline time (every 27th character), else it prints the capital ASCII numeral of the i%26th letter of the alphabet. The starting letter is implicitly offset by injecting the LF at every 27th character.

I am sad I can't move the i++ out of the loop declaration, but I don't think it pays to turn the conditional into a lookup/other, which would enable me to perform the increment after computing the alphabet ASCII value.

Formatted code:

class P
{
    static void Main()
    {
        for(int i=0;i<702;i++)
            System.Console.Write((char)(i%27>25?10:i%26+65));

        System.Console.ReadKey(true); // just for debug
    }
}
\$\endgroup\$
7
  • \$\begingroup\$ i++<702; instead of i<702;i++ for -1. Main(i){for(; instead of Main(){for(int i=0; for -10? \$\endgroup\$ Jul 31, 2016 at 16:15
  • \$\begingroup\$ @EʀɪᴋᴛʜᴇGᴏʟғᴇʀ The first one isn't so simple, because we need to start at i=-1 instead, which just adds the byte back (we have to start a 0 because we are doing modulo). The second doesn't work, because C# doesn't guess types like C, and requires variables to be assigned before use (including primatives) \$\endgroup\$ Jul 31, 2016 at 16:18
  • \$\begingroup\$ Suffix incrementation does not return the incremented value, it returns the value before incrementation. If int i is equal to 16, i++ would return 16, not 17. \$\endgroup\$ Jul 31, 2016 at 16:21
  • \$\begingroup\$ @EʀɪᴋᴛʜᴇGᴏʟғᴇʀ sorry, not sure I follow... it's i=0 so that the first value of i in the loop is 0 (so we get the alphabet proper, starting at 'A' - it's expensive to offset the modulus because it adds brackets). I am well acquainted with i++ and ++i, and note that they are well defined in C# (unlike C, I gather). I can't have the ++ in the i%27 because I need the same i in the i%26 (this will be the incremented value in C#, because it's to the right of the ++). This is why it would be nice to turn it around, and do a lookup on the value, so that the ++ can be at the end. \$\endgroup\$ Jul 31, 2016 at 16:26
  • \$\begingroup\$ At least you can surely save a byte using i++<702; instead of i<702;i++. Are you sure i++ returns incremented i instead of i? ( ) Yes ( ) No [Submit] \$\endgroup\$ Jul 31, 2016 at 16:40
0
\$\begingroup\$

ListSharp, 200 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]
{
ROWS a=GETLINES s [k TO 26]
ROWS b=GETLINES s [0 TO k-1]
STRG p=p+a+b+<newline>
}
SHOW=p

Even if you dont know this language, you can probably see how straight forward it is.

Thats the point of it, feel free to ask any questions

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

Python 2, 68 bytes

A simple exec loop that prints ''.joined lines one at a time. Golfing suggestions are welcome.

i=0;exec"print ''.join(chr(65+(i+j)%26)for j in range(26));i+=1;"*26
\$\endgroup\$
0
\$\begingroup\$

Java, 163 bytes

public class M{public static void main(String[]s){String a="abcdefghijklmnopqrstuvwxyz";for(int i=-1;++i<26;)System.out.println(a.substring(i)+a.substring(0,i));}}

More readable version:

public class M {
    public static void main(String[] s) {
        String a = "abcdefghijklmnopqrstuvwxyz";
        for (int i = -1; ++i < 26;)
            System.out.println(a.substring(i) + a.substring(0, i));
    }
}

Essentially, every iteration, it starts at index i and prints to the end, then starts at index 0 and prints to index i. I'm sure I could golf this down a bit.

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

Javascript (using external library) (88 bytes)

a=>_.Range(0,26).WriteLine(x=>_.Range(x,26).Write("",y=>String.fromCharCode((y%26)+65)))

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

Code explanation: Create range from 0 to 25. For each integer in range, write a line according to the predicate. For each integer, the predicate says to create a range starting at the current integer value, extending for 26 elements. That range is concatenated into a single string, according to a predicate that modulates that range's current integer value by 26, adds 65 because thats the code for 'A', then gets parsed to a string.

enter image description here

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

SAS/IML, 88 bytes

proc iml;a=j(26,26);do r=0to 25;a[r+1,]=mod((0:25)+r,26)+65;end;a=byte(a);print a;quit;

Explanation:

proc iml;        *necessary?;
  a=j(26,26);    *initialize matrix;
  do r=0to 25;   *iterate for 26;
      a[r+1,]=mod((0:25)+r,26)+65;  *Assign correct ASCII code - mod by 26;
  end;
  a=byte(a);     *use BYTE function, cannot use this on earlier line unfortunately;
  print a;       *actual output;
quit;            *necessary?;

Unfortunately have to initialize the matrix in IML for this to work, and cannot apply the byte() call in the assignment stage, so lose a few bytes there. Not sure if quit; should be needed, or even if proc iml; is needed, per rules - these are needed to type the whole thing into the SAS process as is, there is no IML specific executable, but there is "IML Studio" which perhaps would mean we don't need those 14 bytes?

Another SAS/IML option that golfs to a byte bigger - 89 bytes that is - is the equivalent of the R optimal solution:

proc iml;
  a=repeat('A':'Z',26);   *initialize array to all A-Z;
  do r=1 to 25;           *we have to (and want to) skip row one;
      a[r+1,]=a[1,r+1:26]||a[1,1:r];  *concatenate subvectors;
  end;
  print a;
quit;
\$\endgroup\$
1
  • \$\begingroup\$ I had hoped to do a bit better in the second solution by just squishing the whole vector again onto it, but that doesn't work because SAS won't automatically truncate the extra positions :( (Probably a good thing in real programming but a drag here!) \$\endgroup\$
    – Joe
    Aug 1, 2016 at 16:21
0
\$\begingroup\$

Groovy, 63

l='A'..'Z'as Queue;(l+[]).each{println l.join();l<<l.remove()}

Found a cool way to copy a list by using (l+[]) instead of l.clone()

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

Swift, 104 84 81 73 bytes

(0...701).map{print(UnicodeScalar($0%27==26 ?13:65+$0%26),terminator:"")}
\$\endgroup\$
0
\$\begingroup\$

VBA, 71 bytes 70 bytes

Run the below code in the Immediate Window

for j=1to 26:a="ABCDEFGHIJKLMNOPQRSTUVWXYZ":?mid(a,j)&left(a,j-1):next

Output:

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
\$\endgroup\$
0
\$\begingroup\$

Jelly, 7 bytes

ØAṙJṙ-Y

Try it online!

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

MY-BASIC, 70 bytes

A port of my uBASIC answer.

For i=0 To 25
For j=0 To 25
Print Chr(65+(I+J)Mod 26)
Next
Print;
Next

Try it online!

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

SNOBOL4 (CSNOBOL4), 69 bytes

M	&UCASE LEN(X) . R REM . L
	OUTPUT =L R
	X =LT(X,25) X + 1	:S(M)
END

Try it online!

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

Rust Nightly, 168 bytes

#![feature(slice_rotate)]fn main(){let mut a=(65..91).collect::<Vec<u8>>();for _ in 0..26{println!("{}",String::from_utf8(a.clone()).unwrap());a.rotate_left(1);}}

Ungolfed version:

#![feature(slice_rotate)]
fn main() {
    let mut range = (65..91).collect::<Vec<u8>>();
    for _ in 0..range.len() {
        println!("{}",String::from_utf8(range.clone()).unwrap());
        range.rotate_left(1);
    }
}

The code is fairly self explanatory. range starts off being set to the ASCII alphabet (uppercase) and is leftshifted as the program runs.

The #![feature()] is needed until the rotate_left and rotate_right std functions are stabilized.

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

Yabasic, 60 bytes

Once again is again the best BASIC.

For I=0To 25
For J=0To 25
?Chr$(65+Mod(I+J,26));
Next
?
Next

Try it online!

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

Visual Basic .NET (Mono), 131 bytes

Another answer.

Module M
Sub Main
Dim I,J,S
For I=0To 25
S=""
For J=0To 25
S+=Chr(65+(I+J)Mod 26)
Next
Console.WriteLine(S)
Next
End Sub
End Module

Try it online!

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

PHP, 100 Bytes

Try it online!

Code, recursive function

function f($p=25){$a=implode(range(A,Z));echo 
($p>=0)?substr($a,$p).substr($a,0,$p)."
".f($p-1):"";}

Explanation

function f($p=25){      # The function get as a parameter the position  
$a=implode(range(A,Z)); # create a string with all the letters from A->Z
echo ($p>=0)?           # position greater than 0, used on ^
substr($a,$p)           # substring from start to $p
.substr($a,0,$p)."      # concat with substring from $p
".f($p-1)               # call the function with next $p               
:"";                    
}
\$\endgroup\$
0
\$\begingroup\$

Prolog (SWI), 88 bytes

?-between(0,25,I),(between(0,25,J),C is 65+(I+J)mod 26,writef("%n",[C]),1=0;nl),1=0;1=1.

Try it online!

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

Kotlin, 55 bytes

(0..701).map{print(if(it%27>0)'A'+(it-1)%26 else '\n')}

Testscript:

var f = {
(0..701).map{print(if(it%27>0)'A'+(it-1)%26 else '\n')}
}

fun main(args: Array<String>) {
    f()
}
\$\endgroup\$

Your Answer

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