Skip to main content
Commonmark migration
Source Link

#Pyth, 17 13 bytes

Pyth, 17 13 bytes

#Pyth, 17 13 bytes

Pyth, 17 13 bytes

added 866 characters in body
Source Link
Steven H.
  • 3k
  • 12
  • 22

#Pyth, 1717 13 bytes

Another one of those Pyth programmers. Sorry.

The new code requires each line to be wrapped in quotes and escaped (including newlines if you desire them to be printed), but puts an extra newline between the line and the ASCII.

jjLC9smCMBd.Q 

Try it online!

Explanation:

 .Q Evaluate all input lines m For each of those lines: Bd Return the line and CM the line mapped to ASCII characters s Sum all these together to begin alternating between line and mapped line jLC9 Join all the characters and numbers in the lines and mapped lines on tabs j And join all of those on newlines 

I'm keeping the old code and its' explanation below.

#Pyth, 17 bytes

Another one of those Pyth programmers. Sorry.

#Pyth, 17 13 bytes

Another one of those Pyth programmers. Sorry.

The new code requires each line to be wrapped in quotes and escaped (including newlines if you desire them to be printed), but puts an extra newline between the line and the ASCII.

jjLC9smCMBd.Q 

Try it online!

Explanation:

 .Q Evaluate all input lines m For each of those lines: Bd Return the line and CM the line mapped to ASCII characters s Sum all these together to begin alternating between line and mapped line jLC9 Join all the characters and numbers in the lines and mapped lines on tabs j And join all of those on newlines 

I'm keeping the old code and its' explanation below.

added 4 characters in body
Source Link
Steven H.
  • 3k
  • 12
  • 22

#Pyth, 17 bytes

Another one of those Pyth programmers. Sorry.

#Jw jKC9J jK+CMJT 

Try it online!Try it online! or use an easier-to-read test case.

Explanation:

# Until we run into an error: Jw Read in the next line of input and call it J. (When there is no line of input, error is thrown that ends program.) j Join: J all characters in input line KC9 and insert tab characters (C9), which we can refer to later as K. (Setting it to a variable doesn't save or lose bytes.) Implicit print that join with trailing newline. j Join: CMJ the mapping of ASCII numbers to characters in the input, K inserting tab characters in between every number + T And with a trailing 10 for the newline at the end. 

#Pyth, 17 bytes

Another one of those Pyth programmers. Sorry.

#Jw jKC9J jK+CMJT 

Try it online! or use an easier-to-read test case.

Explanation:

# Until we run into an error: Jw Read in the next line of input and call it J. (When there is no line of input, error is thrown that ends program.) j Join: J all characters in input line KC9 and insert tab characters (C9), which we can refer to later as K. (Setting it to a variable doesn't save or lose bytes.) Implicit print that join with trailing newline. j Join: CMJ the mapping of ASCII numbers to characters in the input, K inserting tab characters in between every number + T And with a trailing 10 for the newline at the end. 

#Pyth, 17 bytes

Another one of those Pyth programmers. Sorry.

#Jw jKC9J jK+CMJT 

Try it online! or use an easier-to-read test case.

Explanation:

# Until we run into an error: Jw Read in the next line of input and call it J. (When there is no line of input, error is thrown that ends program.) j Join: J all characters in input line KC9 and insert tab characters (C9), which we can refer to later as K. (Setting it to a variable doesn't save or lose bytes.) Implicit print that join with trailing newline. j Join: CMJ the mapping of ASCII numbers to characters in the input, K inserting tab characters in between every number + T And with a trailing 10 for the newline at the end. 
Source Link
Steven H.
  • 3k
  • 12
  • 22
Loading