All those questions that are duplicates... Ignored and marginalized by society. It is just not... right. We have to do something. There surely must be love for them too.
They feel appreciated if a piece of code outputs a link to a duplicate question. But the duplicate questions are not so easily impressed. They are swept out off their feet only when the code when duplicated outputs a link to another duplicate question. The more the code can be duplicated and still output these links, the more the questions feel more loved.
Your task is to bring love and appreciation to these Stack Exchange pariahs.
Create a piece of code that when duplicated
k times outputs a link to a duplicate question.
k represents all the numbers in range
Edit I made code size matter because I realized you can write a program that can output as many links as you wanted.
- any language created prior to the post of this challenge is accepted. You may use a language already used in another answer.
- you may not use external resources (a database etc.)
- any encoding and any characters are allowed (including white spaces, new lines, non-ASCII).
Encoding is UTF-8. code size does not matter. Size is measured in bytes.
- all duplications must be in the same language
- clarification: the code must not duplicate itself. Simply put duplicating here means creating another code by copy-pasting the original one at the end of the last one obtained. Each will result in a new code that is run independently from the others.
- all the characters in the original code must be copy-pasted (including trailing new line (if any)). Each time the code pasted must be appended at the end.
- the code must create valid output when duplicated
1 (no duplication), 2, 3, 4, 5... N times.
- It cannot skip a number (e.g. a code that creates valid output only when duplicated
1, 2, 3, 5, 6 timeswill be considered only for
1, 2, 3so
N = 3)
- each time exactly one link must be output-ed.
- example (for what duplication means, not for valid output)
(python3) Original code (k = 1):
try: i except NameError: i = 100 else: i = 200 if i == 100: print("stackoverflow.com/questions/" + str(i),end="") else: print(i)
k = 1 outputs stackoverflow.com/questions/100
k = 2 outputs stackoverflow.com/questions/100200
k = 3 outputs stackoverflow.com/questions/100200200
Duplicate questions links (valid output):
- Non-deleted questions from Programming Puzzles & Code Golf and Stack Overflow that were closed as duplicate prior to the time of the posting of this post are considered for this challenge.
- Helpful query to search for duplicate questions:
Link format. Lets take as an example this post:
A valid link output for this question is any of these the two base links
stackoverflow.com/questions/1066589 stackoverflow.com/q/1066589 ^~~~~~^ this is referred as the link number in following paragraphs
to which you may add the prefix(es)
http://. You may also add a trailing
Please note that after that you must not add anything (like the question title), even if that link results in a redirect to the question.
- You may not use a URL shortner service.
- You may not link to an answer or to another part of the page.
- The questions don't have to be duplicates of the same original or related in any way (
don't have tomeans they can be if you want).
- For each time (for each
k) a different question must be linked (two different links to the same question count as the same question)
- You may post multiple answers with the same or different languages. Different posts can output the same link.
- Each link gives 1 point.
- Egoistic bonus: +0.5 points for each link to your own question.
- Forgive me bonus: +0.5 point for each link to a question you voted to close (for whatever reason).
- Judge Jury Executioner bonus: +0.5 point for each link to your own question that you yourself voted to close (for whatever reason).
- now what bonus: +0.5 points for each link to a question closed as a duplicate to a question that has no answers.
- train of thought bonus: +1 point for each link to a question closed as a duplicate to another duplicate question (regardless of the length of the train)
- dead end bonus: +1 point for each link to a question closed as a duplicate of a question that was closed for a reason other than duplicate. (locked questions that exists because they have historical significance also don't count for this bonus).
- George Santayana bonus: +1 point for each link closed as a duplicate of a question by the same user.
- You can't live without me bonus: +1.5 points for each link whose number is prime.
- Queen of the prom bonus: +2 points for a link to a question of a user with all the questions (on the site of the linked question: PPCG or SO) closed as duplicates (at least 3, including the linked one). This bonus cannot be awarded more than once per user (even if you link to all 3 questions of this user, you are awarded the bonus only once, but you can be awarded this bonus again for a link to a question of another user or the same user but on the other site).
- All bonuses are cumulative. (this for instance has the effect that the Judge Jury Executioner bonus will always come with the egoistic and forgive me bonuses).
- You don't love me enough penalty:
not_enough_penalty = 0.6for
N = 2(just 2 links)
not_enough_penalty = 0.8for
N = 3(just 3 links)
not_enough_penalty = 1for
N >= 4(4 or more links)
LinkPoints = 1 + bonusesfor each link
- Points = Sum(LinkPoints) * not_enough_penalty
- Votes = number of votes (upvotes - downvotes). Can be negative.
Score = 5 * Points + Votes
- Size = number of bytes of original code (k = 1).
Score = (256-Size) / 32 * Points + Votes
Score is rounded to two decimals.
The winner is the answer with the highest score. In the case of a tie the answer with the most votes wins.
The winner will be awarded two weeks from the posting time of this question. If this question has intense activity at that time I will extend this.
- Please specify the language, N - the number of duplication achieved, CodeSize and Points.
- Post the original piece of code.
- For each k in [1..N] post the link output-ed, the bonuses awarded and LinkPoints.
- Please add description where the way the code works is not obvious (for each k if needed) or if the language is not well-known.
- Express the formulas for Points and Score (without Votes, as they will be considered at the end of the challenge).