# Code-Golf Assembly Line

Note: This challenge has nothing to do with actual assembly language.

As the head of Code-Golf Factory Inc., you must create an assembly line to generate a specific piece of code. Today, the foreman has asked you to produce quines.

# Specification:

In this challenge, the goal is to write a quine such that a proper subsection of it is also a quine.

This is code-golf, so the fewest bytes (of the main program) win. Standard loopholes are forbidden, and both the main program and the subsection must be true quines.

The subsection must be at least 2 characters shorter than the main program, meaning that the minimum score is 3 bytes.

You only need 1 subsection of your choice to work.

• Does this need to work for all possible subsections of the code? – Tyler Aug 22 '17 at 14:12
• @JulianLachniet I think the part that needs clarifying is "a subsection of your preference". – Erik the Outgolfer Aug 22 '17 at 14:16
• I must say, whenever I see a Quine question, my head immediately short circuits. – Daniel Aug 22 '17 at 18:14

# JavaScript (ES6), 14 bytes

f=_=>"f="+f+""


Try it online!

This subsection is also a quine:

f=_=>"f="+f


Try it online!

# Jelly, 5 bytes

”ṘṘ10


Try it online!

The subsection ”ṘṘ is also a quine. Try it online!

• The main program is not a true quine. – Leaky Nun Aug 22 '17 at 18:49
• @LeakyNun Well, ”ṘṘ is a true quine and the definition of a true quine is that a part of your code identifies another part, in this case the ”Ṙ identifies the other Ṙ. I don't think the added 10 makes the ”Ṙ not identify the other Ṙ anymore. – Erik the Outgolfer Aug 22 '17 at 18:50

# CJam, 10 bytes

11"_~"_~


Try it online!

This is also a quine:

"_~"_~


Try it online!

# V, 13 bytes

ñÉÑ~"qpx:2i2i


Try it online!

The subsection 2i2i is also a quine.

# Alice, 13 bytes

"!&d<@o&dh.##


Try it online!

This is also a quine:

"!&d<@o&dh.


Try it online!

This modifies the standard quine by clearing the stack before the relevant string is pushed, and using the stack height to determine how many bytes to output. This allows any no-op to be added at the end.

# Python 2, 60 bytes

This is a really simple answer, so there's probably a shorter one. This is just the standard Python quine twice. The trailing newline is required.

_='_=%r;print _%%_';print _%_
_='_=%r;print _%%_';print _%_



Try it online

# Fission, 35 bytes

O abcdefghijklmnopqrstuvwxyz '#_OR"


Try it online!

An atom starts at R travelling right. The " toggles print mode, so it wraps around and prints everything until it encounters " again. This stops printing and sets the mass of the atom to the number of characters printed (34). It wraps around again, and O destroys the atom and prints the ASCII character represented by its mass, which is ".

This contains the simple Fission quine,

'#_OR"


Try it online!

Here, '# sets the mass of the atom to the ASCII value of # (35), and _ decrements it so that the O prints a quotation mark.

# Fission, 8 bytes

'#_O  R"


Since the simple quine above starts at R and ends at O, any length quine can trivially be created by adding characters between the two.