# Print A-Z and their alphabet index without using 1,2,4,6

You need to print A-Z like this:

1. A
2. B
3. C
4. D
5. E
6. F
7. G
8. H
9. I
10. J
11. K
12. L
13. M
14. N
15. O
16. P
17. Q
18. R
19. S
20. T
21. U
22. V
23. W
24. X
25. Y
26. Z


But your source code cannot use 1,2,4,6.

Trailing newlines in output allowed,, but leading ones not allowed.

Standard loopholes apply, shortest code wins.

• This is pretty much a duplicate of many existing restricted-source kolmogorov-complexity "print X without Y" challenges, and the ban on 1 2 4 and 6 is arbitrary and unchallenging, Feb 28 at 11:09
• In future, please use the Sandbox to get feedback on your question before posting. Feb 28 at 11:09

f=(n=033)=>--n?f(n)+n+. ${Buffer([8*8|n])} :''  Try it online! # Python 2, 44 bytes i=8*8 while i<90:i=-~i;printi-8*8+'. %c'%i  Try it online! 46 bytes i=0 while i<33-7:i=-~i;print'%d. %c'%(i,i+8*8)  Try it online! The loop condition can also be while-~i/9-3: or while~-i/5-5 or while-i/5-~5: or while~-i-5*5: or while~-033>i. 46 bytes i=0 exec 78/3*"i=-~i;print'%d. %c'%(i,i+8*8);"  Try it online! 46 bytes i=8*8 while i<90:i=-~i;print'%d. %c'%(i-8*8,i)  Try it online! 46 bytes i=0 while~i-5*5:i=~-i;print'%d. %c'%(-i,8*8-i)  Try it online! 46 bytes i=8*8 while i<90:i=-~i;print'%d. %c'%(i&799,i)  Try it online! 47 bytes for i in range(33-7):print"%d. %c"%(-~i,8*8-~i)  Try it online! • @ovs The issue is that 1's are banned – xnor Feb 28 at 11:26 • Does this work for 44 bytes? Feb 28 at 11:55 • @dingledooper Yes, I had just gotten exactly that too – xnor Feb 28 at 11:57 # APL (Dyalog Extended), 19 bytes (SBCS) ↑(⍳∘≢,⍥⍕¨'. '∘,¨)⎕A  Try it online! ⎕A the uppercase Alphabet () apply the following tacit function: '. '∘,¨ prepend ". " to each letter. ,⍥⍕¨ concatenate the string representation of each to the string representation of: ⍳∘≢ the ɩndices of the length of the alphabet ↑ "mix" the list of strings into a character matrix # PHP, 454039 38 bytes for($c=A;$c<>AA;$c++)echo++$i,".$c
";


Try it online!

• The new line can be a "literal" new line in the string like this to save 1 byte Mar 1 at 10:30
• Didn't know about that, thanks!
– Cray
Mar 1 at 17:43

eval ';echo $[++i]. '{A..Z}  Try it online! # 05AB1E, 9 bytes Auā'.«sø»  Try it online! A # push the lowercase alphabet u # convert to uppercase ā # push the range [1 .. len(alphabet)] '.« '# append '.' to each number s # swap to the alphabet ø # zip both lists => [['1.', 'A'], ..., ['26.', 'Z']] » # join each inner list by spaces and the outer list by newlines  # Charcoal, 9 bytes Ｅα⁺⁺⊕κ. ι  Try it online! Link is to verbose version of code. Explanation:  α Predefined variable uppercase alphabet Ｅ Map over characters κ Current index (0-indexed) ⊕ Incremented . Literal string .  ι Current character ⁺⁺ All concatenated Implicitly print on separate lines  # Perl 5.10, 22 bytes say++$..". $_"for A..Z  Try it online! # R, 33 bytes write.table(LETTERS,,,F,". ",c=F)  Try it online! # Retina 0.8.2, 49 bytes  ABCDEFGHIJKLMNOPQRSTUVWXYZ .$$&¶ .*(.)$.&. $+  Try it online! Explanation:  ABCDEFGHIJKLMNOPQRSTUVWXYZ  Insert the alphabet. (This is the shortest way of doing it without using the digits 2 or 6.) .$$&¶  Generate all the prefixes. .*(.)$.&. $+  Replace each prefix with its length, . , and its last character ($+ actually means the last captured group in Retina 0.8.2).

• You have a 1 that snuck in
– xnor
Feb 28 at 11:25
• @xnor Luckily Retina 0.8.2 gives me an alternate way of referring to that capture group!
– Neil
Feb 28 at 11:28

# Canvas, 8 bytes

Ｚ｛²Ｏ. ｏｏ


The only reason this is shorter than charcoal is because it's got a 1-indexed iteration count.

## Explanation

Z{²O. oo
Z{       loop over the alphabet
²O     output the iteration number
. o  output ". "
o output the current letter


'A'..'Z'|%{++$i;"$i. $_"}  Try it online! # BASIC, 41 bytes for i=!0 to 33-7:?i,". ",chr$(8*8+i):next


Try it online!

(8-7)..(33-7)|%{"$($_). "+[char]($_+8*8)}  Try it online! # Python 3, 52 50 bytes for x in range(8-7,33-6):print(f"{x}.",chr(x+8*8))  Try it online! • 50 bytes – ovs Feb 28 at 10:55 • @ovs thanks for that! Feb 28 at 10:56 • 46 bytes – Jiří Mar 1 at 16:23 # Retina, 27 bytes  3*9*@ Y@L_ L$.
$.>.$&


Try it online! Explanation:


3*9*@


Insert 27 @s. (Best I can do since I can't use 2 or 6.)

Y@L_


Replace each @ with subsequent uppercase letters, but delete the last one.

L$.  Match each letter. $.>. $&  For each letter, output its 1-indexed index, . , then the letter. # Vyxal, j, 10 bytes αɾkAZƛı. j  Try it Online! # Japt, 12 bytes ;B£[YÄLSXR]q  Try it online! Straightforward, though I feel like there's still room for improvement. Explanation: ;B£[YÄLSXR]q # ; # Store the uppercase alphabet in B B£ # Replace each character in B with the following: [ ] # Make an array containing: YÄ # The 0-based index of the character + 1 (i.e. 1-based index) L # Period S # Space X # The original character R # A newline q # Join the array into a string with no separator # Implicitly output the resulting string  # Rust, 56 bytes ||for(i,x)in(9..).zip('A'..'['){print!("{}. {} ",i-8,x)}  # Jelly, 10 9 bytes ØAĖj€⁾. Y  Try it online! ## How it works ØAĖj€⁾. Y - Main link. Takes no arguments ØA - Yield the uppercase alphabet and set as the left and right arguments Ė - Enumerate j€⁾. - Join each pair with ". " Y - Join with newlines and output  • Ė saves 1 over Jż. Feb 28 at 22:15 • @JonathanAllan Very nice! Feb 28 at 22:17 # Java, 62 bytes $->{for(char c='@';++c<'[';)System.out.println(c-'@'+". "+c);}


Try it online!

$->java.util.stream.IntStream.range('A','[').forEach(i->System.out.println(i-'@'+". "+(char)i))  Try it online! # Lua (55 bytes) for i=7%3,33-7 do print(i..". "..(8*8+i..""):char())end  # Javascript (Browser console), 58 bytes for(i=0;i<35-9;)alert(++i+". "+String.fromCharCode(i+8*8))  -2 bytes thanks to @expressjs123 -3 bytes thanks to @tsh • 67 bytes: for(i=8-7;i<35-8;i++)console.log(i+". "+String.fromCharCode(i+8*8)) – user100690 Feb 28 at 11:17 • 64 bytes: for(i=0;i<35-9;)console.log(++i+". "+String.fromCharCode(i+8*8)) – tsh Mar 1 at 8:40 • @tsh thanks for it Mar 1 at 8:42 • @expressjs123 thanks for it Mar 1 at 8:43 # Bash, 41 bytes echo {A..Z}|tr ' ' ' '|nl -s". " -w$[8-7]


Try it online!

# Julia, 37 bytes

print.("$(i-'@').$i
" for i='A':'Z')


Try it online!

# C

main() { for(int i='A',j=0;i<='Z';j++,printf("%d. %c\n",j,i),i++);}


If for some, this wouldn't work:

#include <stdio.h>
void main() { for(int i='A',j=0;i<='Z';j++,printf("%d. %c\n",j,i),i++);}

• using void main will give a warning, but allow you to omit return 0. Feb 28 at 11:23
• You're not allowed to use 1, but you can use j=0 and ++j instead.
– Neil
Feb 28 at 11:26
• Why not remove the spaces? Also you can change i<='Z' to i<'[' and put the j++ and i++ inside the printf call, and remove the =0 because j will be initialised to 0 implicitly Feb 28 at 17:20
• @pxeger I know it will as a global, but not as a local surely?
– Neil
Mar 2 at 0:59
• @Neil I'm not a C expert so I'm not sure, but it seems to work on GCC - Try it online! Mar 2 at 10:00

# C (gcc), 50 bytes

main(i){for(;i<3*9;printf("%d. %c\n",i++,i+8*8));}


Try it online!

f(i){for(i=0;++i<3*9;printf("%d. %c\n",i,i+8*8));}


Try it online!

# C (gcc), 50 bytes

f(i){for(i=0;++i<033;)printf("%d. %c\n",i,i+'@');}


Try it online!

• You are missing the space after the dot and you can save 1 byte with f(i) Feb 28 at 11:38
• @SheikYerbouti Fixed, thanks! :) Feb 28 at 11:41

# Stax, 9 8 bytes

τ┌Z*µ╝╘Q


Run and debug it

# Pyth, 15 bytes

j.e+++hk\.dbrG1


Try it online!

Python 3 translation:

G = "abcdefghijklmnopqrstuvwzyz"

print("\n".join(map(lambda(k,b):str(k+1)+"."+" "+b,enumerate(G.upper()))))