| Bytes | Lang | Time | Link |
|---|---|---|---|
| 063 | AWK | 250313T202812Z | xrs |
| 080 | Tcl | 170217T015820Z | sergiol |
| 114 | C# | 241009T195436Z | ˈvɔlə |
| 017 | Uiua | 241008T032526Z | noodle p |
| 009 | Japt | 210910T115419Z | Shaggy |
| 080 | Java | 160822T125457Z | Kevin Cr |
| 007 | Vyxal j | 210910T114042Z | emanresu |
| 036 | Ruby | 160809T234848Z | Jordan |
| 008 | Stax | 241002T163803Z | Khuldrae |
| 008 | Vyxal 3 j | 240111T032546Z | pacman25 |
| 034 | Knight | 220804T192022Z | 97.100.9 |
| 020 | Brachylog v1 | 160810T043203Z | Leaky Nu |
| 046 | Zsh | 220616T111310Z | pxeger |
| 078 | Python 2 | 211209T190310Z | Larry Ba |
| 041 | jq nr | 210910T120254Z | ovs |
| 010 | Jelly | 210107T081336Z | Razetime |
| 018 | Pip n | 200915T095055Z | Razetime |
| 009 | 05AB1E | 200915T094103Z | lyxal |
| 012 | APL Dyalog Unicode | 200915T093520Z | Bubbler |
| 015 | Charcoal | 200915T090339Z | Razetime |
| 013 | APL Dyalog Unicode | 180201T001050Z | ngn |
| 067 | PHP | 180131T225600Z | Link |
| 083 | uBASIC | 180131T191401Z | Taylor R |
| 077 | MYBASIC | 180131T191038Z | Taylor R |
| 140 | Visual Basic .NET Mono | 180131T190815Z | Taylor R |
| 069 | Yabasic | 180131T190538Z | Taylor R |
| 050 | Excel VBA | 170904T173929Z | Taylor R |
| 052 | Mathematica | 171130T122422Z | ZaMoC |
| 056 | R | 160810T065706Z | plannapu |
| 077 | c64 basic v2 | 170913T205234Z | peterh |
| 064 | Bash | 170913T211301Z | Justin M |
| 008 | SOGL V0.12 | 170913T210052Z | dzaima |
| 019 | q/kdb+ | 170913T195457Z | mkst |
| 023 | K oK | 170913T194904Z | mkst |
| 012 | Pyth | 170913T181608Z | Stan Str |
| 019 | Recursiva | 170913T174739Z | 0xffcour |
| 098 | Javascript | 170216T231723Z | Spydercr |
| 155 | Windows batch | 170525T124026Z | stevefes |
| 052 | Bash + Unix utilities | 170217T035933Z | Mitchell |
| 086 | Common Lisp | 170216T223133Z | user6516 |
| 052 | PHP | 161111T135639Z | Titus |
| 056 | Python | 161111T132938Z | NeRoboto |
| 090 | JavaScript | 160810T202721Z | user4851 |
| 095 | GNU sed | 160910T125321Z | seshouma |
| 090 | TSQL | 160822T141356Z | S.Karras |
| 053 | Python 2 | 160822T161319Z | ospahiu |
| 106 | Bash | 160822T122011Z | KM. |
| 064 | PHP | 160815T103122Z | Jeroen |
| 086 | C | 160810T184717Z | IanC |
| 083 | JavaScript ES6 | 160810T003847Z | Neil |
| 060 | C | 160810T061056Z | orlp |
| 029 | Vitsy | 160812T091127Z | Addison |
| 111 | TSQL | 160810T145717Z | t-clause |
| 107 | C# | 160811T143811Z | RobotZeb |
| 083 | Vim | 160810T045950Z | addison |
| 138 | Oracle SQL 11.2 | 160810T062733Z | Jeto |
| 065 | Python 2.7 | 160811T071503Z | ElPedro |
| 064 | Scala | 160811T045044Z | Isvara |
| 066 | Mathematica | 160811T023541Z | Michael |
| 090 | python 3 | 160811T030533Z | AvahW |
| 099 | JavascriptES5 | 160810T100154Z | ajxs |
| 043 | PowerShell | 160810T022449Z | Tessella |
| 042 | VIM | 160810T210629Z | Riley |
| 093 | Logo | 160810T191014Z | GuitarPi |
| 065 | PHP | 160810T190427Z | insertus |
| nan | 160810T181505Z | Wes | |
| 133 | TSQL 133 Bytes Golfed by @tclausen.dk | 160810T124243Z | Anuj Tri |
| 041 | Ruby | 160810T160855Z | daniero |
| 053 | EXCEL | 160810T160811Z | user5630 |
| 137 | Java 8 | 160810T060402Z | Akash Th |
| 102 | PHP | 160810T155014Z | gabe3886 |
| 071 | C | 160810T024514Z | Karl Nap |
| 050 | Perl 6 | 160810T153855Z | elcaro |
| 236 | ListSharp | 160810T151912Z | downrep_ |
| 058 | Haskell | 160809T235102Z | nimi |
| 026 | Perl | 160809T235138Z | Dada |
| 097 | JAVA 9 | 160810T145056Z | user9023 |
| 138 | C# | 160810T144205Z | aphariel |
| 031 | Vim | 160810T145734Z | lynn |
| 013 | Pyke | 160810T145247Z | Blue |
| 084 | Javascript using external library Enumerable | 160810T144633Z | applejac |
| 023 | RETURN | 160810T142149Z | Mama Fun |
| 012 | 05AB1E | 160810T141944Z | Emigna |
| 059 | Neoscript | 160810T133447Z | TuxCraft |
| 051 | Julia | 160810T021310Z | Mama Fun |
| 019 | J | 160810T060914Z | Leaky Nu |
| 038 | MATLAB | 160810T094029Z | user5838 |
| 086 | Brainfuck | 160810T090445Z | Sp3000 |
| 026 | Jellyfish | 160810T080343Z | Zgarb |
| 104 | Brainfuck | 160810T071650Z | orlp |
| 065 | Lua | 160810T031506Z | ATaco |
| 010 | Pyth | 160810T050619Z | isaacg |
| 046 | Julia | 160810T025611Z | Dennis |
| 010 | Pyth | 160809T234023Z | Doorknob |
| 013 | MATL | 160810T002212Z | Luis Men |
| 010 | Jelly | 160810T003107Z | Dennis |
| 054 | Python 2 | 160809T234107Z | Karl Nap |
| 048 | Cheddar | 160809T233902Z | Downgoat |
| 010 | Convex | 160809T233538Z | GamrCorp |
AWK, 63 bytes
{for(;i++<26;print)for(j=0;j++<13;)printf("%c%c",i+64,i%26+65)}
I hate having two prints in there, but can't find a way out (without using more bytes).
Tcl, 80 bytes
time {puts [string repe [format %c%c [expr [incr i]+64] [expr $i%26+65]] 13]} 26
while {[incr i]<27} {puts [string repe [format %c%c [expr $i+64] [expr $i%26+65]] 13]}
C#, 115 114 Bytes
for(var c='A';c<='Z';c++)Console.WriteLine(String.Join("",Enumerable.Repeat($"{c}{(char)Math.Min('A',c+1)}",12)));
Uiua, 20 17 bytes
≡&p+@A◿26⊞+⤙◿2⇡26
Try it: Uiua pad
Fun array-langy way of doing it. Takes the addition table of the range to 26 and that mod 2, then takes that mod 26 so after Z is A, and add the character A to each.
Japt -R, 11 9 bytes
-R;By@BéÓYv
;By@BéÓYv
;B :Uppercase alphabet
y :Transpose
@ :Pass each row through the following function and transpose back
Bé : Rotate the alphabet right this many times
Ó : Bitwise not of the negation of
Y : 0-based index
v : Parity
Java, 80 bytes
v->{for(int i=0;i<703;)System.out.printf("%c",i++%27>0?65+(i/27+i%27%2)%26:10);}
Based on @orlp's amazing answer, so also has a leading newline character.
Explanation:
v->{ // Method with empty unused parameter and no return
for(int i=0;i<703;) // Loop `i` in the range [0,703):
System.out.printf("%c", // Print a character with the following codepoint:
i++%27>0? // If `i` is NOT divisible by 27:
// (and increase `i` by 1 with `i++` afterwards)
65+(i/27+i%27%2)%26 // The codepoint of the current letter to print
: // Else:
10);} // The codepoint of a newline character instead
Vyxal j, 7 bytes
kAǏz13*
kA # uppercase alphabet
Ǐ # Append the first letter
z # Get overlapping pairs
13* # Repeat each 13 times
# (j flag) join by newlines
Ruby, 42 39 38 37 36 bytes
-3 bytes thanks to @user81655
-1 bytes each thanks to @manatwork, @NotthatCharles, and @TKirishima
?A.upto(?Z){puts (_1+_1.next[0])*13}
Stax, 8 bytes
┘;2Q╛e≥M
Run and debug it at staxlang.xyz!
Unpacked (10 bytes)
VAc|(\m13*
VA uppercase alphabet
c|( and a copy rotated by one
\ zip, producing an array of length-2 strings
m map and print each:
13* repeat 13 times
Knight, 34 bytes
;=a 65;W>90aO*+AaA=a+1a 13O*"ZA"13
Expanded code:
;=a 65
;WHILE > 90 a
OUTPUT * (+(ASCII a) (ASCII (= a(+ 1 a)))) 13
OUTPUT (* "ZA" 13)
There's probably a better way to deal with the last row, but I don't know it.
Another 34-byte solution:
;=a 0W>26aO*+A+65aA+65%=a+1a 26 13
Brachylog v1, 30 24 20 bytes
@Ab:"a"c:@Arz:{:12jc:@Nc.}a:wa@Ab:"a"c:@Arze:12jcw@Nw\@A$(:@Arze:12jcw@Nw\
Python 2, 78 bytes
a="abcdefghijklmnopqrstuvwxyz"
for i in range(len(a)):print(a[i]+a[-~i%26])*13
Pip -n, 18 bytes
(z.z)@>_@<2X13M,26
Pip doesn't have transpose, so I just took two letter substrings and repeated them.
-n joins lists with newlines.
05AB1E, 11 9 bytes
AuDÀø13×»
Posting because it beats the other 05AB1E answer and kinda uses a different method
-2 with vectorisation
Explained
Au # Push the uppercase alphabet. STACK = [A-Z]
D # Duplicate that. STACK = [A-Z, A-Z]
À # Rotate the alphabet left. STACK = [A-Z, Rotate_Left(A-Z)]
ø # Zip those two alphabets. STACK = ["AB", "BC", "CD", "DE", "EF", "FG", "GH", "HI", "IJ", "JK", "KL", "LM", "MN", "NO", "OP", "PQ", "QR", "RS", "ST", "TU", "UV", "VW", "WX", "XY", "YZ", "ZA"]
13×» # Repeat each 13 times and join with newline
APL (Dyalog Unicode), 12 bytes
⍉↑26⍴⌽∘⎕A¨⍳2
Requires ⎕IO←0, so that ⍳2 evaluates to 0 1.
How it works
⍳2 ⍝ 0 1
⌽∘⎕A¨ ⍝ Rotate the uppercase alphabet 0 and 1 times,
⍝ giving ["ABC..Z", "BCD..ZA"]
26⍴ ⍝ Cycle the two strings to the length of 26
⍉↑ ⍝ Promote to a matrix and transpose
Bunch of 13- and 14-byte solutions
⍉↑26⍴⎕A(1⌽⎕A)
⍉↑26⍴0 1⌽¨⊂⎕A
(26⍴⍳2)⊖∘.⊣⍨⎕A
∪⍉↑26⍴↓2 27⍴⎕A
∪26⍴⍤1⍉2 27⍴⎕A
These are included in the TIO link above.
PHP, 78, 72, 67 bytes
<?php $s='A';while($s!='AA')echo str_repeat($s++.(--$s)[0],13)."
";
uBASIC, 83 bytes
0ForI=1To26:ForJ=0To12:?Left$(Chr$(I+64),1)+Left$(Chr$(IMod26+65),1);:NextJ:?:NextI
MY-BASIC, 77 bytes
For I=1 To 26
For J=0 To 12
Print Chr(I+64)+Chr(I Mod 26+65)
Next
Print;
Next
Visual Basic .NET (Mono), 140 bytes
Module M
Sub Main
Dim I,J,S
For I=1To 26
S=""
For J=0To 11
S+=Chr$(I+64)+Chr$(I Mod 26+65)
Next
Console.WriteLine(S)
Next
End Sub
End Module
Yabasic, 69 bytes
For I=1To 26
For J=0To 12
?Chr$(I+64)+Chr$(Mod(I,26)+65);
Next
?
Next
Excel VBA, 50 Bytes
Anonymous VBE immediate window function that takes no input and outputs a wave to the range [A1:Z26] on the ActiveSheet object
[A1:Z26]="=Char(Mod(Row()+IsEven(Column()),26)+64)
Mathematica, 52 bytes
Column[""<>#~Table~13&/@Partition[Alphabet[],2,1,1]]
-1 byte from Martin Ender
R, 72 67 60 56 bytes
write(matrix(LETTERS[c(1:26,2:26,1)],26,26,T),"",26,,"")
Thanks to @Giuseppe for the extra 4 bytes off!
Old rep-based solution at 60 bytes:
for(i in 1:26)cat(rep(LETTERS[c(i,i%%26+1)],13),"\n",sep="")
See here on an online interpreter. Thanks to @user5957401 for the extra 7 bytes off!
Old matrix-based solution at 72 bytes:
for(i in 1:26)cat(matrix(LETTERS[c(1:26,2:26,1)],26,26)[i,],"\n",sep="")
See here on an online interpreter.
c64 basic v2, 95 93 85 83 77 bytes
0fOy=65to90:l$="":a$=cH(y)+cH(y+1+(y=90)*26)
1fOx=0to12:l$=l$+a$:nE:?l$:nE
Screenshot:
Trial instructions are in my previous answer.
Bash, 64 bytes
f()(tr A-Z B-ZA|tee >(((i++<25))&&f);echo)
printf ZA%.s {a..m}|f
Credit to seshoumara's sed answer for the idea of translating A-Z to B-ZA.
SOGL V0.12, 8 bytes
Z«Z¹'⁰∙I
Explanation:
Z push the uppercase alphabet
« put its first letter at the end
Z push the alphabet once again
¹ wrap in array: ["BCDEFGHIJKLMNOPQRSTUVWXYZA", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
'⁰∙ multiply vertically 13 times
I rotate clockwise
q/kdb+, 19 bytes
Solution:
26#'.Q.A,'1_27#.Q.A
Explanation:
Shorter and different to my oK solutions as we have a shortcut to the uppercase alphabet by means of .Q.A. As always, interpreted right-to-left
26#'.Q.A,'1_27#.Q.A / solution
.Q.A / shortcut to uppercase alphabet, ABC..XYZ
27# / 27 take, wraps to get ABC...XYZA
1_ / 1 drop, drop first element to give BCD...XYZA
.Q.A,' / concatenate each left/right lists, so AB, BC, CD etc
26#' / 26 take each, gives ABABA.. BCBCB... etc
K (oK), 23 bytes
Solution:
`c$65+26#'a,'1_27#a:!26
Explanation:
`c$65+26#'a,'1_27#a:!26 / solution
!26 / range 0..25
a: / save as 'a'
27# / 27 take, wraps to make ABC...XYZA
1_ / 1 drop, take off leading A
a,' / concatenate each element with each of a (AB,BC,etc)
26#' / 26 take each, wraps to get ABABAB... BCBCBC... etc
65+ / add 65, vectorised (65=A in ASCII)
`c$ / cast to characters
Bonus:
Here are a couple of other ways to get the result:
24 chars: Try it online!
`c$65++26#(!26;1_27#!26)
27 chars: Try it online!
26#'+0 1_'26 27#\:`c$65+!26
Pyth, 12 bytes
I haven't been there
VG*13+N@G=hZ
Explanation:
VG In the lowercase alphabet...
*13 13 times...
+N@G=hZ The current item concatenated with alphabet[++Z]
Javascript, 98 Bytes
for(var j=371,s="";j<1333;j+=37){for(i=0;i<13;i++)s+=j.toString(36).replace("100","za");s+="<br>"}
Windows batch, 155 bytes
@set s=ABCDEFGHIJKLMNOPQRSTUVWXYZA
@set/ac=-1
:L
@set/ac+=1
@call set t=%%s:~%c%,2%%
@for /l %%i in (1,1,13) do @cd|set/p=%t%
@echo(
@if %t% neq ZA @goto l
Bash + Unix utilities, 53 52 bytes
dc "-e65[d257*1+16 52^65535/*POP1+d91>x]dsxx"|tr [ A
Test run:
dc "-e65[d257*1+16 52^65535/*POP1+d91>x]dsxx"|tr [ A
ABABABABABABABABABABABABAB
BCBCBCBCBCBCBCBCBCBCBCBCBC
CDCDCDCDCDCDCDCDCDCDCDCDCD
DEDEDEDEDEDEDEDEDEDEDEDEDE
EFEFEFEFEFEFEFEFEFEFEFEFEF
FGFGFGFGFGFGFGFGFGFGFGFGFG
GHGHGHGHGHGHGHGHGHGHGHGHGH
HIHIHIHIHIHIHIHIHIHIHIHIHI
IJIJIJIJIJIJIJIJIJIJIJIJIJ
JKJKJKJKJKJKJKJKJKJKJKJKJK
KLKLKLKLKLKLKLKLKLKLKLKLKL
LMLMLMLMLMLMLMLMLMLMLMLMLM
MNMNMNMNMNMNMNMNMNMNMNMNMN
NONONONONONONONONONONONONO
OPOPOPOPOPOPOPOPOPOPOPOPOP
PQPQPQPQPQPQPQPQPQPQPQPQPQ
QRQRQRQRQRQRQRQRQRQRQRQRQR
RSRSRSRSRSRSRSRSRSRSRSRSRS
STSTSTSTSTSTSTSTSTSTSTSTST
TUTUTUTUTUTUTUTUTUTUTUTUTU
UVUVUVUVUVUVUVUVUVUVUVUVUV
VWVWVWVWVWVWVWVWVWVWVWVWVW
WXWXWXWXWXWXWXWXWXWXWXWXWX
XYXYXYXYXYXYXYXYXYXYXYXYXY
YZYZYZYZYZYZYZYZYZYZYZYZYZ
ZAZAZAZAZAZAZAZAZAZAZAZAZA
Common Lisp, SBCL, 86 bytes
(dotimes(i 26)(format t"~13@{~a~:*~}~%"(subseq"ABCDEFGHIJKLMNOPQRSTUVWXYZA"i(+ i 2))))
Explanation
(dotimes(i 26);loop from i=0 to i=25
(format t"~13@{~a~:*~}~%"(subseq"ABCDEFGHIJKLMNOPQRSTUVWXYZA"i(+ i 2))))
;print 13 times pairs of "AB", "BC", ... , "ZA"
PHP, 52 bytes
for($a=A;$a!=AA;)echo str_pad("\n",27,$a++.$a[0],0);
Can JavaScript beat this? Run with -r.
Python, 56
for k in range(26):print(chr(k+65)+chr((k+1)%26+65))*13
JavaScript, Z (90) bytes
for(i=65,b=66;i<91;++i,b=b<90?++b:65)console.log(Array(14).join(String.fromCharCode(i,b)))
To learn:
var start = 65,
end = 90;
for (var i = start, b = i+1; i <= end; ++i) {
var chars = String.fromCharCode(i, b);
/* repeat chars 14 times */
console.log(Array(14).join(chars));
}
GNU sed, 95 bytes
s,^,@@@@@@@@@@@@@,;s,@,AB,g
:;p
y,ABCDEFGHIJKLMNOPQRSTUVWXYZ,BCDEFGHIJKLMNOPQRSTUVWXYZA,
/^Z/!b
I wish the 'y' command had this syntax: y,A-Z,B-ZA,.
T-SQL 99 90 bytes
Saved 9 bytes thanks to @t-clausen.dk
DECLARE @ INT=65z:PRINT REPLICATE(CHAR(@)+CHAR(IIF(@=90,65,@+1)),13)SET @+=1IF @<=90GOTO z
Ungolfed:
DECLARE @CurrCharacter INT = 65; --ASCII decimal for 'A'
WHILE (@CurrCharacter <=90) --ASCII decimal for 'Z'
BEGIN
PRINT REPLICATE(
REPLACE(CHAR(@CurrCharacter)+CHAR(@CurrCharacter+1),'[','A')
,13); --Replicate the current character and its neighbor 13 times. If the neighbor is '[' (ASCII code 91) then replace it with 'A'.
SET @CurrCharacter+=1; --Go to the next letter
END
Python 2 53 bytes
i=0;exec'print(chr(i+65)+chr(-~i%26+65))*13;i+=1;'*26
Bash, 149, 115, 111, 106 bytes
for i in {0..25};{
printf $(printf %b%b \\`printf %o $[i+65]` \\`printf %o $[-~i%26+65]`)%.s {a..m};echo
}
(thanks @manatwork, saved 34, 4 more bytes)
Bash, 140 bytes
(thanks @steeldriver)
for i in {0..25}; do printf "$(printf '%b%b' \\$(printf '%03o' $((i+65))) \\$(printf '%03o' $((-~i%26+65))))%.0s" {1..13}; printf \\n; done
Save to <file> and run as: /bin/bash <file>
PHP, 70 66 64 Bytes
<?$a=A;$b=B;while($a!=AA)echo str_repeat($a++.($b++)[0],13)."
";
3 bytes short (if I would remove the <? as well) from @insertusernamehere answer. So close!
EDIT:
Actually got it to 66 bytes (64 without the <?)! Doing A and B without quotes actually seem to work. Seems to be the shortest PHP one as time of write :D
EDIT 2: Also removed " " from AA. Still seems to be working.
C (86 bytes):
for(int c=-11,n=-26;++n<1;){while(c++){printf("%c%c",90+n,n?91+n:65);}c=-11;puts("");}
My first attempt on a Code Golf challenge.
Some answers are really impressive!
JavaScript (ES6), 88 83 bytes
_=>[..."ABCDEFGHIJKLMNOPQRSTUVWXYZ"].map((c,i,a)=>(c+a[-~i%26]).repeat(13)).join`\n`
Where \n represents the literal newline character. Writing the alphabet out saved me three bytes today, but @LeakyNun saved me another five bytes.
C, 60 bytes
main(i){for(;i<703;)putchar(i++%27?65+(i/27+i%27%2)%26:10);}
Vitsy, 29 bytes
So, instead of doing the typical thing, I used my two-dimensional stacking to generate the alphabets and then offset them by one from each other, alternating back and forth between them.
9a*d5*Hd\[:{:}]Y?y\[y\[O?]aO]
9a*d5*H Push an alphabet to the stack.
9a* Push 90 to the stack (character code 'Z')
d5* Push 65 to the stack (character code 'A')
H Pop a, b, push range (a, b)
d\[:{:}] Establish the other stacks, while alternating.
d\[ ] Do the bracketed code 13 times.
: : Clone the stack.
{ Put the top item of the stack on the bottom.
} Put the bottom item of the stack on the top.
Y Discard a stack. (13*2+1-1 = 26)
? Rotate right a stack (we start on 'A' now)
y\[y\[O?]aO] Output.
y\[ ] Repeat the code in brackets number of stacks times (26).
y\[ ] Repeat the code in brackets number of stack times (26).
O Pop a, print a as a character.
? Go right a stack.
aO Output a newline.
TSQL, 111 bytes
DECLARE @o varchar(702)='',@ int=1WHILE @<702SELECT @o+=CHAR(IIF(@%27=0,10,65+(@/27+1-@%27%2)%26)),@+=1PRINT @o
C#, 107 bytes
My first attempt at a submission to PPCG
Golfed:
var l="";int i=0,j=0;for(;i<26;i++){for(;j<26;j++)l+=(char)(((j%2)+i)%26+65);Console.WriteLine(l);l="";j=0;}
Ungolfed:
var l="";
int i=0,j=0;
for(;i<26;i++){
for(;j<26;j++)l+=(char)(((j%2)+i)%26+65);
Console.WriteLine(l);
l="";j=0;
}
Pretty sure this adheres to standards! Would love to hear any potential improvements.
Vim, 85 83 bytes
:h<_<cr><cr><cr>YZZP:s/./\0\r/g<cr><c+v>ggy25Pqqlxj:let @a='xkPjj'<cr>25@akia<esc>25klq11@qh<ctrl+v>25jylpl<c+v>25jdGdd
I know this can be golfed more, but my head hurts so I gotta stop for now.
<cr> is the enter key, <c+v> is ctrl+v, and <esc> is the escape key. Those were all counted as one byte.
I recorded a gif of this, but it got screwed up. The video is fine though: http://recordit.co/ldLKvho9Gi
Oracle SQL 11.2, 141 138 bytes
SELECT LISTAGG(CHR(l+64)||CHR(MOD(l,26)+65))WITHIN GROUP(ORDER BY l)FROM(SELECT CEIL(LEVEL/13)l FROM DUAL CONNECT BY LEVEL<339)GROUP BY l;
Un-golfed
SELECT LISTAGG(CHR(l+64)||CHR(MOD(l,26)+65))WITHIN GROUP(ORDER BY l)
FROM (
SELECT CEIL(LEVEL/13)l
FROM DUAL
CONNECT BY LEVEL<339 -- 26*13+1
)
GROUP BY l
Python 2.7, 65 bytes
Python 2 alternative using a recursive function
def l(a=0):
print(chr(a+65)+chr(-~a%26+65))*13
if a<25:l(-~a)
Scala, 64 bytes
Can anyone improve on this?
(('A'to'Z'):+'A').sliding(2).map(_.mkString*13).foreach(println)
Mathematica, 82 75 67 66 bytes
Print@FromCharacterCode@PadLeft[{},26,{i-1,i}~Mod~26+65]~Do~{i,26}
Technically shorter, although it prints in lowercase instead of uppercase:
Mathematica, 64 bytes
Print[""<>FromLetterNumber@Table[{i-1,i}~Mod~26+1,13]]~Do~{i,26}
python 3, 92 90 bytes
a=65
b=66
for i in range(312):
if a>89:b=65
print(chr(a)+chr(b),end="")
if (i+1)%12<1:
a+=1
b+=1
print()
python 2, 80 bytes
a=65
b=66
for i in range(312):
if a>89:b=65
print chr(a)+chr(b),
if (i+1)%12<1:
a+=1
b+=1
print
This program outputs AB AB AB AB... rather than ABABABAB... I'm not sure if this is allowed, but it's the best I can come up with.
EDIT:
Thanks @User902383 for you comment on @TAsk's post allowing me to shave off 2 bytes.
And thanks @NoOneIsHere for suggesting that I move to python 2 instead of 3, I've included a second program in python 2 with a new byte count.
Javascript(ES5), 107 99 bytes
for(var s="",i=-1;++i<676;)i&&!(i%26)&&(s+="\n"),s+=String.fromCharCode((i/26+i%2)%26+65);alert(s);
PowerShell, 49 43 bytes
TimmyD's remix:
65..89|%{-join[char[]]($_,++$_)*13};"ZA"*13
was, 49 bytes:
0..25|%{(""+[char]($_+++65)+[char]($_%26+65))*13}
VIM, 42
:h<_↵↵↵YZZP:s/./&\r/g↵^25↑y↑pG2↑aa↓^ggy13P
where:
↵is return,- ^ is ctrl + v
- ↑ is the up arrow
- ↓ is escape
I'm sure this can be golfed more. I'm new to VIM so any suggestions are appreciated.
Logo, 93 bytes
Here's a non-graphical Logo solution. Try it online with Calormen.com's interpreter.
to m:c type char 65+modulo:c 26end
to b:a repeat 13[m:a-1 m:a] pr" end
repeat 26[b repcount]
PHP, 65 bytes
Well, this is pretty straight forward:
for(;$i<26;)echo str_repeat(chr(65+$i).chr(65+(++$i%26)),13)."
";
Improving on @gabe3886's answer (new account and not able to comment)
PHP 94 92 Bytes
<?php for($i=0;$i<26;)echo str_repeat(substr('ABCDEFGHIJKLMNOPQRSTUVWXYZA',$i++,2),13)."\n";
However if you suppress notices, it's 92 90 bytes
<?php for(;@$i<26;)echo str_repeat(substr('ABCDEFGHIJKLMNOPQRSTUVWXYZA',@$i++,2),13)."\n";
T-SQL 133 Bytes (Golfed by : @t-clausen.dk)
SELECT REPLICATE(Char(number+65)+IIF(number=25,'A',Char(number+66)),13)FROM spt_values WHERE number<26and'P'=TYPE
T-SQL , 151 Bytes
Using CTE to generate sequence of number
;WITH n(a,v) AS(SELECT CHAR(65)+CHAR(66), 66 UNION ALL SELECT CHAR(v)+CHAR(v+1), v+1 FROM n WHERE v < 91)SELECT REPLICATE(REPLACE(a,'[','A'),13) FROM n
T-SQL, 155 Bytes
SELECT REPLICATE(Char(number+65)+ CASE WHEN number=25 THEN 'A' ELSE Char(number+66) END, 13) FROM master.dbo.spt_values WHERE name IS NULL AND number < 26
Ruby, 41 bytes
26.times{|i|puts [*?A..?Z,?A][i,2]*''*13}
EXCEL: 53 bytes
=REPT(CHAR(ROW(A1)+64)&CHAR(MOD(ROW(A1),26)+65),13)
Place in A1 and drag to desired length of wave (in this case, 26, one cell for each letter).
Java 8, 139 137 bytes
()->{for(int i=65,j=1;;j++){if(j>25){j=++i<91?1:0;System.out.println();
if(j==0)break;}System.out.print((char)i+""+(char)(i>89?65:i+1));}}
PHP, 102 bytes
<?php $a='ABCDEFGHIJKLMNOPQRSTUVWXYZA';$i=-1;while($i++<25){echo str_repeat(substr($a,$i,2),13)."\n";}
C, 77 74 71 bytes
Basically the same as the Python answer inspired by LeakyNun, Thanks to owacoder for puts
:
f(i,j){for(i=0;++i<27;puts(""))for(j=13;--j;printf("%c%c",i+64,i%26+65));}
Usage:
f();
While mathematically Using a count up loop for (26-n)%26 == (-n)%26, this is not true for C, otherwise these two bytes can be shaved off.i resolves the problem
Perl 6, 50 bytes
say .join x 13 for flat('A'..'Z','A').rotor(2=>-1)
ListSharp, 236 bytes
ROWS x=ROWSPLIT "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,T,S,U,V,W,X,Y,Z,A" BY [","]
[FOREACH NUMB IN 1 TO 26 AS i]
{
STRG t =""
[FOREACH NUMB IN 1 TO 13 AS j]
{
STRG e=GETLINE x [i]
STRG r=GETLINE x [i+1]
STRG t=t+e+r
}
ROWS s=s+t
}
SHOW=s
Feel free to comment if you want anything to be explained to you
Haskell, 60 58 bytes
mapM putStrLn[[0..12]>>[a,b]|a:b:_<-scanr(:)"A"['A'..'Z']]
Starting with "A" scanr(:) builds the a list from the chars of ['A'..'Z'] from the right. (-> ["ABCDE...A", "BCDEF..A", ..., "XYZA", "YZA", "ZA", "A"]). (a:b:_) matches the first two chars of each sublists (with at least two chars) and makes 13 copies of it.
Perl, 26 bytes
Solution from @Dom Hastings. (12 bytes shorter than mine!)
-1 byte thanks to @Ton Hospel
say+($_++,chop)x13for A..Z
Run with -M5.010 or -E :
perl -E 'say+($_++,chop)x13for A..Z'
JAVA 9, 103 97 bytes
it works on JShell, provided by Java9 SDK.
for(int c=64,i;++c<91;)for(i=0;i<26;)System.out.print((char)((c-13+i%2)%26+65)+(i++<25?"":"\n"))
C# - 159 138 bytes
var a="ABCDEFGHIJKLMNOPQRSTUVWXYZA";for(int i=0;i<26;i++){for(int j=0;j<14;j++){Console.Write("{0}{1}",a[i],a[i+1]);}Console.WriteLine();}
Javascript (using external library Enumerable) (84 bytes)
n=>(w=_.Range(0,26)).WriteLine(x=>w.Write("",y=>String.fromCharCode((x+y%2)%26+65)))
Link to lib: https://github.com/mvegh1/Enumerable/
Code explanation: Create a range of ints starting at 0 for count of 26. Store into global variable w. For each, write a new line according to predicate. Predicate states to take "w" and write a joined string based off the passed predicate to Write. Predicate to Write uses an empty string as the join delimiter, and uses the current integer value from WriteLine ("x") and the current integer value from Write ("y") to calculate the correct string at that position
Edit: Removed extra parens to save 2 bytes
RETURN, 23 bytes
'A'[␊'B'[␊'A␈13␋␄'␊°␇␂,
NOTE: Use the "Insert String" button and paste the above code in.
Explanation
Basically generates A-Z and B-Z and A at the end on the stack. Then the stack is duplicated 13 times, transposed, joined with a newline, and outputted.
Due to a bug that I just can't fix, 'A'[␊${25@}13␋␄'␊°␇␂, does not work.
05AB1E, 12 bytes
ADÀ)øvyJ5Ø×,
Explanation
AD # push 2 copies of the alphabet
À # rotate the 2nd one left by 1
)ø # add to list and zip
v # for each
yJ # join the pair
5Ø× # repeat it 13 times
, # print with newline
Neoscript, 59 bytes
a=('A:[]:'Z)+'Aeach n=0:[]:25console:log((a[n]+a[n+1])*13);
Julia, 51 bytes
!()=join(["$x$(x+1-26(x>89))"^13for x='A':'Z'],"
")
Initial golfing.
J, 20 19 bytes
1 byte thanks to miles.
u:65+26|(+/2&|)i.26
This is actually the program I used to generate the text in the challenge.
MATLAB, 47 38 bytes
a=(65:90)';char(repmat([a a([2:end 1])],1,13))
char(repmat([65:90;[66:90 65]]',1,13))
The first makes a column array of the alphabet in ASCII, appends a shifted copy as a column to its right, replicates the resulting 26*2 array 13 times columnwise, casts to a character array and prints by default.
The second makes a 2*26 array of alphabet and shifted alphabet, transposes it then continues as above.
Brainfuck, 88 86 bytes
++[[+>]<+<++]+>-[[->+>+<<]>>-]++++++++[<[++++++++<+<]>[>]<-]<<++<[>+++[->.<<.>]<<++.<]
Requires an interpreter with 8-bit cells and a tape not bounded on the left. Try it online!
Jellyfish, 26 bytes
P
+'A
~
| S
+$ r2
,'
r'
Note the trailing unprintable characters on the last two lines. Try it online!
Explanation
This is basically an arithmetic manipulation approach: make a 26×26 grid with alternating 0-1 pattern, add the index of each row to every element of the row, reduce mod 26, and add the ASCII value of A.
Characters in Jellyfish are just numbers with a special flag, and all arithmetic works on them as expected.
From bottom to top:
- The
's are character literals; they are followed by unprintables with ASCII code 26, and stand for those characters. - The lower
rcomputes the character range from 0 to 25. - The
,forms a pair from the two unprintable chars. - The higher
ris given argument2, and forms the range[0 1]. - The
$takes that range, and reshapes it into the shape given by its other argument, which is the pair of unprintables. This gives a 26×26 matrix of alternating rows0 1 0 1 0 1 ... - The lower
+adds the char range 0-25 to this matrix. The addition distributes on the rows, so row i is incremented by i. It's also converted to a char matrix, since the south argument consists of chars. - The
~|is modulus with flipped arguments: the south argument (the above char matrix) is reduced modulo the east argument (theSturns the argument-seeking process south, so this is the unprintable literal 26). - The higher
+adds the literalAto every coordinate of the resulting matrix. - The
Pprints the result in matrix format, that is, each row on its own line without quotes.
Brainfuck, 104 bytes
>+[+[<]>>+<+]><<+++++[>+++++>>++<<<-]>[-<+++++++++++++[->>.+.-<<]>>>.<+<]<----[>+<----]>++>>+++[-<.<.>>]
Lua, 80 65 Bytes.
s = string c = s.char for i=1,26 do print(s.rep(c(64+i)..c((65+(i%26))),13)) end
With help from Leaky Nun
c=("").char for i=1,26 do print((c(64+i)..c(65+i%26)):rep(13))end
Lua is a pretty inefficent language in regards to handling of strings and such, so this is the best I can narrow it down.
Pyth, 10 bytes
jCm.<G~!ZG
Explanation:
jCm.<G~!ZG
m G Map over G, predefined to the lowercase alphabet.
This will give 26 columns.
.<G Left shift (cyclically) G by
Z Z elements. Z is initialized to 0.
~! After using its value, logical not Z. (0 -> 1, 1 -> 0)
C Transpose
j Join on newlines
Pyth, 11 10 bytes
jC*13.<BG1
G the alphabet
B bifurcate over
.< 1 left shift by 1
*13 repeat 13 times
C transpose
j join on newlines
MATL, 13 bytes
1Y2tn:!to~!+)
1Y2 % Predefined string literal: 'AB···Z'
tn: % Duplicate, number of elements, range: gives [1, 2, ···, 26]
! % Transpose into a column vector
to~! % Duplicate and transform into [0, 1, 0, 1, ···, 1] using modulo 2
+ % Addition with broadcast. Gives 2D numeric array
) % Index (modularly) into string. Implicitly display.
Jelly, 10 bytes
26ḶḂØAṙZj⁷
How it works
26ḶḂØAṙZj⁷ Main link. No arguments.
26Ḷ Yield [0, ..., 25].
Ḃ Bit; compute the parity of each intger.
ØAṙ Rotate the alphabet by these amounts.
Z Zip; transpose rows and columns.
j⁷ Join, separating by linefeeds.
Python 2, 70 68 54 bytes
List based solution:
L=map(chr,range(65,91))
for i in range(-26,0):print(L[i]+L[i+1])*13
But why create a list? Thanks LeakyNun:
for i in range(26):print(chr(i+65)+chr(-~i%26+65))*13
Cheddar, 48 bytes
print(65|>90).map(l->@"[l,l>89?65:l+1]*13).vfuse
Cheddar is good with strings :D
Explanation
print
(65|>90) // Range from 65 (A) to 90 (Z)
.map(l-> // Map through range
@" // Convert following array of char codes to string
[l, // The character
l>89?65:l+1] // See below for explanation
*13 // Repeat 13 times
).vfuse // Vertically fuse
What does l>89?65:l+1 do? Well 89 is the char code for Y. Basically, l>89 is checking if the letter is Z, that means we should be returning A. If l>89 is false. I'll return l+1, the next char
Convex, 10 bytes
U_(+]D*zN*
U Predefined Variable: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
_(+ Push a copy with the 'A at the end.
] Add both strings to an array.
D* Repeat array 13 times. D defaults to 13.
z Transpose.
N* Join by newlines. N defaults to "\n"




