Your task is make program that do following:
- You should take number. (Positive, negative, fraction is possible input)
- If it is negative, you reverse the quine. and negate that number (Become positive)
- Then you repeat <integer part of the input number> times and print first <floor(fraction part of the input number*length)> from your source program. If it is integer, then the fraction part is zero.
-10% bonus if your program isn't palindrome.
Example
If your program is "ABCDEFG", then
1.
5
ABCDEFGABCDEFGABCDEFGABCDEFGABCDEFG
Explanation
ABCDEFG five times
2.
-2
GFEDCBAGFEDCBA
Explanation
GFEDCBA (reversed ABCDEFG) 2 times
3.
7.5
ABCDEFGABCDEFGABCDEFGABCDEFGABCDEFGABCDEFGABCDEFGABCDEFGABC
Explanation
ABCDEFG 7 times followed by ABC (first 3(floor(0.5*7)=floor(3.5)=3) letter on ABCDEFG)
4.
-0.3
GF
Explanation
GFEDCBA (reversed ABCDEFG) 0 times followed by GF (first 2(floor(0.3*7)=floor(2.1)=2) letter on GFEDCBA(reversed ABCDEFG))
5.
0
<empty>
Explanation:
<empty> here means that your program doesn't output. It is ABCDEFG zero times that is defined as empty string.
-
and.
manually (representing the fraction as positive integers). Or you can turn your attention to the next challenge. ;) (Not every language can participate in every challenge, but as long as the challenge doesn't deliberately rule out arbitrary individual languages, that's completely fine. Just think of all of the audio/image processing or file system challenges.) \$\endgroup\$