For this challenge, write program A
that when given no input, prints the code for A
(a quine), but when given input, the output will be modified. The input for A
will be 0 or more statements in whichever language A
is programmed. The output of A
will be the code for program B
which runs the input to A
and then does the function of A
. If the input to A
ends with a comment, then B
will only run the input of A
.
Example: (assume that the source is main=makeAQuine
in Haskell)
input: none
output: main=makeAQuine
input: putStrLn"Hello, world!"
output: main=putStrLn"Hello, world!">>makeAQuine
input: {-
output: main=return
input: putStr"Hello, world!!"{-
output: main=putStr"Hello, world!!"
Whoever has the fewest bytes/chars wins, but you can subtract 20 from your count for each of
- Comment Freindly: Accepts line-comments and block-comments
- Multiline Input: Accepts more than one statement as input