Travel Back in Quine

12

The challenge here is simple, and not at all about byte-count. Your job is to output the first 50 characters of the previous quine's source code, concatenated with the first 50 characters of yours starting with the 50 characters I've placed below:

abcdefghijklmnopqrstuvwxyzACDEFGHIJKLMNOPQRSTUVWXY

So, lets take an example here, if you were to answer in 05AB1E, a solution to simply output the first 50 bytes would be:

ži50£

Which would mean you'd need to output:

abcdefghijklmnopqrstuvwxyzACDEFGHIJKLMNOPQRSTUVWXYži50£

If your program is shorter, simply use the first x < 50 characters. If your program is longer only concatenate the first 50 characters, ending on the 50th character. The next person will then have to output the first 50 characters of your quine concatenated with their own code.

Your code can be any size, but you should only output the first 50 characters of your code concatenated to the end of the first 50-bytes of the previous answer's code.


Restrictions:

This uses the definition of a proper quine, and, in addition to this, the following things:

  • Comments are disallowed, entirely.
  • PAY ATTENTION TO THIS SECTION, IT MAY EVOLVE IF ABUSIVE LOOPHOLES ARISE

How to Post a Chained-Answer:

  1. Post a placeholder:
    • Mention your answer number and the language you'll use.
  2. Sort-by-date, if you notice someone else posted a placeholder 1 millisecond before you:
    • Delete yours, wait for the next opportunity, sorry.
  3. If you've secured the next spot, PLEASE ANSWER WITHIN 6 HOURS:
    • If you can't answer, remove your reserved space.
  4. IF the space has been hogged for more than 6 hours.
    • Vote to delete reserved space, I'll handle it.

Your Post Format:

#[Answer #]:[Character Count] Characters, [Language Used]

{TIO MARKDOWN}

{LINE_SEPARATOR="---"}

{ADDITIONAL EXPLANATION OR INFORMATION}

Some specific notes (Important for Ease-of-Competition):

  • If the person before you has included newlines or non-ASCII characters in their source, you may STRIP them. This means that x="a\nb" becomes ab, where x[0]=a;x[1]=b;.
    • You must state the mutation you've applied to the previous source.
  • All characters are counted as a single character, despite code-pages or language encoding. Please do not use byte-count, use character-count.

The accepted answer will be the 50th answer, just because; I mean, it's SE afterall.

Magic Octopus Urn

Posted 2017-07-30T00:29:18.643

Reputation: 19 422

Why are comments banned? Also, instead of redefining bytes to characters, why not just use characters? – CalculatorFeline – 2017-07-30T00:44:21.830

@CalculatorFeline I think you could do some pretty lame and uninteresting loopholes using comments, but that's just me. Reserve the first spot and prove me wrong with a comment and I'll lift the ban. – Magic Octopus Urn – 2017-07-30T00:45:50.783

Is Python "useless string lol check out my YT ComputerCat";actual("code") contain a comment? – CalculatorFeline – 2017-07-30T00:47:29.570

@CalculatorFeline example violates the definition of a proper quine due to code that is immediately defunct without being accessed. – Magic Octopus Urn – 2017-07-30T00:50:25.450

@CalculatorFeline unless I'm missing something, that first string would never be used. – Magic Octopus Urn – 2017-07-30T00:54:09.303

5The linked meta post defining proper quines contains no mention of not having defunct code. – Ørjan Johansen – 2017-07-30T01:18:31.157

Also, the 05AB1E code doesn't give the correct string. – Ørjan Johansen – 2017-07-30T01:22:32.253

@ØrjanJohansen I'm not sure if it's intended to give the correct string...mainly because otherwise it would be an easy copy-paste. ;) – Erik the Outgolfer – 2017-07-30T08:22:55.170

1How are you defining comment? Comment is not a very well defined term. – Post Rock Garf Hunter – 2017-08-01T04:42:47.343

1You also seem to interchange the terms character and byte, which is a bit confusing. I'm not really sure if its the first 50 characters or bytes. – Post Rock Garf Hunter – 2017-08-01T04:45:14.637

@WheatWizard Ouch, I didn't notice it was this messy. I have been assuming "Please do not use byte-count, use character-count." rules, as did the one answer so far where it really matters. – Ørjan Johansen – 2017-08-01T05:34:37.893

Can the program additionally print a trailing newline? – NieDzejkob – 2017-09-04T13:56:40.463

Are you allowed to chain off yourself? – pppery – 2018-08-02T19:16:18.973

@ppperry at this point-- go for it lmao. – Magic Octopus Urn – 2018-08-02T19:42:43.100

Good, because otherwise the winning criterion would be broken because no-one would ever post an answer 49. Instead we now will end up with users racing eachother to post long self-chains to hit 50 as soon as we get past around answer 40. – pppery – 2018-08-02T19:46:46.503

@ppperry I want to remove that winning criterion. I wrote this question before I stopped selecting winning answers for my questions. I didn't realize selecting a winning answer was optional at the time of writing this. – Magic Octopus Urn – 2018-08-02T19:52:24.267

Um, how would that not be making the post off-topic? – pppery – 2018-08-02T19:53:17.370

@ppperry winning criterion and selecting a winning answer are two very different things. For all intents and purposes this question is basically dead. If you chain yourself 28 times to win, what is the point of "winning" anyways lol. – Magic Octopus Urn – 2018-08-02T19:56:11.313

Then what is the winning criterion? – pppery – 2018-08-02T19:57:00.513

@ppperry what is the winning criterion for https://codegolf.stackexchange.com/questions/133754/one-oeis-after-another I believe [tag:answer-chaining] to be slightly subjective, and one of the few hard-to-judge popularity-style questions on this sub that are allowed if done well. In my personal opinion, this question is absolutely awful and should be allowed to die, which is why it already has-- because it technically IS a popularity contest with a fake winning criterion attached.

– Magic Octopus Urn – 2018-08-02T19:58:39.807

Answers

7

1: 96 Characters, Haskell

abcdefghijklmnopqrstuvwxyzACDEFGHIJKLMNOPQRSTUVWXY:z=['`'..'z']++'A':['C'..'Y']
main=putStr$z++z

Try it online!


I was feeling silly, and saw nothing forbidding the first entry starting with the exact same 50 characters as the initial string.

  • ['`'..'z']++'A':['C'..'Y'] is an expression evaluating to the string of those characters, with a ` prepended.
  • The result is pattern matched on, making the variable abcdefghijklmnopqrstuvwxyzACDEFGHIJKLMNOPQRSTUVWXY equal to '`', and z equal to the 50 characters.
  • main=putStr$z+z then does the actual output.

Ørjan Johansen

Posted 2017-07-30T00:29:18.643

Reputation: 6 914

I love how this challenge started with the a-zA-Z and now it's basically not the alphabet anymore. Good call on the 1st program. – Magic Octopus Urn – 2018-03-19T17:27:26.963

5

5:76 characters, Emojicode

as=:'"alert(eval(c="''abcdefghijklmnopqrstuvwxyzACDaa❌a 0 45

Try it online!


Explanation:

		 start
   a ...	 define variable a as that string
      	 print:
    		 combine those strings:
      a		 a, and:
      a❌	 string literal. the ❌ works like \"
      a 0 45	 between indexes 0 and 45 of a
    
		 end

betseg

Posted 2017-07-30T00:29:18.643

Reputation: 8 493

1The alphabet is slowly disappearing :O. – Magic Octopus Urn – 2017-08-01T13:42:22.800

Formatting hint: Use <pre><code> and </code></pre>, then you can use &#9; for tabs, which align as intended even with variable-width characters like emoji. BTW, I was thinking on how to make a quine in Emojicode and then I scrolled down... – NieDzejkob – 2017-09-04T13:41:47.390

@NieDzejkob good idea, thanks. – betseg – 2017-09-04T14:22:49.727

@betseg it's slightly off in a few places for me, but more readable anyway. Glad you liked it – NieDzejkob – 2017-09-04T14:30:29.960

@NieDzejkob a few? with my font only the string literal's command is off because it's long, where else on your end? – betseg – 2017-09-04T14:33:27.130

@betseg after . Different emoji fonts have different widths. Take a look at my answer below. For me, every comment is lined up. How does it look for you? – NieDzejkob – 2017-09-04T14:44:59.123

@NieDzejkob first line is short and removing part is long for me. – betseg – 2017-09-04T14:59:41.577

@betseg See? There's no way you will get everything aligned everywhere, but tabs give better results than spaces anyway. – NieDzejkob – 2017-09-04T15:07:07.520

4

2:119 Characters, Javascript

alert(eval(c="'abcdefghijklmnopqrstuvwxyzACDEFGHIJKLMNOPQRSTUVWXY'+`alert(eval(c=${JSON.stringify(c).substr(0,37)}`"))

Try It Online(uses console.log instead of alert to output)

Based on this JS quine.

Old version(reads source code):

f=_=>`abcdefghijklmnopqrstuvwxyzACDEFGHIJKLMNOPQRSTUVWXYf=${(f+"").substr(0,48)}`;alert(f())

Based on this JS quine

SuperStormer

Posted 2017-07-30T00:29:18.643

Reputation: 927

This is not a proper quine as the function references itself. – Shaggy – 2017-07-30T18:40:05.680

@Shaggy I added a valid one – SuperStormer – 2017-07-30T20:13:08.647

1@Shaggy Self-referential functions are valid by our definition. – ATaco – 2017-07-30T23:44:56.197

3

8: 70 characters, Stax

"v->{String t=`"⛽as=:'\`"alert(eval(c=\`"''abcdefghijk"c'".`"R34|S50(+

Run and debug online

Explanation

"..."c'".`"R34|S50(+
"..."                   The string from last output
     c'".`"R            Escape all double quotes
            34|S        Surround with double quotes
                50(     Take the first 50 characters
                   +    Append to the string from last output
                        Implicit output

Weijun Zhou

Posted 2017-07-30T00:29:18.643

Reputation: 3 396

2

3:56 Characters, SOGL

"alert(eval(c="'abcdefghijklmnopqrstuvwxyzACDEFGHIJ”1#Οj

Try it Here!

Explanation:

"...”      push the first 50 bytes of the previous answer
     1#Ο   wrap a quote around with that
        j  take the last letter off, as my answer has one more byte for the starting quote.

The Javascript answer had a quote in it, so I had to add a starting quote, but as this isn't code-golf, it doesn't matter.

dzaima

Posted 2017-07-30T00:29:18.643

Reputation: 19 048

2

4:81 characters, J

s=:'"alert(eval(c="''abcdefghijklmnopqrstuvwxyzACDEFGHI'
echo s,50{.'s=:',quote s

Try it online!


Conor O'Brien

Posted 2017-07-30T00:29:18.643

Reputation: 36 228

2

7: 137 characters, Java 8

v->{String t="⛽as=:'\"alert(eval(c=\"''abcdefghijklmnopqrstuvwxyzA";return t+("v->{String t=\""+t.replace("\"","\\\"")).substring(0,50);}

Try it online.

Explanation:

v->{        // Method with empty unused parameter and String return-type
  String t="⛽as=:'\"alert(eval(c=\"''abcdefghijklmnopqrstuvwxyzA";
            //  String containing the first 50 characters of the previous answer
  return t  //  Return those first 50 characters
   +"v->{String t=\""+t.replace("\"","\\\"")).substring(0,50);}
            //  Concatted with the first 50 characters of my answer
            //  with correct escape-slashes

Kevin Cruijssen

Posted 2017-07-30T00:29:18.643

Reputation: 67 575

Aha! I figured Emoji killed this challenge for good. Nice one. – Magic Octopus Urn – 2018-03-19T13:38:11.653

@MagicOctopusUrn I only now notice your rule about "If the person before you has included newlines or non-ASCII characters in their source, you may STRIP them.", so an answer could get rid of the Emojis if they want. For my answer it doesn't matter either way, since we are counting in characters instead of bytes anyway. – Kevin Cruijssen – 2018-03-19T13:52:25.330

That and it's not about the amount of characters honestly, and yes I forgot about that rule (moreoverly forgot about the challenge in general). – Magic Octopus Urn – 2018-03-19T17:23:35.730

Honestly, come to think of it, this really isn't a quine challenge at all is it? – Magic Octopus Urn – 2018-03-19T17:25:52.750

@MagicOctopusUrn It kinda is. You basically get the first 50 characters of your quine. In Java quines are usually formed by putting the unformatted source code in a String, and then correctly format/escape the double-quotes and slashes. Just the basic quine lambda-function in Java 8 is already 88 bytes however (Try it online), so in Java this challenge is much shorter without using a full quine. I can imagine quine is the best approach in most languages, though.

– Kevin Cruijssen – 2018-03-19T17:55:19.103

1

6: 70 characters, Emoji

⛽as=:'"alert(eval(c="''abcdefghijklmnopqrstuvwxyzAC⛽0-1✂➡

Try it online!

It seems that it is impossible to make it not output the trailing newline. If that's not OK then I'll remove the answer.

Explanation:

⛽ ... 	String literal
		Duplicate
⛽		Push ⛽ as a string
		Swap the top two strings. Stack: [long literal] "⛽" [long literal]
		Concatenate.
0-1✂	Remove the last character
		Concatenate.
➡		Print.

NieDzejkob

Posted 2017-07-30T00:29:18.643

Reputation: 4 630

Shouldn't it be ⛽as=:'"alert(eval(c="''abcdefghijklmnopqrstuvwx⛽0-1✂➡ instead? betseg's Emojicode answer doesn't start with as=:'"alert(eval(c="''abcdefghijklmnopqrstuvwxyzAC but with as=:'"alert(eval(c="''abcdefghijklmnopqrstuvwx instead. – Kevin Cruijssen – 2018-03-19T12:56:16.020

@KevinCruijssen If the person before you has included newlines or non-ASCII characters in their source, you may STRIP them. – NieDzejkob – 2018-03-19T13:44:25.903

Ah, I missed that rule.. In that case I'll update my answer. – Kevin Cruijssen – 2018-03-19T13:47:58.503

Out of curiosity, why did you strip them? To make it easier for future answers? Because your code runs perfectly without stripping the Emojis of the previous answer: Try it here.

– Kevin Cruijssen – 2018-03-19T14:02:08.580

@KevinCruijssen It was half a year ago. I don't remember. – NieDzejkob – 2018-03-19T14:03:16.907

1

12: 202 characters, Ruby

puts "21ipdgmtwkkke7ynvzpcnlzt7kl".to_i(36).to_s(7).gsub('0','>').gsub('1','+').gsub('2','-').gsub('3','<').gsub('4','[').gsub('5','.').gsub('6',']')+'puts "21ipdgmtwkkke7ynvzpcnlzt7kl".to_i(36).to_s(7'

Try it online!


Encodes the first fifty characters of the previous answer in base seven

  • 0: >
  • 1: +
  • 2: -
  • 3: <
  • 4: [
  • 5: .
  • 6: ]

Then converts it to base 36 to get "21ipdgmtwkkke7ynvzpcnlzt7kl"

Alex Allen

Posted 2017-07-30T00:29:18.643

Reputation: 91

0

9: 55 characters, Jelly

“"v->{String t=`"as=:'\`"alert(eval(c=\`"''abcdefg”;”“;

Try it online!


I removed the non-ASCII character from the the output since that is allowed and Jelly was ignoring it.

Explanation

This begins with the string literal of the first 50 characters (minus ) of the previous answer then appends the character to it with ;”“ then appends the original string literal to the end again with the final ;. Since a character was removed the first 50 characters of my source code are the 49 from the previous answer with a in front which allows this program to be so short. (Yes I realize this is not but why not golf it if you can?)

dylnan

Posted 2017-07-30T00:29:18.643

Reputation: 4 993

0

10:116 Characters, Python 3

print('''“"v->{String t=`"as=:'\`"alert(eval(c=\`"''abcdefgprint(\'\'\'“"v->{String t=`"as=:'\`"alert(eval(c=\`"''')

Simply prints a string consisting of the first 50 characters of answer 9, followed by the first 50 characters of its own source. No quine-like cleverness is needed, becuase the escaped quotes (\'\'\') appear after the 50th character and hence don't need to be reproduced in the output.

This method will work in virtually any language - you'd just have to escape any quote characters that appear in the previous answer. Accordingly, I don't think there is much challenge in this challenge.

Nathaniel

Posted 2017-07-30T00:29:18.643

Reputation: 6 641

0

11: 723 Characters, Brainf***

+[------->++<]>++.++.---------.+++++.++++++.+[--->+<]>+.-...-----.[----->++<]>++.--[++>---<]>-.---[-->+++<]>-.[->++<]>-.[--->++<]>+.[--->+<]>+++.--.---------.+++++.-------.-[--->+<]>--.---[->++++<]>.[-->+<]>+++.+++[-->+++<]>.[->+++<]>++.+[--->+<]>.--[--->+<]>--.+[-->+<]>+++.---.-[--->++<]>+.+[------>+<]>.++++.[->+++<]>++.+[--->+<]>.+++++++++++.-------.+++++++++++++.++.+[--->+<]>+.+[--->+<]>++.[--->+<]>-.[->+++<]>-.+++++++++++.[--->+<]>++++.+[--->+<]>.[--->++<]>-----.+[-->+++<]>-.++++.[->+++<]>++.[[-]<]++[------>+<]>.++[->++<]>+.-[-->+<]>.......---[-->+++<]>-.+[--->++<]>+..+[----->+<]>.++[-->+++<]>.[--->++<]>.+[--->++<]>+..+++.---..+++.-.........+.---.....+++.---......+++.---.++[->++<]>+.-[-->+<]>...---[-->+++<]>-.

Stripped unprintable character. Almost completely generated by Brainfuck Text Generator. Might as well be lazy, right?

TIO

Print [print('''"v->{String t=`"as=:'\`"alert(eval(c=\`"] +[------->++<]>++.++.---------.+++++.++++++.+[--->+<]>+.-...-----------.++++++.[----->++<]>++.--[++>---<]>-.---[-->+++<]>-.[->++<]>-.[--->++<]>+.[--->+<]>+++.--.---------.+++++.-------.-[--->+<]>--.---[->++++<]>.[-->+<]>+++.+++[-->+++<]>.[->+++<]>++.+[--->+<]>.--[--->+<]>--.+[-->+<]>+++.---.-[--->++<]>+.+[------>+<]>.++++.[->+++<]>++.+[--->+<]>.+++++++++++.-------.+++++++++++++.++.+[--->+<]>+.+[--->+<]>++.[--->+<]>-.[->+++<]>-.+++++++++++.[--->+<]>++++.+[--->+<]>.[--->++<]>-----.+[-->+++<]>-.++++.[->+++<]>++.
Clear all cells to left until first empty cell [[-]<]
Print [+[------->++<]>++.++.---------.+++++.++++++.+[--->] ++[------>+<]>.++[->++<]>+.-[-->+<]>.......---[-->+++<]>-.+[--->++<]>+..+[----->+<]>.++[-->+++<]>.[--->++<]>.+[--->++<]>+..+++.---..+++.-.........+.---.....+++.---......+++.---.++[->++<]>+.-[-->+<]>...---[-->+++<]>-.

Panda0nEarth

Posted 2017-07-30T00:29:18.643

Reputation: 111

You seem to print the 2nd through 51st characters of your Brainfuck answer instead of first 50 (it's missing the first >): Try it online. Also, you might want to drop the character, since your Brainfuck answer is currently outputting it as unprintable ``.

– Kevin Cruijssen – 2018-03-20T12:39:05.233

The > at the beginning seems to have been an accidental addition, and I dropped the character. Based on other answers, I think that means I only need to print first 49 characters. – Panda0nEarth – 2018-03-21T02:41:15.810