Skip to main content
Commonmark migration
Source Link

Brain-Flak, 160 bytes

(((((()()()()){}))[]{}{})<>()){({}[()]<<>(({})<>){(({})[()])}{}>)}{}{<>(({})<([{<({}[()]<<>({}<>)>)>()()}{}()()])>)<>{}}<>{}{({}(((((()()){}){}){}){}){}<>)<>}<> 

Try it online!

Prints two trailing newlines, though one is from the interpreter.

Like Dorian's answer, this pushes 27 alphabets before processing anything. However, this solution stores it as the values 1 to 26 and adds 64 at the end.

###Explanation:

Explanation:

( ((((()()()()){}))[]{}{}) # Push 26 as the letter counter <>()) # Push 27 as the alphabet counter {({}[()]< # Repeat 27 times <>(({})<>) # Copy the 26 from the other stack {(({})[()])}{} # Create a descending range from 26 to 1 >)}{} { # Loop until we're out of letters <>(({}) # Save a copy of the 26 <([ { <({}[()]< # Loop 26 times 	<>({}<>) >)> ()() # Add 2 every loop }{}()()]) # Use the loop to push -(26*2+2) = -54 >) # Push the copy of 26 <>{} # Pop a letter } <>{} # Pop the 26 {({} # Reverse the stack (((((()()){}){}){}){}){} # Adding 64 to every element <>)<>}<> 

Brain-Flak, 160 bytes

(((((()()()()){}))[]{}{})<>()){({}[()]<<>(({})<>){(({})[()])}{}>)}{}{<>(({})<([{<({}[()]<<>({}<>)>)>()()}{}()()])>)<>{}}<>{}{({}(((((()()){}){}){}){}){}<>)<>}<> 

Try it online!

Prints two trailing newlines, though one is from the interpreter.

Like Dorian's answer, this pushes 27 alphabets before processing anything. However, this solution stores it as the values 1 to 26 and adds 64 at the end.

###Explanation:

( ((((()()()()){}))[]{}{}) # Push 26 as the letter counter <>()) # Push 27 as the alphabet counter {({}[()]< # Repeat 27 times <>(({})<>) # Copy the 26 from the other stack {(({})[()])}{} # Create a descending range from 26 to 1 >)}{} { # Loop until we're out of letters <>(({}) # Save a copy of the 26 <([ { <({}[()]< # Loop 26 times 	<>({}<>) >)> ()() # Add 2 every loop }{}()()]) # Use the loop to push -(26*2+2) = -54 >) # Push the copy of 26 <>{} # Pop a letter } <>{} # Pop the 26 {({} # Reverse the stack (((((()()){}){}){}){}){} # Adding 64 to every element <>)<>}<> 

Brain-Flak, 160 bytes

(((((()()()()){}))[]{}{})<>()){({}[()]<<>(({})<>){(({})[()])}{}>)}{}{<>(({})<([{<({}[()]<<>({}<>)>)>()()}{}()()])>)<>{}}<>{}{({}(((((()()){}){}){}){}){}<>)<>}<> 

Try it online!

Prints two trailing newlines, though one is from the interpreter.

Like Dorian's answer, this pushes 27 alphabets before processing anything. However, this solution stores it as the values 1 to 26 and adds 64 at the end.

Explanation:

( ((((()()()()){}))[]{}{}) # Push 26 as the letter counter <>()) # Push 27 as the alphabet counter {({}[()]< # Repeat 27 times <>(({})<>) # Copy the 26 from the other stack {(({})[()])}{} # Create a descending range from 26 to 1 >)}{} { # Loop until we're out of letters <>(({}) # Save a copy of the 26 <([ { <({}[()]< # Loop 26 times 	<>({}<>) >)> ()() # Add 2 every loop }{}()()]) # Use the loop to push -(26*2+2) = -54 >) # Push the copy of 26 <>{} # Pop a letter } <>{} # Pop the 26 {({} # Reverse the stack (((((()()){}){}){}){}){} # Adding 64 to every element <>)<>}<> 
Source Link
Jo King
  • 48.1k
  • 6
  • 131
  • 187

Brain-Flak, 160 bytes

(((((()()()()){}))[]{}{})<>()){({}[()]<<>(({})<>){(({})[()])}{}>)}{}{<>(({})<([{<({}[()]<<>({}<>)>)>()()}{}()()])>)<>{}}<>{}{({}(((((()()){}){}){}){}){}<>)<>}<> 

Try it online!

Prints two trailing newlines, though one is from the interpreter.

Like Dorian's answer, this pushes 27 alphabets before processing anything. However, this solution stores it as the values 1 to 26 and adds 64 at the end.

###Explanation:

( ((((()()()()){}))[]{}{}) # Push 26 as the letter counter <>()) # Push 27 as the alphabet counter {({}[()]< # Repeat 27 times <>(({})<>) # Copy the 26 from the other stack {(({})[()])}{} # Create a descending range from 26 to 1 >)}{} { # Loop until we're out of letters <>(({}) # Save a copy of the 26 <([ { <({}[()]< # Loop 26 times 	<>({}<>) >)> ()() # Add 2 every loop }{}()()]) # Use the loop to push -(26*2+2) = -54 >) # Push the copy of 26 <>{} # Pop a letter } <>{} # Pop the 26 {({} # Reverse the stack (((((()()){}){}){}){}){} # Adding 64 to every element <>)<>}<>