21
\$\begingroup\$

This question already has an answer here:

Apparently, we really like printing the alphabet in different languages.

How about the Russian Cyrillic alphabet?

Print/output/return this exact text (trailing whitespace is permitted)

АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя

This is the Russian Cyrillic alphabet with upper and lower case interleaved (eg AaBbCc...)

This is so crunch those bytes folks!

\$\endgroup\$

marked as duplicate by FlipTack, Wheat Wizard code-golf Dec 9 '17 at 23:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 8
    \$\begingroup\$ @EriktheOutgolfer This Unicode order of these make for a very different challenge. \$\endgroup\$ – Adám Jun 21 '17 at 10:31
  • \$\begingroup\$ Is outputting an array of individual characters permitted? \$\endgroup\$ – Shaggy Jun 21 '17 at 11:16
  • \$\begingroup\$ For Ёё, may we output codepoints U+00CB and U+00EB instead of U+0401 and U+0451? \$\endgroup\$ – ETHproductions Jun 21 '17 at 17:04
  • 1
    \$\begingroup\$ @ETHproductions no, the text must be outputted exactly \$\endgroup\$ – Skidsdev Jun 21 '17 at 17:14
  • 3
    \$\begingroup\$ Do we have to use Unicode? Or can we use an 8-bit Cyrillic encoding? \$\endgroup\$ – KSmarts Jun 22 '17 at 13:43

33 Answers 33

18
\$\begingroup\$

Рапира (Rapira), 172 142 bytes

ВЫВОД: "АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя"

Try it online!

Just for fun, given the challenge. It may not be golfed; I'm not really familiar with the language.

\$\endgroup\$
  • \$\begingroup\$ @user202729 That's because it was a function definition that was never called, and there was a typo. It works now. \$\endgroup\$ – KSmarts Dec 9 '17 at 18:33
15
\$\begingroup\$

Mathematica, 43 42 bytes

Alphabet is a built-in function.

-1 byte from Martin.

ToUpperCase@#<>#&/@Alphabet@"Russian"<>""&

This may not work on some older versions of Mathematica, but it does work on Wolfram sandbox and Try it online!.


Another version without builtin Alphabet or ToUpperCase:

Mathematica, 82 66 bytes (64 chars)

Insert[FromCharacterCode@{#,#+32}&/@(1039+Range@32),"Ёё",6]<>""&

or

Insert[FromCharacterCode@{#,#+32}&/@1040~Range~1071,"Ёё",6]<>""&

Unfortunately Martin's trick (use a<>b instead of {a,b}) doesn't work here.

Try it online!

\$\endgroup\$
  • 30
    \$\begingroup\$ Of course Alphabet is a built-in. Freaking goats is a built-in. \$\endgroup\$ – Engineer Toast Jun 21 '17 at 12:18
  • 1
    \$\begingroup\$ @Downvoters Well, don't downvote this just because it's over-upvoted. It's a completely valid answer, and not overly boring, eithre. I hate seeing my reputation being "fractional"... \$\endgroup\$ – user202729 Dec 9 '17 at 2:48
  • 1
    \$\begingroup\$ For what it's worth, I didn't downvote. There shouldn't be a punishment for knowing a built-in. \$\endgroup\$ – Engineer Toast Dec 10 '17 at 21:43
13
\$\begingroup\$

Jelly, 18 bytes

40r71s6j25Q+ȷỌżŒl$

A full program. Pretty similar in nature to an existing answer by Erik the Outgolfer, but I think it's different enough.

Try it online!

How?

40r71s6j25Q+ȷỌżŒl$  Main link: no arguments
40r71               inclusive range from 40 to 71: [40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71]
     s6             split into sixes: [[40,41,42,43,44,45],[46,47,48,49,50,51],[52,53,54,55,56,57],[58,59,60,61,62,63],[64,65,66,67,68,69],[70,71]]
       j25          join with 25s: [40,41,42,43,44,45,25,46,47,48,49,50,51,25,52,53,54,55,56,57,25,58,59,60,61,62,63,25,64,65,66,67,68,69,25,70,71]
          Q         de-duplicate: [40,41,42,43,44,45,25,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71]
            ȷ       literal 1000
           +        addition: [1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071]
             Ọ      cast to characters: "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ"
                 $  last two links as a monad:
               Œl     lowercase: "абвгдеёжзийклмнопрстуфхцчшщъыьэюя"
              ż       zip: ["Аа","Бб","Вв","Гг","Дд","Ее","Ёё","Жж","Зз","Ии","Йй","Кк","Лл","Мм","Нн","Оо","Пп","Рр","Сс","Тт","Уу","Фф","Хх","Цц","Чч","Шш","Щщ","Ъъ","Ыы","Ьь","Ээ","Юю","Яя"]
                    implicit print: АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя
\$\endgroup\$
  • \$\begingroup\$ I think it's different enough too, not because of but because of the s6(...)Q approach. \$\endgroup\$ – Erik the Outgolfer Jun 21 '17 at 12:23
  • \$\begingroup\$ Thanks @EriktheOutgolfer - I created it, then saw yours and almost commented to give the improvement. \$\endgroup\$ – Jonathan Allan Jun 21 '17 at 12:25
  • \$\begingroup\$ BTW I'm incorporating the improvement, but keeping my approach for 19 bytes. \$\endgroup\$ – Erik the Outgolfer Jun 21 '17 at 12:26
7
\$\begingroup\$

C#, Java, Javascript 137 bytes

Note: Java is only valid if you replace => with ->

s=>"АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя"

Ahhhh!!! Found a shorter way for

C#, 102 99 bytes

a=>string.Concat(new string[32].Select((x,i)=>(x=(char)(i+1040)+"")+x.ToLower())).Insert(12,"Ёё")

Shortened it by using a different approach

Try it Online!

\$\endgroup\$
  • \$\begingroup\$ What encoding is this? Pretty sure it's 138 bytes. \$\endgroup\$ – Okx Jun 21 '17 at 10:33
  • \$\begingroup\$ This is 138 bytes. Also, replace () with a single character to save a byte. \$\endgroup\$ – Shaggy Jun 21 '17 at 10:33
  • \$\begingroup\$ @Shaggy Sorry misread the TIO, question doesn't specify that unused parameters are allowed but I will edit them in \$\endgroup\$ – LiefdeWen Jun 21 '17 at 10:34
  • 1
    \$\begingroup\$ In UTF-8 this is 138 bytes, but 72 characters \$\endgroup\$ – Mr. Xcoder Jun 21 '17 at 10:34
6
\$\begingroup\$

Japt, 75 38 32 24 23 22 bytes

;Bi";<=>?@," c+981 ®+v

Test it

  • 1 byte saved thanks to ETHproductions.

Explanation

;B        :The uppercase alphabet
i         :Prepend ...
";<=>?@," :  this string
c         :Map over the charcodes of each character in the string...
+981      :  and increment them by 981
®         :Map over each character in the string, replacing them with themselves...
+Zv       :   and their lowercase selfs
          :Implicit output of resulting string

History

75 bytes, 38 bytes, 32 bytes, 24 bytes

\$\endgroup\$
  • \$\begingroup\$ I think this works: ethproductions.github.io/japt/… \$\endgroup\$ – Oliver Jun 21 '17 at 14:50
  • \$\begingroup\$ @obarakon; nice one. But Ё & ё are missing. Also, you can save a couple of bytes with multiline and small tweak: ethproductions.github.io/japt/… EDIT: See you got those improvements already. \$\endgroup\$ – Shaggy Jun 21 '17 at 14:53
  • \$\begingroup\$ That's what I did in my edit :P And darn Ёё. You can do i"Ёё"B but that would cost too many bytes. \$\endgroup\$ – Oliver Jun 21 '17 at 14:56
  • \$\begingroup\$ Adding Ãi'ЁB to the end of the first line would be a byte shorter: ethproductions.github.io/japt/… \$\endgroup\$ – Shaggy Jun 21 '17 at 14:58
  • \$\begingroup\$ I think you'd have to do Ãi'Ё6, but yeah good idea. \$\endgroup\$ – Oliver Jun 21 '17 at 15:01
5
\$\begingroup\$

Jelly, 20 19 bytes

71r40s26j25+ȷṚỌżŒl$

Try it online!

Thanks to Jonathan Allan for posting his answer (even though he outgolfs me) for -1 :)

\$\endgroup\$
  • \$\begingroup\$ Since Jelly's code page does not have the Cyrillic alphabet, don't you need to count the bytes in UTF-8? I might be misunderstanding something. \$\endgroup\$ – Comrade SparklePony Jun 21 '17 at 12:21
  • 4
    \$\begingroup\$ @ComradeSparklePony The output codepage doesn't have to do with the code codepage. \$\endgroup\$ – Erik the Outgolfer Jun 21 '17 at 12:22
5
\$\begingroup\$

PHP, 68 66

for(;$i++<33;)echo$c=ڀ^"
".chr($i-7?16+$j++:1),mb_strtolower($c);

slight improvement over the previous attempt by xoring instead of appending. ڀ^"\n" constructs the necessary "\0xd0\128" and xors in the lower 7 bit.

\$\endgroup\$
  • \$\begingroup\$ Cool 'for' loop. Never seen that in my life. \$\endgroup\$ – apricot boy Jun 22 '17 at 0:59
3
\$\begingroup\$

JavaScript (ES6), 106 bytes

f=
_=>"АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ".replace(/./g,c=>c+c.toLowerCase())
console.log(f())

\$\endgroup\$
3
\$\begingroup\$

05AB1E, 22 bytes

žv47ŸžB+çJ6т‚£'ЁýDløJ

Try it online!

Explanation

žv47Ÿ                    # push range [16 ... 47]
     žB+                 # add 1024 to each
        çJ               # convert to a string of characters with those code points
          6т‚£           # split into 2 pieces, the first being 6 chars long
              'Ёý        # merge the 2 strings on "Ё"
                 Dlø     # zip with a lower case copy
                    J    # join to a string
\$\endgroup\$
  • \$\begingroup\$ Oh, wow, I didn't even see you had an answer posted; let alone that there were 4 05AB1E answers already lol. \$\endgroup\$ – Magic Octopus Urn Jun 21 '17 at 14:51
  • \$\begingroup\$ AND l WORKS ON RUSSIAN ALPHABETS?! WHAT. \$\endgroup\$ – Magic Octopus Urn Jun 21 '17 at 15:00
  • \$\begingroup\$ @carusocomputing: Hehe, yeah. Pretty practical :P \$\endgroup\$ – Emigna Jun 21 '17 at 15:01
3
\$\begingroup\$

Pyth, 26 bytes

X12ssmCM+B+1040d32U32"Ёё
                  U32     generate the range [0, 1, 2, ..., 30, 31]
     m         d          for each element in the range,
          +1040           add 1040, giving the uppercase cyrillic letter
        +B      32        bifurcate over adding 32, giving [upper, lower]
      CM                  convert each into a character
   ss                     join into a single string
X12                  "Ёё  insert this string at index 12

Try it here.

\$\endgroup\$
  • \$\begingroup\$ Because the output is different. \$\endgroup\$ – Leaky Nun Jun 21 '17 at 10:42
  • \$\begingroup\$ @LeakyNun Ah, TIO seems to have mangled the encoding. It does work locally, however. \$\endgroup\$ – Doorknob Jun 21 '17 at 10:43
  • \$\begingroup\$ Ñ doesn't belong there... \$\endgroup\$ – Erik the Outgolfer Jun 21 '17 at 10:43
  • \$\begingroup\$ @LeakyNun I've changed the link to the other online Pyth interpreter, which runs it correctly. \$\endgroup\$ – Doorknob Jun 21 '17 at 10:45
  • \$\begingroup\$ You can save 2 bytes with rB ... Z: X12ssmrBC+1040dZU32"Ёё \$\endgroup\$ – isaacg Jun 22 '17 at 6:03
3
\$\begingroup\$

05AB1E, 20 bytes = 18 bytes + 2 UTF-8 bytes

T„(GÇ«ŸçJ„ЁЖ6ǝDløJ

Try it online!


Credit to Emigna for the lowercase trick and for isntead of 3Tm.


How?

T                  # Push 10.               | [10]
 „(G               # Push "(G"              | [10, "(G"]
    Ç              # Convert to ASCII.      | [10, [40, 71]]
     «             # Concatenate.           | [[1040, 1071]]
      Ÿ            # Range.                 | [[1040, ..., 1071]
       çJ          # Convert to char, join. | ["А..Я"]
         „ЁЖ       # Push "ЁЖ"              | ["А..Я", "ЁЖ"]
            6ǝ     # Replace "Ж" w/ "ЁЖ"    | ["А.Ё.Я"]
              Dl   # Duplicate, lowercase.  | ["А..Ё..Я", "а..ё..я"]
                øJ # Zip together and join. | ["АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя"]

Alternate 20 byte version (no UTF-8): T„(GÇŸ„.Ç6ǝ˜«çJDløJ

Even more random 20 byte nonsense: T„(GÇŸ„.Ç6ǝ˜«vyçDlJ

(The key takeaway is that I don't think I'm getting below 20 here).

\$\endgroup\$
  • \$\begingroup\$ @Emigna figures I missed the hard part of the challenge heh... \$\endgroup\$ – Magic Octopus Urn Jun 21 '17 at 14:45
  • \$\begingroup\$ @Emigna none of my answers would be valid without you ._. lol. \$\endgroup\$ – Magic Octopus Urn Jun 21 '17 at 15:21
  • \$\begingroup\$ Nice trick with T and «! \$\endgroup\$ – Emigna Jun 21 '17 at 15:24
  • \$\begingroup\$ @Emigna took a minute, knew there was something I could to to make 40 79 not awful. \$\endgroup\$ – Magic Octopus Urn Jun 21 '17 at 15:26
  • \$\begingroup\$ @ETHproductions the two alternate ones use no UTF-8. \$\endgroup\$ – Magic Octopus Urn Jun 21 '17 at 17:11
2
\$\begingroup\$

Braingolf, 58 bytes

"ABCDEF2GHIJKLMNOPQRSTUVWXYZ[\\]^_`"{#Ϗ+..#Ёe#P:# |+}>&@

Try it online!

Woo!

Explanation

Adds Ϗ (975) to each character in ABCDEF2GHIJKLMNOPQRSTUVWXYZ[\]^_` Then duplicates and adds space (32), unless the character is Ё, in which case it adds P (80)

\$\endgroup\$
  • \$\begingroup\$ Would it shave a byte to duplicate and test before adding Ϗ, since Ё is two bytes? I'm assuming UTF-8 - is that what's here? \$\endgroup\$ – Toby Speight Jun 21 '17 at 15:05
  • \$\begingroup\$ @TobySpeight no because we're checking if the original value plus Ϗ is Ё, and yes, Braingolf uses UTF-8 \$\endgroup\$ – Skidsdev Jun 21 '17 at 15:09
  • \$\begingroup\$ My thinking was if we test before adding Ϗ, then that's a test against 2 (1 byte) rather than against Ё (2 bytes). \$\endgroup\$ – Toby Speight Jun 21 '17 at 15:31
  • \$\begingroup\$ @TobySpeight we have to duplicate before pushing the space or P though, otherwise it'll cost us a byte to swap the values \$\endgroup\$ – Skidsdev Jun 21 '17 at 16:47
  • \$\begingroup\$ Ah, I see. You already have my vote, anyway. \$\endgroup\$ – Toby Speight Jun 21 '17 at 16:49
2
\$\begingroup\$

Java, 93 bytes

s->"АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя"

Source file should be saved in Windows-1251 encoding so the source makes for 71 bytes, plus flag to compiler -encoding WINDOWS-1251 for 22 bytes more.

\$\endgroup\$
  • \$\begingroup\$ Beaten to it \$\endgroup\$ – Shaggy Jun 21 '17 at 11:44
  • \$\begingroup\$ @Shaggy Well, I would've posted an idea to use different encoding there as a comment, but that answer was intended for 3 languages, and the flag to the compiler is specific to Java, so I posted this as a separate answer. \$\endgroup\$ – cliffroot Jun 21 '17 at 11:48
  • \$\begingroup\$ Also, you don't need to specify the flag. Since Windows-1251 is the default charset on Russian Windows (and javac always uses the default charset by default). Just mention that and you're good with only 71 bytes. But my answer even beats that ;) \$\endgroup\$ – Olivier Grégoire Jun 22 '17 at 9:52
2
\$\begingroup\$

Python 3,  69  66 bytes

-3 bytes using the form (using '%c' to directly apply chr()) from totallyhuman's answer, do go give some credit!

v=32
while v:print('Ёё'*(v==26),end='%c%c'%(1072-v,1104-v));v-=1

A full program (two double-byte characters used, Ё and ё).

Try it online!

\$\endgroup\$
  • \$\begingroup\$ Heh... I thought my answer looked different enough until I just actually read your code and turns out I just reversed the order. >_> \$\endgroup\$ – totallyhuman Jun 24 '17 at 14:44
2
\$\begingroup\$

Dyalog APL, 55 47 bytes

8 bytes saved thanks to @Zacharý

⎕UCS 66⍴⍉2 33⍴1025+(14+⍳6),0,(20+⍳32),80,52+⍳26

Try it online!

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

Pyth, 71 bytes

."Ёё    kdâ¿Ããä©ÃòçÅD´fjÃØÜr
ÔE®8CðÒº[£÷6ÓþC0"

Try it online!

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

05AB1E, 64 47 46 bytes

5ÝD1040+s1072+‚øžB>D80+‚«25ÝD1046+s1078+‚ø)˜çJ

Try it online!

\$\endgroup\$
  • \$\begingroup\$ You can save a byte by using žB> instead of 1025 \$\endgroup\$ – Datboi Jun 21 '17 at 10:44
  • \$\begingroup\$ @Datboi True, but the 20 byte Jelly solution makes me sad. \$\endgroup\$ – Okx Jun 21 '17 at 10:47
  • \$\begingroup\$ @Okx there's a 22 byte 05AB1E solution ;). \$\endgroup\$ – Magic Octopus Urn Jun 21 '17 at 14:46
1
\$\begingroup\$

C# (.NET Core), 94 93 90 bytes

_=>{var r="";for(var i='А';i<='Я';)r+=""+i+(char)(i+32)+(i++=='Е'?"Ёё":"");return r;}

Try it online!

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

Python 3, 96 92 bytes

  • @Mayube suggested this to save 2 bytes, and succeeded to golf it down by 1 byte by declaring chr(i).

  • @Rod golfed 4 bytes by removing chr(i).

for i in[chr(ord(i)+975)for i in"ABCDEF2GHIJKLMNOPQRSTUVWXYZ[\\]^_`"]:print(end=i+i.lower())

Try it online!


Python 3, 104 99 bytes

Any suggestions are welcome.

for i in"АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ":print(end=i+i.lower())

Try it online!

\$\endgroup\$
  • \$\begingroup\$ With map(chr,range(65,91)) you have "ABC..Z" in 21 byte instead of 29. // So we have: i in map(chr,range(65,91))+"[\\]^_'" (37byte) vs i in"ABCDEF2GHIJKLMNOPQRSTUVWXYZ[\\]^_"` (40byte). \$\endgroup\$ – P. Siehr Jun 21 '17 at 12:01
  • \$\begingroup\$ @P.Siehr note the problematic Ё and hence the 2 placed between F and G, which mapping chr over range does not yield (see my Python answer for a different workaround). \$\endgroup\$ – Jonathan Allan Jun 21 '17 at 12:30
  • \$\begingroup\$ @JonathanAllan I didn't notice that - sorry. But here is another solution for your Python3 version: print(*[i+i.lower() for i in"АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ"]), if whitespaces are ok in the output. TIO (-1 Byte) \$\endgroup\$ – P. Siehr Jun 21 '17 at 13:00
  • \$\begingroup\$ @P.Siehr that is 98 bytes due to Python using UTF-8 encoding. White space is only allowed after the text in this challenge too (usually Kolmogorov-complexity challenges only allow an optional trailing newline). \$\endgroup\$ – Jonathan Allan Jun 21 '17 at 13:11
1
\$\begingroup\$

05AB1E, 29 bytes

1040ÐU5+ŸžB>X6+D25+Ÿ)˜çDl)ø˜J

Try it online!

Uses the lowercase / uppercase trick from the python answer

Explanation

1040ÐU5+ŸžB>X6+D25+Ÿ)˜çDl)ø˜J
1040                          # Push 1040
    Ð                         # Triplicate top of stack
     U                        # Saves top of stack in X
      5+Ÿ                     # Push range [1040, ..., 1045]
         žB>                  # Push 1025
            X                 # Push X (1040)
             6+D25+Ÿ          # Push range [1046, ..., 1071]
                    )         # Wrap stack to array
                     ˜        # Flatten array
                      ç       # Convert to character
                       Dl     # Create a lowercase copy
                         )ø   # Zip both together
                           ˜J # Flatten and join
                              # Implicit output
\$\endgroup\$
1
\$\begingroup\$

Python 3, 66 bytes

for i in range(32):print(end='%c%c'%(i+1040,i+1072)+'Ёё'*(i==5))

Try it online!

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

PHP>=7.0, 77 Bytes

for($t=IntlChar;$i++<33;)echo$c=$t::chr($i-7?1040+$j++:1025),$t::tolower($c);

IntlChar Class

PHP, 136 Bytes

for(;$i<mb_strlen($r=АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ);)echo$m=mb_substr($r,$i++,1),mb_strtolower($m);

PHP Sandbox Online

PHP, 136 bytes

<?=АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя;

Try it online!

\$\endgroup\$
  • 1
    \$\begingroup\$ Currently at 68 byte :) \$\endgroup\$ – Christoph Jun 21 '17 at 12:17
  • \$\begingroup\$ @Christoph nice idea \$\endgroup\$ – Jörg Hülsermann Jun 21 '17 at 13:02
1
\$\begingroup\$

Bash+coreutils, 101 100 93 92 74 bytes

printf %b\\n \\u04{51,{3,4}{{0..9},{a..f}}}|sort|sed 's/./\u&&/'|tr -d \\n

This requires a UTF-8 locale such as ru_RU.utf8 (English UTF-8 locales also sort correctly). I've not added any score for this, as per the consensus on meta.

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

Ruby, 60 bytes

u=?Џ
l=?Я
32.times{$><<u.next!+l.next!+(l==?е?"Ёё":"")}

(Just a demonstration of String#next!, the multibyte literals ruin the 55 characters score.)

Sample run:

bash-4.4$ ruby -e 'u=?Џ;l=?Я;32.times{$><<u.next!+l.next!+(l==?е?"Ёё":"")}'
АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя

Try it online!

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

Ruby, 59 56 55 54 51 bytes

32.times{|x|$><<((x==6?"Ёё":"")<<x+1040<<x+1072)}

Thanks to manatwork for at least 4 bytes.

Try it online!

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

Japt, 26 24 bytes

22 bytes of code (encoded in UTF-8), +2 for the -P flag.

#h0o#k2_dÃi'Ё6
®+Zv

Similar to the below method, except instead of pairing two arrays, I join each capital letter with itself, lower-cased.

Try it Online!

26 byte solution:

I had some help from @Shaggy, who discovered that Ё wasn't in the [1040...1071] char range.

#h0o#k2_dÃi'Ё6
íUmv)c

Explanation:

#h0o#k2_dÃi'Ё6
íUmv)c
                   // Implicit U =
   o               //   Range      
#h0                //     [1040...
    #k2            //             1071]
       _           //   Map; At each char,
         d         //     Get the char-code
          Ã        //   End mapping;
           i'Ё6    //   Insert "Ё" into index 6;
í                  // U paired with:
 Um                //   U, where each char:
   v               //   Converted to lowercase
     c             // Flatten
-P                 // Join into a string

Try it online!

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

Alice, 31 bytes

gr'v6R,' &w'ѷ~-.O' +'С'ёSOk@

Try it online!

Explanation

g       Read the first character of the source code. That's g itself, with
        code point 103, so this pushes 103. The exact value is irrelevant
        but we need something greater than 31.
r       Range. Turns 103 into 0, 1, 2, ..., 103.
'v      Push 118.
6R,     Move it down the stack by 6 elements, so the top of the stack is
        ..., 96, 97, 118, 98, 99, 100, 101, 102, 103.
' &w    Push the current IP address to the return address stack 32 times, 
        which will cause the following part to be executed 33 times.

  'ѷ~-    Subtract the value on top of the stack from 1143, which gives the
          33 code points of the upper case letters.
  .O      Print a copy of this value as a character.
  ' +     Add 32. This turns the upper case letters in the main range to their
          lower case counterparts. However, this doesn't work for Ё/ё, where
          we obtain C instead.
  'C'ёS   Replace the divisor 1057 with 1105. The only value among the 33 which
          is divisible by 1057 is 1057 (C) itself, so that it simply gets turned into
          1105 (ё). 
  O       Output the lower case character.

k       Jump back to the w as long as there's a copy on the return address stack.
@       Terminate the program.
\$\endgroup\$
0
\$\begingroup\$

Java (OpenJDK 8), 91 88 bytes

()->{String s="";for(char i=0,u=1039,l=1071;i<33;)s=i++==6?s+"Ёё":s+ ++u+ ++l;return s;}

Try it online!

Encoded in Windows-1251. Must use a default Russian Windows installation.

\$\endgroup\$
  • 1
    \$\begingroup\$ You're Missing Ёё \$\endgroup\$ – Skidsdev Jun 22 '17 at 9:53
  • \$\begingroup\$ @Mayube Fixed, for a great amount of extra bytes :( \$\endgroup\$ – Olivier Grégoire Jun 22 '17 at 10:15
  • 1
    \$\begingroup\$ You can do i++ and change the code accordingly to save 2 bytes: ()->{String s="";for(char i=0,u=1040,l=1072;i<33;i++)s=i==5?s+"Ёё":s+ ++u+ ++l;return s;} \$\endgroup\$ – Kritixi Lithos Jun 22 '17 at 10:19
  • \$\begingroup\$ Indeed, i is only a counter. I intended to use it otherwise at first. \$\endgroup\$ – Olivier Grégoire Jun 22 '17 at 10:19
0
\$\begingroup\$

Alice, 33 bytes

/ZАе"е"ёяSr@
\"'Я"rЁа""o/

Try it online!

My other Alice solution was entirely in Cardinal mode, this one is entirely in Ordinal mode. It's conceptually much simpler, but unfortunately two byte longer.

Explanation

Ignoring the Ordinal template, the program is entirely linear:

"АЯ"r"ая"rZ'е"еЁё"So@

Alice does have a built-in to convert between lower and upper case, but unfortunately in the Ruby interpreter it only works on ASCII letters, so we still have to get both ranges separately.

"АЯ"r     Push "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ".
"ая"r     Push "абвгдежзийклмнопрстуфхцчшщъыьэюя".
Z         Zip. Interleave the two strings.
'е"еЁё"S  Replace "е" with "еЁё".
o@        Print the result and terminate the program.
\$\endgroup\$
0
\$\begingroup\$

AWK, 79 bytes

BEGIN{for(x=1039;++i<33;){f="%c%c";f=i==6?f f:f;printf f,i+x,i+32+x,1025,1105}}

Try it online!

This works on TIO, not sure if it's dependent on installed char-set.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.