Vous devez imprimer ce texte exact:
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
Spécifications
- Vous pouvez imprimer toutes les minuscules au lieu de toutes les majuscules. Cependant, la casse doit être cohérente tout au long de la sortie.
- Vous pouvez imprimer un saut de ligne supplémentaire.
Notation
Dans la mesure où il s’agit d’une vague d’alphabet qui fluctue légèrement, votre code doit également être petit en termes de nombre d’octets. En fait, le plus petit code en termes de nombre d'octets gagne.
code-golf
kolmogorov-complexity
alphabet
Fuite Nun
la source
la source
Réponses:
C, 60 octets
la source
Brainfuck, 104 octets
la source
Convexe, 10 octets
Essayez-le en ligne!
la source
Pyth,
11 à10 octetsEssayez ici.
la source
Vim,
8583 octetsJe sais que cela peut être joué davantage au golf, mais ma tête me fait mal alors je dois m'arrêter pour le moment.
<cr>
est la touche entrée,<c+v>
ctrl + v et<esc>
la touche Échap. Ceux-ci ont tous été comptés comme un octet.J'ai enregistré un gif de cela, mais ça a été foiré. La vidéo est bien cependant: http://recordit.co/ldLKvho9Gi
la source
Ruby,
42393837 octets-3 octets grâce à @ user81655
-1 octet grâce à @manatwork
-1 octet grâce à @NotthatCharles
Voir sur repl.it: https://repl.it/CmOJ
la source
Cheddar, 48 octets
Le cheddar est bon avec des cordes: D
Essayez-le en ligne!
Explication
Que fait
l>89?65:l+1
-il? Bien89
est le code de caractère pourY
. Fondamentalement,l>89
vérifie si la lettre estZ
, cela signifie que nous devrions revenirA
. Sil>89
est faux. Je reviendrail+1
, le prochain personnagela source
@"
between them.Jelly, 10 bytes
Try it online!
How it works
la source
Y
exist back then? Also congrats for 100k rep!!Y
was added two days after the challenge was posted.26ḶḂØAṙZY
. But, as it is right now, it's still good.Haskell,
6058 bytesStarting 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.la source
unlines
is even shorter than(++"\n")=<<
.PowerShell,
4943 bytesTimmyD's remix:
was, 49 bytes:
la source
Python 2,
706854 bytesList based solution:
But why create a list? Thanks LeakyNun:
la source
R,
72676056 bytesThanks to @Giuseppe for the extra 4 bytes off!
Old
rep
-based solution at 60 bytes:See here on an online interpreter. Thanks to @user5957401 for the extra 7 bytes off!
Old matrix-based solution at 72 bytes:
See here on an online interpreter.
la source
i in 1:26
and then the letter selection toLETTERS[c(i,i%%26+1)]
you can drop like 6 or 7 bytes(i+1)%%26
that it didn't occur to me to do the opposite! Thanks!MATL, 13 bytes
Try it online!
la source
Jellyfish, 26 bytes
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:
'
s are character literals; they are followed by unprintables with ASCII code 26, and stand for those characters.r
computes the character range from 0 to 25.,
forms a pair from the two unprintable chars.r
is given argument2
, and forms the range[0 1]
.$
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 ...
+
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.~|
is modulus with flipped arguments: the south argument (the above char matrix) is reduced modulo the east argument (theS
turns the argument-seeking process south, so this is the unprintable literal 26).+
adds the literalA
to every coordinate of the resulting matrix.P
prints the result in matrix format, that is, each row on its own line without quotes.la source
Vim, 31 bytes
Where
↵
is the Return key.la source
Perl, 26 bytes
Solution from @Dom Hastings. (12 bytes shorter than mine!)
-1 byte thanks to @Ton Hospel
Run with
-M5.010
or-E
:la source
say+($_++,$_--=~/^./g)x13for A..Z
, but I'm sure there's a way to get a shorter one from:say+($_++,$_--)x13for A..Z
...--
in there, it's not needed! O_o. 27:say+($_++,/^./g)x13for A..Z
say+($_,$_++)x13for A..Z
at first which didn't work, but it seems I should have push further into that direction!say+($_++,chop)x13for A..Z
saves one more byteT-SQL 133 Bytes (Golfed by : @t-clausen.dk)
T-SQL , 151 Bytes
Using CTE to generate sequence of number
T-SQL, 155 Bytes
la source
Julia, 46 bytes
Try it online!
la source
Pyth, 10 bytes
Demonstration
Explanation:
la source
Brainfuck,
8886 bytesRequires an interpreter with 8-bit cells and a tape not bounded on the left. Try it online!
la source
Lua,
8065 Bytes.With help from Leaky Nun
Lua is a pretty inefficent language in regards to handling of strings and such, so this is the best I can narrow it down.
la source
s=string c=s.char for i=1,26 do print(s.rep(c(64+i)..c((65+(i%26))),13))end
for i=1,26 do print(((64+i):char()..(65+(i%26)):char()):rep(13))end
(not tested)string.rep(x,13)
is basicallyx:rep(13)
Brachylog,
302420 bytesTry it online!
la source
05AB1E, 12 bytes
Explanation
Try it online
la source
ADÀ)ø13×»
works as well with 9 bytes.Mathematica,
82756766 bytesTechnically shorter, although it prints in lowercase instead of uppercase:
Mathematica, 64 bytes
la source
PadLeft
.TSQL, 111 bytes
Fiddle
la source
MATLAB,
4738 bytesThe 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.
la source
[... '']
instead ofchar(...)
.[65:90;66:90 65]
saving two bytes.J,
2019 bytes1 byte thanks to miles.
Online interpreter
This is actually the program I used to generate the text in the challenge.
la source
@
Neoscript, 59 bytes
la source
PHP, 102 bytes
la source
<?$a='ABC'
also works.Ruby, 41 bytes
la source