36
1
Based on this challenge.
In the rhythm game osu!, the difficulty modifier "Double-time" actually only increases the speed by 50%.
Your task, is to write a program that outputs a positive even integer (higher than 0), and when each byte/character (your choice which) in your source code is duplicated, it should output the number multiplied by 1.5.
For example if your source code is ABC
and that outputs 6, then AABBCC
should output 9.
Following the original challenge's rules:
Rules
- You must build a full program.
- The initial source must be at least 1 byte long.
- Both the integers must be in base 10 (outputting them in any other base or with scientific notation is forbidden).
- Your program must not take input (or have an unused, empty input) and must not throw any error (compiler warnings are not considered errors).
- Outputting the integers with trailing / leading spaces is allowed.
- You may not assume a newline between copies of your source.
- This is code-golf, so the fewest bytes in each language wins!
- Default Loopholes apply.
I imagine this will be far less trivial than the original challenge, but hopefully we'll see some creative and unique answers!
@Fatalize
write a program that outputs a positive even integer
Yes it will. Every even number can be multiplied by 1.5 to result in a whole integer – Skidsdev – 2017-07-17T08:28:14.160It seems like a dupe to me. – Erik the Outgolfer – 2017-07-17T08:35:42.997
@EriktheOutgolfer Very similar but I'm sure this one is going to be a lot harder (unless I'm missing something obvious). – TheLethalCoder – 2017-07-17T08:37:16.413
@EriktheOutgolfer and it's duplicating each character, not the entire source. So
ABC
becomesAABBCC
rather thanABCABC
– Skidsdev – 2017-07-17T08:39:42.940@Mayube Oh I get it. – Erik the Outgolfer – 2017-07-17T08:40:59.667
9Duplicating characters may make trivial languages unrunnable. I wonder if there is a solution in a not single-character-command-styled or expression-based language. – Keyu Gan – 2017-07-17T10:35:20.410
@KeyuGan More than likely not unless you can do something clever with comments. – TheLethalCoder – 2017-07-17T11:07:28.183
3@TheLethalCoder Maybe the biggest obstacle is
full program
. It is hard to imagine a duplicated program still have a valid entry point / function. – Keyu Gan – 2017-07-17T14:52:07.970So it only has to be able to do so once? that's not much of a challenge, is it? – tuskiomi – 2017-07-17T16:34:40.733
Would you consider linking to the new homepage?
– Frenzy Li – 2017-07-18T09:01:50.920@FrenzyLi done. I don't use the osu site enough to even realise there was a new homepage :P – Skidsdev – 2017-07-18T09:09:52.730
@KeyuGan There is a full-program solution in at least one non-golfing language. Here.
– GammaFunction – 2019-09-08T00:05:19.513