A Quat is a combination of a quine and the popular esolang cat program.
Challenge
The challenge is to write a standard cat program. Whatever the user inputs, the program will echo the input to stdout.
However, when the length of the input is greater than 0 and a multiple of 4, the program should output its own source code. Quat comes from the Portuguese quatro, which translates to 'four'.
Rules
- Standard loopholes apply
- You may not read the source code from a file
- An empty input should produce an empty output
Bonus
If your input length is a multiple of 4 you can earn a 25% bonus by printing the quine length/4
times. Another 5% bonus if you seperate the output by spaces (no trailing space allowed).
Test cases
The following test cases apply for the program in%4=0?cat:self
(not a real language).
<empty input> -> <empty output>
input -> input
1234 -> in%4=0?cat:self
12345678 -> in%4=0?cat:self
0% bonus
12345678 -> in%4=0?cat:selfin%4=0?cat:self
25% bonus
12345678 -> in%4=0?cat:self in%4=0?cat:self
30% bonus
Scoring
This is code-golf. Shortest code in bytes wins.
\n
be the new line character, for 1 byte of input \$\endgroup\$