10
\$\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\$ – Redwolf Programs Mar 5 at 17:46
  • \$\begingroup\$ @RedwolfPrograms edited the challenge rules more \$\endgroup\$ – Wasif Mar 5 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\$ – Zaelin Goodman Mar 5 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 at 18:01
  • 7
    \$\begingroup\$ So, if Whitespace can be reused, then Whitespace language wins? \$\endgroup\$ – Kirill L. Mar 5 at 18:14

12 Answers 12

21
+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 at 21:11
  • 1
    \$\begingroup\$ Doesn't it contradict the rule that "leading and trailing spaces are not allowed"? \$\endgroup\$ – xhienne Mar 6 at 17:55
  • 1
    \$\begingroup\$ @xhienne OP means in the output. \$\endgroup\$ – Makonede Mar 6 at 19:01
  • 3
    \$\begingroup\$ I love that all of the snippets are completely blank. \$\endgroup\$ – Spitemaster Mar 6 at 19:29
  • 4
    \$\begingroup\$ @Makonede I know; it's just visually amusing. \$\endgroup\$ – Spitemaster Mar 6 at 19:36
18
\$\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 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\$ – Zaelin Goodman Mar 5 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 at 1:34
8
\$\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 at 19:03
6
\$\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\$ – FryAmTheEggman Mar 5 at 23:11
  • \$\begingroup\$ @FryAmTheEggman yup, only +Th2 and chr both contained h, but that was easy to handle. \$\endgroup\$ – Manish Kundu Mar 6 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\$ – FryAmTheEggman Mar 6 at 16:08
5
\$\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
4
\$\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 at 5:38
  • 7
    \$\begingroup\$ @Wasif Why not? Tabs are whitespace, just as much as spaces or newlines, and the question doesn’t explicitly say otherwise \$\endgroup\$ – caird coinheringaahing Mar 6 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 at 8:51
  • 10
    \$\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\$ – caird coinheringaahing Mar 6 at 8:54
  • \$\begingroup\$ Doesn't it contradict the rule that "leading and trailing spaces are not allowed"? \$\endgroup\$ – xhienne Mar 6 at 17:58
4
\$\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 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 at 1:21
3
\$\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\$ – caird coinheringaahing Mar 5 at 20:23
3
\$\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 at 4:02
  • \$\begingroup\$ @tsh Keg has a custom codepage, so no. \$\endgroup\$ – lyxal Mar 9 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 at 5:40
2
\$\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 at 23:54
1
+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 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 at 8:32
1
\$\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\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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