11
\$\begingroup\$

This challenge is related

Challenge

Your task is to write as many programs/snippets as you can, where each one outputs/prints/ returns an alphabet. The first program must output the letter A or a, the second one B or b and so on.

You can not reuse any characters between the programs (Except Whitespace, it can be reused through snippets). So, if the first program is: 0==0, then you may not use the characters 0 and = again in any of the other programs. Note: It's allowed to use the same character many times in one program.

Scoring:

The winner will be the submission that can print alphabets up to the highest, if anyone can print upto Z or z, it will receive an extra +50 bounty from me. In case there's a tie, the winner will be the submission that used the fewest number of bytes in total.

Rules:

  • You can only use a single language for all alphabets, polygots not supported
  • Snippets are allowed! But quine snippets like A which prints A are not allowed.
  • leading and trailing spaces are not allowed. But newlines are allowed
  • You may disregard STDERR, as long as the correct output is returned to STDOUT
  • You cannot choose to output the letters to STDERR.
  • Letters are case sensitive a != A.
  • The programs/snippets must be independent
  • Whitespace can be reused
  • Output is case-insensitive, you may choose to either output a or A but not both!
  • You can't use a function, that does not print anything, such as f(){print a} will print a when it is called, but if you don't call the function, then that snippet/program is invalid.
  • Minimum submission length should be 1 byte, but again quines are not allowed
\$\endgroup\$
17
  • \$\begingroup\$ This challenge looks like a copy-paste of the related one, with a few minor tweaks. Also, I'd recommend using the sandbox for future challenges. \$\endgroup\$ Mar 5, 2021 at 17:46
  • \$\begingroup\$ @RedwolfPrograms edited the challenge rules more \$\endgroup\$
    – Wasif
    Mar 5, 2021 at 17:50
  • \$\begingroup\$ leading and trailing spaces and newlines etc. are not allowed. so you are not allowed to have any character separators? The output must be all on one line, like abcdefghijklmnopqrstuvwxyz? And for Output is case-insensitive, you may choose to either output a or A but not both! - does this mean we only output one of each character, or does this mean we must have consistent capitalization in the output? In other words, can I output like aBCdefG if it is convenient? \$\endgroup\$ Mar 5, 2021 at 17:59
  • 2
    \$\begingroup\$ Output is case-insensitive And can they be inconsistent? First program outputs A, second outputs b \$\endgroup\$
    – Luis Mendo
    Mar 5, 2021 at 18:01
  • 7
    \$\begingroup\$ So, if Whitespace can be reused, then Whitespace language wins? \$\endgroup\$
    – Kirill L.
    Mar 5, 2021 at 18:14

15 Answers 15

25
+100
\$\begingroup\$

Whitespace, 390 bytes, A-Z

Exploiting the rules a little:

  • Whitespace can be reused
   	     	
	
  

Try it online!

   	    	 
	
  

Try it online!

   	    		
	
  

Try it online!

   	   	  
	
  

Try it online!

   	   	 	
	
  

Try it online!

   	   		 
	
  

Try it online!

   	   			
	
  

Try it online!

   	  	   
	
  

Try it online!

   	  	  	
	
  

Try it online!

   	  	 	 
	
  

Try it online!

   	  	 		
	
  

Try it online!

   	  		  
	
  

Try it online!

   	  		 	
	
  

Try it online!

   	  			 
	
  

Try it online!

   	  				
	
  

Try it online!

   	 	    
	
  

Try it online!

   	 	   	
	
  

Try it online!

   	 	  	 
	
  

Try it online!

   	 	  		
	
  

Try it online!

   	 	 	  
	
  

Try it online!

   	 	 	 	
	
  

Try it online!

   	 	 		 
	
  

Try it online!

   	 	 			
	
  

Try it online!

   	 		   
	
  

Try it online!

   	 		  	
	
  

Try it online!

   	 		 	 
	
  

Try it online!

\$\endgroup\$
9
  • 2
    \$\begingroup\$ No! I've been beaten by 7 minutes! \$\endgroup\$
    – Seth
    Mar 5, 2021 at 21:11
  • 1
    \$\begingroup\$ Doesn't it contradict the rule that "leading and trailing spaces are not allowed"? \$\endgroup\$
    – xhienne
    Mar 6, 2021 at 17:55
  • 1
    \$\begingroup\$ @xhienne OP means in the output. \$\endgroup\$
    – Makonede
    Mar 6, 2021 at 19:01
  • 5
    \$\begingroup\$ I love that all of the snippets are completely blank. \$\endgroup\$ Mar 6, 2021 at 19:29
  • 5
    \$\begingroup\$ @Makonede I know; it's just visually amusing. \$\endgroup\$ Mar 6, 2021 at 19:36
21
\$\begingroup\$

PowerShell, A-N 109 bytes

Previously: A-F, 41 bytes || A-G, 53 bytes || A-K, 85 bytes || A-M, 101 bytes

eCho a
'b'
"c"
{d}
writE E
‛F‛
(mAn)[7][3]
“H“
”I”
’J’
‘K‘
„L„
‚M‚
sv N;gv N|% N*

Try it online!

\$\endgroup\$
3
  • 3
    \$\begingroup\$ ... exactly how many different quote characters does PowerShell recognise? \$\endgroup\$
    – Neil
    Mar 5, 2021 at 20:22
  • 2
    \$\begingroup\$ @Neil As far as I can tell, that's all of them? Lol, I just found out it recognized more than the single and double quote for this challenge, and purely by accident. \$\endgroup\$ Mar 5, 2021 at 20:30
  • \$\begingroup\$ Too sad, if PowerShell may add support to quote marks like «…», ‹…›, 「…」, 『…』, 《…》, 〈…〉, we can write up to Z. :( \$\endgroup\$
    – tsh
    Mar 10, 2021 at 1:34
9
\$\begingroup\$

05AB1E, 39 bytes, letters a-n

A: Th: 10 converted to hexadecimal.
b: žNн: The first consonant.
C: т.X: 100 as a Roman numeral.
D: ₂;₂B: Convert 13 to base 26.
e: A4è: The character at index 4 in the alphabet.
f: Ƶ1ç: chr(102)
g: 'g: single character string.
H: "H: string without closing quote.
i: ‘i: uppercase compressed string.
j: ’j: compressed string without spaces.
k: “k: lowercase compressed string.
l: ”l: titlecased compressed string.
m: „mmθ: last character of "mm".
n: …nnn¤: last character of "nnn".

\$\endgroup\$
1
  • 1
    \$\begingroup\$ You can drop two bytes with „m\n for m and …n\n\n for n as multiple trailing newlines are allowed ("But newlines are allowed") and whitespace can be reused. \$\endgroup\$
    – Makonede
    Mar 6, 2021 at 19:03
7
\$\begingroup\$

Pyth, 34 bytes, letters a-g

"a

Try it online!

\b

Try it online!

C99

Try it online!

.H+/TT+T2

Try it online!

>-!4k4

Try it online!

@G5

Try it online!

$chr(103)

Try it online!

Explanation

"       # Can be used to start a string literal.
\b      # Corresponds to the one-character string 'b'
C99     # Character with code 99.
T       # Variable initialized to 10 by default.
+/TT+T2 # Prefix notation. Evaluates to 13.
.H      # Convert into hexadecimal.
!4      # Logical negation -> False
k       # Variable initialized to empty string by default.
-       # Casts the first argument (bool) into the type of second argument (str).
>4      # Prints all characters starting from index 4.
G       # Variable initialized to "abcdefghijklmnopqrstuvwxyz" by default.
@ G 5   # Get character at index 5 of G.
$       # begin and end python literal.
chr     # Returns the character represented by the integer.

thanks to FryAmTheEggman

\$\endgroup\$
3
  • \$\begingroup\$ I think if you swap the strategy for a and c, and change 13 to +Th2 you could then use $chr(103) for g. \$\endgroup\$ Mar 5, 2021 at 23:11
  • \$\begingroup\$ @FryAmTheEggman yup, only +Th2 and chr both contained h, but that was easy to handle. \$\endgroup\$ Mar 6, 2021 at 7:25
  • \$\begingroup\$ Ah, good catch, and nice fix! I guess you could alternatively use many t if that helps for another letter. \$\endgroup\$ Mar 6, 2021 at 16:08
7
\$\begingroup\$

Whitespace, 390 bytes (15 bytes per letter), A-Z

S = Space; T = Tab

A

SSSTSSSSST
T
SS

B

SSSTSSSSTS
T
SS

C

SSSTSSSSTT
T
SS

D

SSSTSSSTSS
T
SS

E

SSSTSSSTST
T
SS

F

SSSTSSSTTS
T
SS

G

SSSTSSSTTT
T
SS

H

SSSTSSTSSS
T
SS

I

SSSTSSTSST
T
SS

J

SSSTSSTSTS
T
SS

K

SSSTSSTSTT
T
SS

L

SSSTSSTTSS
T
SS

M

SSSTSSTTST
T
SS

N

SSSTSSTTTS
T
SS

O

SSSTSSTTTT
T
SS

P

SSSTSTSSSS
T
SS

Q

SSSTSTSSST
T
SS

R

SSSTSTSSTS
T
SS

S

SSSTSTSSTT
T
SS

T

SSSTSTSTSS
T
SS

U

SSSTSTSTST
T
SS

V

SSSTSTSTTT
T
SS

W

SSSTSTTSSS
T
SS

X

SSSTSTTSST
T
SS

Y

SSSTSTTSTS
T
SS

Z

SSSTSTTSTT
T
SS
\$\endgroup\$
8
  • \$\begingroup\$ You cannot reuse tabs \$\endgroup\$
    – Wasif
    Mar 6, 2021 at 5:38
  • 10
    \$\begingroup\$ @Wasif Why not? Tabs are whitespace, just as much as spaces or newlines, and the question doesn’t explicitly say otherwise \$\endgroup\$ Mar 6, 2021 at 8:50
  • \$\begingroup\$ @cairdcoinheringaahing tab is a seperate character from space, isn't it? If it is not so, why there is a seperate key on keyboard to give it and why wouldn't we use 8 spaces! \$\endgroup\$
    – Wasif
    Mar 6, 2021 at 8:51
  • 11
    \$\begingroup\$ @Wasif Tabs and spaces are different, but “whitespace” is a group of characters including spaces, tabs, newlines and more unprintable characters (such as vertical tabs, carriage returns etc.). See whitespace character \$\endgroup\$ Mar 6, 2021 at 8:54
  • 1
    \$\begingroup\$ Ooh! Rule clarification needed - which specification of whitespace are we using (as Jon Skeets favourite character, the Mongolian Vowel Separator, is interesting because it changes its state of whether its whitespace or not depending on the version of Unicode specified! #DropsRandomFactAndLeaves \$\endgroup\$
    – Jmons
    Mar 8, 2021 at 11:47
6
\$\begingroup\$

Jelly, 25 bytes, ABCdefG

ØAḢ

Try it online!

”B

Try it online!

⁾C

Try it online!

Note the trailing newline

³Ọ

Try it online!

.ȷ22ŒṘ2ị

Try it online!

1÷0ṾṪ

Try it online!

“G

Try it online!

+2 more from Unrelated String

How you can make a string in Jelly:

  • Character literals, beginning with
  • String literals, using “” as delimiters (or “«, but that's undefined behaviour that happens to work in our favor). Trailing can be omitted at the end of the program
  • Compressed strings, using “» as delimiters
  • Two character literals, beginning with
  • Converting from a number to a character with
  • Using the builtin string constants, almost all of which begin with Ø
  • Python/Jelly representations

How they work

  • A:
ØAḢ - Main link. No arguments
ØA   - Yield the uppercase alphabet
  Ḣ  - Head; Take the first element, "A"
  • B uses a character literal ”B
  • C uses a two character literal, with a trailing newline, to output C and a newline
  • d:
³Ọ - Main link. No arguments
³  - Yield 100
 Ọ - Convert to character "d"
  • e:
.ȷ22ŒṘ2ị - Main link. No arguments
.ȷ22     - Literal: 5e+21
    ŒṘ   - Python representation
      2ị - Second character
  • f:
1÷0ṾṪ - Main link. No arguments
1÷0   - 1÷0 = inf
   ṾṪ - Last character; "f"
  • G uses a character literal “G
\$\endgroup\$
3
5
\$\begingroup\$

Bubblegum, 1 byte for each, 26 bytes for a-z

B
C
D

... some programs omitted ...

Y
Z
[

Try them online!

\$\endgroup\$
2
  • \$\begingroup\$ How come using these Bubblegum programs separately doesn't work? \$\endgroup\$
    – Makonede
    Mar 9, 2021 at 17:21
  • 1
    \$\begingroup\$ @Makonede if you are using TIO, its you need to write xxd of source code for Bubblegum on it like this. \$\endgroup\$
    – tsh
    Mar 10, 2021 at 1:21
5
\$\begingroup\$

Keg, 26 bytes (Sbcs) (A through Z)

Ȧ
Ɓ
Ƈ
Ɖ
Ɛ
Ƒ
Ɠ
Ƕ
Ȋ
ȷ
Ǩ
Ƚ
Ɯ
Ɲ
Ǫ
Ƿ
Ɋ
Ʀ
Ș
Ț
Ȕ
Ʋ
Ʌ
ƛ
Ƴ
Ƶ

Try it online!

Each byte is a program - I simply put them together for convenience. This kids is the power of bad language design - a built-in for each letter of the alphabet, something specifically designed for challenges like this.

\$\endgroup\$
3
  • \$\begingroup\$ Won't this be 52 bytes? \$\endgroup\$
    – tsh
    Mar 9, 2021 at 4:02
  • \$\begingroup\$ @tsh Keg has a custom codepage, so no. \$\endgroup\$
    – lyxal
    Mar 9, 2021 at 4:06
  • \$\begingroup\$ Maybe you can clarify this in your post, since the linked TIO page suggests 52 bytes with UTF-8. \$\endgroup\$
    – tsh
    Mar 9, 2021 at 5:40
4
\$\begingroup\$

Charcoal, 23 bytes, ABCDEF

⌊α

Try it online! Explanation: Outputs the minimum of the uppercase letters, i.e. A.

℅⁶⁶

Try it online! Explanation: Outputs the ASCII character 66, i.e. B.

↥§β²

Try it online! Explanation: Outputs the lowercase letter at position 2 (0-indexed), converted to upper case, i.e. C.

⊟…ψE

Try it online! Forms the range of characters up to (but not including) E, and takes the last, i.e. D.

⍘⁴⁰φ

Try it online! Explanation: Converts 40 to base 62, which is E.

Φγ⁼κ³⁸

Try it online! Explanation: Outputs the 38th printable ASCII character, counting space as 0, i.e. F.

\$\endgroup\$
1
  • \$\begingroup\$ The outputs can be either upper or lowercase, so I think you should be able to remove the from C \$\endgroup\$ Mar 5, 2021 at 20:23
4
\$\begingroup\$

Zsh, 76 bytes, abcd

echo a
print b
w=101;x=99;y=104;z=111;${(#)w}${(#)x}${(#)y}${(#)z} ${(#)x}
<<<d

Try it online!

+1 score thanks to @Makonede

\$\endgroup\$
1
  • \$\begingroup\$ You can change <<<C to w=101;x=99;y=104;z=111;${(#)w}${(#)x}${(#)y}${(#)z} ${(#)x}, and use <<<d for d. \$\endgroup\$
    – Makonede
    Mar 6, 2021 at 23:54
4
\$\begingroup\$

Vyxal K, 864 bytes, A-Z

The K flag treats numbers as ordinal values when printing them, so for everything except the string and character literals, we just need to get the right number, and it gets converted to a character automatically.

Note: Space is shown used twice, but that is only for readability. The link for X has the spaces replaced with newlines.

₄₄₄₄±₄±↲/Ṡ

Try it Online!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Try it Online!

⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐ꜝ⌐

Try it Online!

44H

Try it Online!

111111111111111111111111111111111111111111111111111111111111111111111„1βȧ

Try it Online!

99999999999999999999999999999999b∑

Try it Online!

₆›››››››

Try it Online!

88¦¦¦¦¦¦¦¦G

Try it Online!

u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-u-

Try it Online!

⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧

Try it Online!

555555555555555555555555555555555555555555555555555555555555555555555555555L

Try it Online!

76

Try it Online!

≤mmmmm

Try it Online!

₈⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩

Try it Online!

\O

Try it Online!

«≬λλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλ«żt

Try it Online!

3²²

Try it Online!

`R

Try it Online!

‛S Ǎ

Try it Online!

×Cd

Try it Online!

₇‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹

Try it Online!

=:+:+:+:+:+:+::=+::=+::=+::=+::=+::=+::=+::=+::=+::=+::=+::=+::=+::=+::=+::=+::=+::=+::=+::=+::=+::=+

Try it Online!

₀ɽ÷_p

Try it Online!

2 2*2*2 2*2*J

Try it Online!

kZḢh

Try it Online!

»[

Try it Online!

\$\endgroup\$
2
  • \$\begingroup\$ Whitespace can be re-used, so you're good with X being 2 2*2*2 2*2*J \$\endgroup\$
    – Makonede
    Jul 13, 2021 at 22:06
  • \$\begingroup\$ @Makonede Oh, lol, I missed that. There’s like 3 other places where I used random commands that left the stack unchanged for spacing, but I guess I could’ve just used spaces. Oh well, it’s not breaking the rules, so I won’t bother changing it. Thanks, though. \$\endgroup\$ Jul 13, 2021 at 23:10
3
\$\begingroup\$

\/\/>, 36 bytes, abc

a: 'a'u;
b: e7*Uf4*1-00s program terminator ";" is used up, so f4*1-00s places a ";" at 0,0
c: "␀␁9"2+"c␀␀S"2+mS}S now both "u" and "U" are used, so I do the same trick to place "U;" at the start. (␀ and ␁ are the actual ascii 0 and 1 characters)
This is the logical limit to the alphabet size since I can only use the "s" instruction twice, can probably still be golfed though.
Alphabet is even smaller for ><> due to not supporting uppercase instructions.

What a neat challenge!

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

Vyxal, 15 bytes, a-f

kzt

Try it Online!

\b

Try it Online!

‛cch

Try it Online!

₁C

Try it Online!

«ƛ

Try it Online!

`f

Try it Online!

So, there are only a few ways to get strings in Vyxal:

String literals:

\. , ‛.. , `...\`

chr(x) - ...C

compressed string literals - «...«

And deriving from a constant (k...).

That's all we can really do :P

\$\endgroup\$
2
2
+150
\$\begingroup\$

Factor, 8 14 bytes, aab

"a"print
11 .h

Try it online!

In Factor you can print, printf or write to stdout, but they share characters. I don't know of any other suitable output method. But as @Bubbler writes, a-f can be output as hex numerals.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ prettyprint vocab has some more ways to print things. a can be printed with 10 .h. Unfortunately, most of them requires spaces (or double quotes), so we're pretty much stuck at score 2. \$\endgroup\$
    – Bubbler
    Mar 24, 2021 at 0:28
  • \$\begingroup\$ [I cI] to get to c via the interpolate vocabulary. Works in 0.98 locally but not on TIO. \$\endgroup\$
    – chunes
    Mar 29, 2021 at 8:32
2
\$\begingroup\$

V a-r 46 bytes a-x 77 bytes a-y 84 bytes a-z 86 bytes

Probably not going to be a contender, but maybe someone can help me improve it. Had fun trying anyways.

EDIT: Got a lot farther than I thought I would! A few of my older answers were invalid, according to the rules, so they've been removed. I don't have any ideas for the last two letters, so I think this is it for this one.

EDIT2: Had another idea. Any ideas for getting z are welcome.

EDIT3: Got the last one! I could have sworn I had already used C somewhere, but turns out I hadn't. Still not a contender, but it was a fun exercise.

aa

Try it online!

Ab

Try it online!

ccc

Try it online!

³dd2Fd

Try it online!

Re

Try it online!

Sf

Try it online!

Ég

Try it online!

éh

Try it online!

ii

Try it online!

Ij

Try it online!

¬kk

Try it online!

ál

Try it online!

Ám

Try it online!

On

Try it online!

oo

Try it online!

í^/p

Try it online!

±q9X

Try it online!

²r#r

Try it online!

ss

Try it online!

µtótttt

Try it online!

·uÓuu

Try it online!

²vD

Try it online!

¹wÍww

Try it online!

¶x5Fx5x

Try it online!

´yyEVP

Try it online!

Cz

Try it online!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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