विटी, 10 27 बाइट्स
'rddd++&"rdd8++a[v}v1-D);].
यदि :
अनुमति दी गई थी, तो मैं इसे 11 बाइट्स तक छोटा कर सकता था। :(
स्पष्टीकरण:
'rddd++&"rdd8++a[v}v1-D);].
' Capture all instructions as a string until encountering
' again, looping if necessary.
r Reverse the current stack (output is top-down).
ddd++ Push char literal ' to the stack.
& Push a new stack to the stack stack.
" Same as ', but " specific.
r Reverse the current stack.
dd8++ Push char literal " to the stack.
a Push 10 to the stack.
[ ] Loop forever.
v Capture the top value as a variable.
} Take the bottom item of the stack and put it on the top.
v Dump the variable to the stack.
1- Subtract 1.
D Duplicate the top item.
); Pop n; if n is 0, exit the loop.
a[v v1-D);] This is a makeshift for loop with 10 iterations.
. Pop the top stack as n, and the second stack as o.
Write a file called "n" with the contents of "o".
दो स्टैक अंत में समान होंगे। कुछ जावा संस्करणों पर, यह कक्षा के FileNotFoundException
अलग-अलग कार्यान्वयन के कारण फेंक सकता है FileInputStream
।
संपादित करने से पहले पिछला जवाब:
&'rddd++}.
स्पष्टीकरण:
& Push a new stack to the stack stack.
'rddd++ Modified standard quine.
} Move the ' to the right place.
. Pop the top stack as n, and the second stack as o. Write a file called
"n" with the contents of "o". (Quine name, no content)
क्योंकि मैं भी कर सकता हूं, यहां स्टैक्स के भीतर आने वाले चरणों का एक आरेख है (प्रत्येक स्टैक को दर्शाया गया है []
):
Initial state: [[]]
& [[], []]
Push a new stack to the stack stack.
' [[], ["r", "d", "d", "d", "+", "+", "}", ".", "&"]]
This stack state occurs because ' will loop around the line
until finding the next '.
r [[], ["&", ".", "}", "+", "+", "d", "d", "d", "r"]]
Reverses the top (last) stack.
ddd [[], ["&", ".", "}", "+", "+", "d", "d", "d", "r", 13, 13, 13]
Push thirteen thrice.
++ [[], ["&", ".", "}", "+", "+", "d", "d", "d", "r", "'"]
Because char ' is 39 = 13 + 13 + 13.
} [[], [".", "}", "+", "+", "d", "d", "d", "r", "'", "&"]]
Takes the bottom item, then puts it on the top.
. []
Writes a file with content from the second-to-top stack and the
name as the concatenation of all elements in the top stack,
with top member priority (backwards from my representation).
मुझे वास्तव में यकीन नहीं है कि यह सही कैसे काम करता है; मिनट परिवर्तन के कारण यह टूट जाता है। उदाहरण के लिए, &
विभिन्न अन्य स्थानों पर रखने के साथ ही साथ काम करना चाहिए, लेकिन यह ClassCastException
एस, IOException
एस और ArrayOutOfBoundsException
एस का कारण बनता है जहां आप इसे डालते हैं। मुझे कुछ बगफिक्सिंग करने की आवश्यकता हो सकती है।