Skip to main content
Commonmark migration
Source Link

#Java 11, 134 bytes

Java 11, 134 bytes

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.print(i<59?" ".repeat(i-47):(char)(i>90?10:(c+i)%26+65))) 

Try it online.

136 bytes version with potential to be golfed?

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.printf("%"+(i<59?i-47:"")+"c",i>90?10:i<59?32:(c+i)%26+65)) 

Try it online.

Explanation (of the first answer)

c-> // Method with character parameter and no return-type "2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK" // Template-String .chars().forEach(i-> // Loop over the unicode values of its characters: System.out.print( // Print: i<59? // If the value is below 59 (so a digit character): " ".repeat(i-47) // Repeat a space that digit + 1 amount of times :(char)(i>90? // Else-if the value is above 90 (an underscore character): 10 // Print a newline : // Else: (c+i) // Add the current value and the input together %26 // Take modulo-26 of it to get the index in the alphabet +65))) // And add 65 to make it an uppercase letter 

#Java 11, 134 bytes

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.print(i<59?" ".repeat(i-47):(char)(i>90?10:(c+i)%26+65))) 

Try it online.

136 bytes version with potential to be golfed?

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.printf("%"+(i<59?i-47:"")+"c",i>90?10:i<59?32:(c+i)%26+65)) 

Try it online.

Explanation (of the first answer)

c-> // Method with character parameter and no return-type "2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK" // Template-String .chars().forEach(i-> // Loop over the unicode values of its characters: System.out.print( // Print: i<59? // If the value is below 59 (so a digit character): " ".repeat(i-47) // Repeat a space that digit + 1 amount of times :(char)(i>90? // Else-if the value is above 90 (an underscore character): 10 // Print a newline : // Else: (c+i) // Add the current value and the input together %26 // Take modulo-26 of it to get the index in the alphabet +65))) // And add 65 to make it an uppercase letter 

Java 11, 134 bytes

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.print(i<59?" ".repeat(i-47):(char)(i>90?10:(c+i)%26+65))) 

Try it online.

136 bytes version with potential to be golfed?

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.printf("%"+(i<59?i-47:"")+"c",i>90?10:i<59?32:(c+i)%26+65)) 

Try it online.

Explanation (of the first answer)

c-> // Method with character parameter and no return-type "2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK" // Template-String .chars().forEach(i-> // Loop over the unicode values of its characters: System.out.print( // Print: i<59? // If the value is below 59 (so a digit character): " ".repeat(i-47) // Repeat a space that digit + 1 amount of times :(char)(i>90? // Else-if the value is above 90 (an underscore character): 10 // Print a newline : // Else: (c+i) // Add the current value and the input together %26 // Take modulo-26 of it to get the index in the alphabet +65))) // And add 65 to make it an uppercase letter 
added 1010 characters in body
Source Link
Kevin Cruijssen
  • 136.3k
  • 14
  • 155
  • 394

#Java 11, 134 bytes

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.print(i<59?" ".repeat(i-47):(char)(i>90?10:(c+i)%26+65))) 

Try it online.

135136 bytes version with potential to be golfed?

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.printf("%"+(i<59?i-47:"")+"c",i>90?10:i<59?032:(c+i)%26+65)) 

Try it online.Try it online.

Explanation (of the first answer)

c-> // Method with character parameter and no return-type "2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK" // Template-String .chars().forEach(i-> // Loop over the unicode values of its characters: System.out.print( // Print: i<59? // If the value is below 59 (so a digit character): " ".repeat(i-47) // Repeat a space that digit + 1 amount of times :(char)(i>90? // Else-if the value is above 90 (an underscore character): 10 // Print a newline : // Else: (c+i) // Add the current value and the input together %26 // Take modulo-26 of it to get the index in the alphabet +65))) // And add 65 to make it an uppercase letter 

#Java 11, 134 bytes

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.print(i<59?" ".repeat(i-47):(char)(i>90?10:(c+i)%26+65))) 

Try it online.

135 bytes version with potential to be golfed?

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.printf("%"+(i<59?i-47:"")+"c",i>90?10:i<59?0:(c+i)%26+65)) 

Try it online.

#Java 11, 134 bytes

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.print(i<59?" ".repeat(i-47):(char)(i>90?10:(c+i)%26+65))) 

Try it online.

136 bytes version with potential to be golfed?

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.printf("%"+(i<59?i-47:"")+"c",i>90?10:i<59?32:(c+i)%26+65)) 

Try it online.

Explanation (of the first answer)

c-> // Method with character parameter and no return-type "2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK" // Template-String .chars().forEach(i-> // Loop over the unicode values of its characters: System.out.print( // Print: i<59? // If the value is below 59 (so a digit character): " ".repeat(i-47) // Repeat a space that digit + 1 amount of times :(char)(i>90? // Else-if the value is above 90 (an underscore character): 10 // Print a newline : // Else: (c+i) // Add the current value and the input together %26 // Take modulo-26 of it to get the index in the alphabet +65))) // And add 65 to make it an uppercase letter 
Source Link
Kevin Cruijssen
  • 136.3k
  • 14
  • 155
  • 394

#Java 11, 134 bytes

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.print(i<59?" ".repeat(i-47):(char)(i>90?10:(c+i)%26+65))) 

Try it online.

135 bytes version with potential to be golfed?

c->"2XYZABC_0VW5DE_U9F_T9G_S9H_0RQ5JI_2PONMLK".chars().forEach(i->System.out.printf("%"+(i<59?i-47:"")+"c",i>90?10:i<59?0:(c+i)%26+65)) 

Try it online.