1
\$\begingroup\$

This question already has an answer here:

Your challenge is very simple: output the previous answer, in reverse.

However, as with this similarly-titled question, there's a catch: in this case, you can only use characters from the answer before the last. For example:

Let's say the first answer looks like this:

1 - Python

print('hi!')

And the second answer looks like this: (see 'Chaining' section for more info)

2 - Javascript

console.log(")'!ih'(tnirp")

Now, it would be my job to write the third answer: a program to output the text )"print('hi!')"(gol.elosnoc, while only using the characters p, r, i, n, t, (, ', h, i, ! and ). I can choose whatever language I like to complete this task.

Chaining

The first answer can output any text: but it must output something. The second answer should simply output the first answer in reverse, using any characters you like. The further rules about restricted characters, as described above, come into play from the third answer onwards.

Scoring

Your score is \$\frac{l_{n}}{l_{n-1}} + l_{n-2}\$, where \$l_x\$ represents the length of the \$x\$th answer, and \$n\$ is the position your answer is at in the chain. (all lengths are in bytes; if your answer is no. 1 or no. 2 then miss out \$l_{n-1}\$ and/or \$l_{n-2}\$ where necessary.

Best (lowest) score by August 1st wins.

Formatting

Please format your post like this:

[Answer Number] - [language]

    [code]
    (preferably a TIO link)

SCORE: [Submission Score]

(notes, explanations, whatever you want)

Everything in square brackets is a required argument to fill in; everything in normal brackets is an optional argument; everything not in brackets is there to make the snippet work.

Rules

  • All characters, etc. are case sensitive.
  • Preceeding/trailing whitespace is allowed, within reason (I'm looking at you, Whitespace).
  • Every submission must be a unique language.
  • You must wait at least 1 hour before submitting a new answer if you have just posted.
  • You may NOT submit two answers in a row, you must wait for TWO more submissions before posting a new answer.
  • Of course, standard loopholes are disallowed.
  • Please make sure to triple check that your answer is valid. ~This is especially important, because someone may start writing their answer based on yours, so if it's wrong you can't really edit it any more... and the whole chain breaks down.~ Also, you can't edit answers for continuity purposes.
  • Standard I/O methods are allowed.

Answer list/used languages

$.ajax({
  type: "GET",
  url: "https://api.stackexchange.com/2.2/questions/187667/answers?site=codegolf&filter=withbody&sort=creation&order=asc",
  success: function(data) {
    for (var i = 0; i < data.items.length; i++) {
      var temp = document.createElement('p');

      temp.innerHTML = data.items[i].body.split("\n")[0];

      try {
        temp.innerHTML += " - <i>Score: " +
          data.items[i].body
          .split("SCORE")[1]
          .split("\n")[0]
          .split(":")[1]
          .trim() +
          "</i>";
      } catch (TypeError) {
        temp.innerHTML += " (no score)";
      } finally {
        $('#list').append('<li><a href="/a/' + data.items[i].answer_id + '">' + temp.innerText || temp.textContent + '</a>');
      }
    }
  }
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<base href="https://codegolf.stackexchange.com">
<ul id="list"></ul>

\$\endgroup\$

marked as duplicate by Doorknob Jul 7 at 16:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    \$\begingroup\$ What's the winning criterion? \$\endgroup\$ – pppery Jul 4 at 15:06
  • 4
    \$\begingroup\$ I like the challenge, but don't understand the scoring rule. As is, the score of answer \$n\$ will almost always be higher (hence worse) than the score of answer \$n-2\$. It is almost certain that answer 2 will be the winner. \$\endgroup\$ – Robin Ryder Jul 4 at 16:11
  • 6
    \$\begingroup\$ What @RobinRyder is trying to point out is not the nature of the challenge, but how it is scored. Right now, if I were post an answer to this challenge, it would have a score of at least 57 (the score of the first answer), even if it were (somehow) a zero-byte program. The fourth answer would have a score of at least 1.12 (the score of the second answer), even if it were (somehow) a zero-byte program. The fifth answer would have a score of at least the score of the third answer, and so on, meaning that no answer with a lower score than the second answer is possible. \$\endgroup\$ – pppery Jul 4 at 17:05
  • 4
    \$\begingroup\$ I think this needs more work before continuing: both the character limitations and the scoring. With regards to the former, if someone uses an esolang that only needs 2 characters, that effectively will restrict all future alternate answers to that language. \$\endgroup\$ – Nick Kennedy Jul 4 at 17:08
  • 1
    \$\begingroup\$ @NickKennedy "Every submission must be a unique language.", that wouldn't restrict all answers to that language, it would make the challenge nearly impossible (one could write an answer in Lenguage at any point, which would make the challenge even harder to answer) \$\endgroup\$ – pppery Jul 4 at 17:12
2
\$\begingroup\$

3 - Python 2

419/64+57 -> SCORE: 63.546875

This is one masterpiece of hackery. Edited to comply with rule 1. chr uses lowercase h, not uppercase. Will edit when I have time to find a substitute.

This is assuming the first answer is Python 3

e=ord
o=e("o")
a=e("a")
n=e("\n")
t=e(")")
b=e("(")
i=e("i")
W=e(" ")
p=o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+a+n+n
o=chr
H=o(W+t)
d=o(p+n)
p=o(p)
l=o(a+e(",")+n+n+n)
r=o(i+t+t)
c=o(b+b+b+n+W)
print(o(b+W+n)+r+l+p+")c("+p+p+c+d+p+H+p+""""!" + b + " ," + a = c"""+p+H+p+""""dlroW" = b"""+p+p+""""olleH" = a"""+p)

TIO

\$\endgroup\$
0
\$\begingroup\$

1 - Python

a = "Hello"
b = "World"

c = a + ", " + b + "!"

print(c)

Try it online!

SCORE: 57

First answer.

\$\endgroup\$
0
\$\begingroup\$

2. 05AB1E

“a = "Hello"““b = "World"“I“c = a + ", " + b + "!"“I“…¢““(c)“«»R

Try it online!


64/57 + 0 = 1.12

SCORE: 1.12

\$\endgroup\$
  • 1
    \$\begingroup\$ @Downvoter why? \$\endgroup\$ – Expired Data Jul 4 at 15:36
  • 2
    \$\begingroup\$ @GezaKerecsenyi There you go, I still think it will be very hard. Probably a better challenge would be to NOT be able to use the characters from 2 languages ago. But that's a different challenge altogether \$\endgroup\$ – Expired Data Jul 4 at 17:02
  • 1
    \$\begingroup\$ I agree with @ExpiredData. That option seems much more reasonable. \$\endgroup\$ – Mr. Xcoder Jul 4 at 17:04
  • 1
    \$\begingroup\$ Using only the language set from 2 answers ago makes this an almost impossible challenge: How is the 3rd answer supposed to output «,,, and ¢ using only abcHelo, Wrd!+"=pint? There's only one mathematical operation available (addition). (I.e. I also agree with Expired Data) \$\endgroup\$ – Draco18s Jul 4 at 17:12
  • 2
    \$\begingroup\$ @Draco18s challenge complete \$\endgroup\$ – Benjamin Urquhart Jul 6 at 2:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.