You are to print this exact text:
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
Specs
- You can print all lowercase instead of all uppercase. However, case must be consistent throughout the output.
- You may print one extra trailing linefeed.
Scoring
Since this is an alphabet wave that fluctuates to a small extent, your code should also be small in terms of byte-count. In fact, the smallest code in terms of byte-count wins.
-
40\$\begingroup\$ Seriously, another alphabet challenge? \$\endgroup\$Nathan Merrill– Nathan Merrill2016年08月09日 23:33:12 +00:00Commented Aug 9, 2016 at 23:33
-
6\$\begingroup\$ @NathanMerrill As numerous as they are, I don't think they are worthy of downvotes. (I do not imply you downvoted, I am merely saying.) \$\endgroup\$Conor O'Brien– Conor O'Brien2016年08月09日 23:34:07 +00:00Commented Aug 9, 2016 at 23:34
-
14\$\begingroup\$ As long as the patterns are sufficiently different, I don't think it matters if we use the alphabet, decimal digits, asterisks and underscore, etc. \$\endgroup\$Dennis– Dennis2016年08月09日 23:35:42 +00:00Commented Aug 9, 2016 at 23:35
-
9\$\begingroup\$ @Dennis regardless of the characters used, its these type of "pattern" challenges that are getting overused, IMO. I don't think its offtopic, but I would enjoy some fresh air. \$\endgroup\$Nathan Merrill– Nathan Merrill2016年08月09日 23:40:33 +00:00Commented Aug 9, 2016 at 23:40
-
16\$\begingroup\$ It's clear there's no more demand for alphabet challenges - only 39 people answered in the first 15 hours... \$\endgroup\$trichoplax is on Codidact now– trichoplax is on Codidact now2016年08月10日 15:23:58 +00:00Commented Aug 10, 2016 at 15:23
99 Answers 99
C, 60 bytes
main(i){for(;i<703;)putchar(i++%27?65+(i/27+i%27%2)%26:10);}
-
11\$\begingroup\$ This is genius. \$\endgroup\$Leaky Nun– Leaky Nun2016年08月10日 06:11:13 +00:00Commented Aug 10, 2016 at 6:11
-
1\$\begingroup\$ Nice to see C in a code golf challenge. \$\endgroup\$micheal65536– micheal655362016年08月11日 14:03:54 +00:00Commented Aug 11, 2016 at 14:03
-
\$\begingroup\$ @MichealJohnson "see C", I C what you did there. ;) And I agree with Leaky Nun. Sometimes I wonder how people come up with some of these ingenious answers. \$\endgroup\$Kevin Cruijssen– Kevin Cruijssen2016年09月02日 12:41:07 +00:00Commented Sep 2, 2016 at 12:41
-
\$\begingroup\$ @KevinCruijssen That was unintentional lol. \$\endgroup\$micheal65536– micheal655362016年09月02日 19:52:00 +00:00Commented Sep 2, 2016 at 19:52
Brainfuck, 104 bytes
>+[+[<]>>+<+]><<+++++[>+++++>>++<<<-]>[-<+++++++++++++[->>.+.-<<]>>>.<+<]<----[>+<----]>++>>+++[-<.<.>>]
-
1\$\begingroup\$ Practically the same size as Hello World. Impressive! \$\endgroup\$phyrfox– phyrfox2016年08月10日 09:00:31 +00:00Commented Aug 10, 2016 at 9:00
-
3\$\begingroup\$ @phyrfox Actually... \$\endgroup\$Sp3000– Sp30002016年08月10日 12:29:58 +00:00Commented Aug 10, 2016 at 12:29
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"
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
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
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}
-
1\$\begingroup\$ Nowdays with Ruby 2.7 you can use _1 and you can go down to 36 bytes.
?A.upto(?Z){puts (_1+_1.next[0])*13}\$\endgroup\$touka– touka2022年06月17日 12:40:24 +00:00Commented Jun 17, 2022 at 12:40
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
-
\$\begingroup\$ I thought you can insert
@"between them. \$\endgroup\$Leaky Nun– Leaky Nun2016年08月09日 23:45:28 +00:00Commented Aug 9, 2016 at 23:45 -
\$\begingroup\$ Doesn't this use a function return? \$\endgroup\$Conor O'Brien– Conor O'Brien2016年08月09日 23:46:36 +00:00Commented Aug 9, 2016 at 23:46
-
\$\begingroup\$ @ConorO'Brien yeah? \$\endgroup\$Downgoat– Downgoat2016年08月09日 23:47:20 +00:00Commented Aug 9, 2016 at 23:47
-
\$\begingroup\$ codegolf.stackexchange.com/questions/89283/… \$\endgroup\$Conor O'Brien– Conor O'Brien2016年08月09日 23:47:55 +00:00Commented Aug 9, 2016 at 23:47
-
\$\begingroup\$ @ConorO'Brien oh, didn't see in challenge spec. will fix \$\endgroup\$Downgoat– Downgoat2016年08月09日 23:48:10 +00:00Commented Aug 9, 2016 at 23:48
Jelly, 10 bytes
26ḶḂØAṙZj7
How it works
26ḶḂØAṙZj7 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.
j7 Join, separating by linefeeds.
-
\$\begingroup\$ Didn't
Yexist back then? Also congrats for 100k rep!! \$\endgroup\$Erik the Outgolfer– Erik the Outgolfer2016年09月30日 15:46:27 +00:00Commented Sep 30, 2016 at 15:46 -
\$\begingroup\$ Thanks! I checked and, sadly,
Ywas added two days after the challenge was posted. \$\endgroup\$Dennis– Dennis2016年09月30日 15:50:03 +00:00Commented Sep 30, 2016 at 15:50 -
\$\begingroup\$ Because you could have golfed it further down to
26ḶḂØAṙZY. But, as it is right now, it's still good. \$\endgroup\$Erik the Outgolfer– Erik the Outgolfer2016年09月30日 15:51:32 +00:00Commented Sep 30, 2016 at 15:51
Vim, 31 bytes
:h<_↵↵↵YZZPJra0qqy2l13Plr↵25@qD
Where ↵ is the Return key.
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.
-
\$\begingroup\$ Considering some of the cheats used by other languages on a regular basis I consider it only fair to not include the actual printing. In this case you could replace it with "(++"\n")=<<" and save 2 bytes. Possibly more. \$\endgroup\$MarLinn– MarLinn2016年08月11日 05:44:57 +00:00Commented Aug 11, 2016 at 5:44
-
\$\begingroup\$ @MarLinn: No, I don't think so. Golfing languages are designed with implicit printing in mind and most other answers do have some sort of printing command. Btw,
unlinesis even shorter than(++"\n")=<<. \$\endgroup\$nimi– nimi2016年08月11日 15:37:54 +00:00Commented Aug 11, 2016 at 15:37
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}
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
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.
-
1\$\begingroup\$ I wanted to try to golf but then I saw the name of him who wrote the code. \$\endgroup\$Leaky Nun– Leaky Nun2016年08月10日 08:04:42 +00:00Commented Aug 10, 2016 at 8:04
-
\$\begingroup\$ @LeakyNun You can still try! Although 26 bytes is fitting for this challenge. \$\endgroup\$Zgarb– Zgarb2016年08月10日 08:26:26 +00:00Commented Aug 10, 2016 at 8:26
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.
-
1\$\begingroup\$ if you change the indext to
i in 1:26and then the letter selection toLETTERS[c(i,i%%26+1)]you can drop like 6 or 7 bytes \$\endgroup\$user5957401– user59574012016年08月10日 13:07:29 +00:00Commented Aug 10, 2016 at 13:07 -
1\$\begingroup\$ @user5957401 arf I was so stubbornly doing
(i+1)%%26that it didn't occur to me to do the opposite! Thanks! \$\endgroup\$plannapus– plannapus2016年08月10日 13:54:56 +00:00Commented Aug 10, 2016 at 13:54 -
1
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.
Brainfuck, (削除) 88 (削除ここまで) 86 bytes
++[[+>]<+<++]+>-[[->+>+<<]>>-]++++++++[<[++++++++<+<]>[>]<-]<<++<[>+++[->.<<.>]<<++.<]
Requires an interpreter with 8-bit cells and a tape not bounded on the left. Try it online!
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'
-
\$\begingroup\$ Managed to get this down to 33:
say+($_++,$_--=~/^./g)x13for A..Z, but I'm sure there's a way to get a shorter one from:say+($_++,$_--)x13for A..Z... \$\endgroup\$Dom Hastings– Dom Hastings2016年08月10日 07:36:44 +00:00Commented Aug 10, 2016 at 7:36 -
\$\begingroup\$ Not sure why I have the
--in there, it's not needed! O_o. 27:say+($_++,/^./g)x13for A..Z\$\endgroup\$Dom Hastings– Dom Hastings2016年08月10日 07:52:37 +00:00Commented Aug 10, 2016 at 7:52 -
\$\begingroup\$ @DomHastings Nicely done! I tried
say+($_,$_++)x13for A..Zat first which didn't work, but it seems I should have push further into that direction! \$\endgroup\$Dada– Dada2016年08月10日 10:42:02 +00:00Commented Aug 10, 2016 at 10:42 -
1\$\begingroup\$
say+($_++,chop)x13for A..Zsaves one more byte \$\endgroup\$Ton Hospel– Ton Hospel2016年08月10日 14:59:01 +00:00Commented Aug 10, 2016 at 14:59
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
-
\$\begingroup\$ I have golfed your answer down to 113 characters. I provided a very different answer in TSQL \$\endgroup\$t-clausen.dk– t-clausen.dk2016年08月10日 15:00:17 +00:00Commented Aug 10, 2016 at 15:00
-
\$\begingroup\$ @t-Clausen.dk That is excellent. Please post your answer. I would delete mine. \$\endgroup\$Anuj Tripathi– Anuj Tripathi2016年08月10日 16:24:34 +00:00Commented Aug 10, 2016 at 16:24
-
\$\begingroup\$ no reason to delete your answer, you can just use my fiddle to improve your answer. I already posted 1 hour ago ago, if you enjoy TSQL , you should take a look at my other answers. I made Fiddles for most of them \$\endgroup\$t-clausen.dk– t-clausen.dk2016年08月10日 16:38:46 +00:00Commented Aug 10, 2016 at 16:38
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
-
\$\begingroup\$ Nice, wish I knew as much as you do about Pyth \$\endgroup\$Stan Strum– Stan Strum2017年09月13日 18:19:14 +00:00Commented Sep 13, 2017 at 18:19
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.
-
\$\begingroup\$ Welcome to PPCG! Nice first post! You can save 5 bytes if you remove some unnecessary whitespace:
s=string c=s.char for i=1,26 do print(s.rep(c(64+i)..c((65+(i%26))),13))end\$\endgroup\$GamrCorps– GamrCorps2016年08月10日 03:23:59 +00:00Commented Aug 10, 2016 at 3:23 -
\$\begingroup\$
for i=1,26 do print(((64+i):char()..(65+(i%26)):char()):rep(13))end(not tested) \$\endgroup\$Leaky Nun– Leaky Nun2016年08月10日 03:27:48 +00:00Commented Aug 10, 2016 at 3:27 -
\$\begingroup\$ Because
string.rep(x,13)is basicallyx:rep(13)\$\endgroup\$Leaky Nun– Leaky Nun2016年08月10日 03:28:20 +00:00Commented Aug 10, 2016 at 3:28 -
\$\begingroup\$ Right! I forgot the string metatable defaultly indexes to the string library. \$\endgroup\$ATaco– ATaco2016年08月10日 05:42:25 +00:00Commented Aug 10, 2016 at 5:42
-
\$\begingroup\$ Although good, numbers such as 65+(i%26) don't count as strings unless stored as such. I'll work on a way to make that work for the hell of it. \$\endgroup\$ATaco– ATaco2016年08月10日 05:46:20 +00:00Commented Aug 10, 2016 at 5:46
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.
-
\$\begingroup\$ You can remove the
@\$\endgroup\$miles– miles2016年08月10日 11:01:51 +00:00Commented Aug 10, 2016 at 11:01 -
\$\begingroup\$
u:65+(|i.+/2|i.)26\$\endgroup\$FrownyFrog– FrownyFrog2020年09月15日 09:56:58 +00:00Commented Sep 15, 2020 at 9:56
05AB1E, 12 bytes
ADÀ)×ばつ,
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
×ばつ # repeat it 13 times
, # print with newline
-
\$\begingroup\$ I know this is an old question but i just can't help myself.
ADÀ)ø13×»works as well with 9 bytes. \$\endgroup\$Datboi– Datboi2017年06月14日 20:09:25 +00:00Commented Jun 14, 2017 at 20:09 -
\$\begingroup\$ @Datboi: That does indeed work now, but unfortunately it didn't work at the time this question was posted :( \$\endgroup\$Emigna– Emigna2017年06月15日 07:32:36 +00:00Commented Jun 15, 2017 at 7:32
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}
-
1\$\begingroup\$ Nice trick using
PadLeft. \$\endgroup\$Leaky Nun– Leaky Nun2016年08月11日 02:43:42 +00:00Commented Aug 11, 2016 at 2:43
TSQL, 111 bytes
DECLARE @o varchar(702)='',@ int=1WHILE @<702SELECT @o+=CHAR(IIF(@%27=0,10,65+(@/27+1-@%27%2)%26)),@+=1PRINT @o
-
\$\begingroup\$ Golfed even further to 99 bytes codegolf.stackexchange.com/a/90659/58577 \$\endgroup\$S.Karras– S.Karras2016年08月29日 07:53:06 +00:00Commented Aug 29, 2016 at 7:53
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.
05AB1E, (削除) 11 (削除ここまで) 9 bytes
×ばつ»
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"]
×ばつ» # Repeat each 13 times and join with newline
-
\$\begingroup\$ Won't save any bytes, but
DÀøcould alternatively beĆü2and13×could alternatively be2δ∍: try it online. \$\endgroup\$Kevin Cruijssen– Kevin Cruijssen2024年10月02日 14:32:53 +00:00Commented Oct 2, 2024 at 14:32
Brachylog v1, (削除) 30 (削除ここまで) (削除) 24 (削除ここまで) 20 bytes
(削除) @Ab:"a"c:@Arz:{:12jc:@Nc.}a:wa (削除ここまで)(削除) @Ab:"a"c:@Arze:12jcw@Nw\ (削除ここまで)@A$(:@Arze:12jcw@Nw\
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
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
-
\$\begingroup\$ That is very nice, you can save another 9 bytes like this \$\endgroup\$t-clausen.dk– t-clausen.dk2016年08月29日 09:16:00 +00:00Commented Aug 29, 2016 at 9:16
Explore related questions
See similar questions with these tags.