34
4
Task:
Your challenge is, given previous submissions and itself as input, output the language that they're written in, in the following format:
Say the first program is in Ruby. It must output 1, because Ruby is the 1st language used in this challenge. An example program is:
a=gets
puts 1
When given itself as input, it returns 1.
The next program might be in Python. It must output 2, because Python is the 2nd language used in the challenge. An example program is:
print(1 if input()[0]=="a"else 2)
Given the first submission, it outputs 1, and given itself it outputs 2.
You're allowed to repeat languages, though you're not allowed to submit an answer in the previous answer's language.
For example, if the third program is in Ruby, it must output 1 given the first program and itself (because Ruby is the 1st language used), and given the second program it must output 2.
Rules:
- If there are
nanswers currently in the challenge, there must be at leastfloor(n / 3)different languages. Any submission that breaks this rule is disqualified. - No two "neighbouring answers" (e.g. answer
nand answern+1) cannot use the same language. - Different versions of a language do not count as different languages (so
Python 2 == Python 3). - Answers must take previous submissions in full as input.
- The first submission must take input.
- You are not allowed to submit multiple answers in a row.
- "Repeat answers" (answers that have the exact same code as a previous submission) are not allowed.
- Answers are not allowed to go over the allocated byte-count of that answer - see "Allocated Byte-count" for more details.
Allocated Byte-count:
For each answer number n, the allocated byte-count for that answer is 45 + 5n.
Answer formatting:
Format your answer like so:
# {answer no.}, {language}
{program}
This prints:
- `1` in answer(s) {all answers using 1st language, with links}
- `2` in answer(s) {all answers using 2nd language, with links}
...
{optional explanation}
For the answer lists, do this:
- `1` in answers [1]({link to answer}), [3]({link to answer})...
Scoring:
The first answer to survive after 7 days without any valid submissions after that is declared the winner.
1Can one user post two consecutive submissions in a row? – user41805 – 2017-01-19T11:46:28.210
So, as it stands, I could repeat as is, without any changes, my answer n°6 as answer n°8, after which Martin could repeat his number n°7 (unless I'm mistaken) etc. until answer n°15 before reaching the imposed threshold (i. e.
floor(n / 3)languages). I'm guessing this is not intended behaviour. – plannapus – 2017-01-19T14:32:50.707@plannapus I noticed this as well. Of course, your goal is to have the last answer, so knowing that I would have a trivial follow-up too you might want to complicate things (which I didn't think about before posting my own answer). – Martin Ender – 2017-01-19T14:36:05.877
You should remove the section in the question for Answer Format. Nobody's even doing it. – mbomb007 – 2017-01-19T15:23:19.173
Also, someone should make a Bash test program like this challenge has.
– mbomb007 – 2017-01-19T15:28:03.8173Allocated byte count grows in geometrical progression, and probably these challenge will not terminate until we run out of languages, not because the code will become too long. – Wolfram – 2017-01-19T15:41:58.890
TIP: Sort the answers by oldest. – HyperNeutrino – 2017-01-19T15:46:14.630
A 64 bit checksum, when encoded as Base64 takes 10 bytes, which means that if someone implements a checksum based solution around answer ~11-12, it can then be replicated infinitely (or until a collision, which is rather improbable) by simply appending +1 checksum to it. – zeppelin – 2017-01-19T17:17:15.107
2IMO a reasonable fixed limit (e.g. 384 or 256 bytes), would have worked better, and would trigger a tight competition at the end. – zeppelin – 2017-01-19T18:03:34.170
Everyone: thanks for the tips! Sorry I couldn't get to your suggestions sooner, I will implement them ASAP. – clismique – 2017-01-19T23:04:22.930
Note that the new byte-count thing doesn't invalidate any current answers. – clismique – 2017-01-19T23:09:12.993