Quine: Difference between revisions

Jump to navigation Jump to search
33 bytes removed ,  10:05, 30 June 2022
m
Line 29: Line 29:
The idea behind this quine is that the only thing you need to have a string containing the original code is to reproduce this structure: [quote] [function] [quote] [function] [quote] [quote] [quote] [quote]. This is precisely what the function does. Given the representation of a function <source lang=apl inline>⍺</source> (itself in this case), and character <source lang=apl inline>⍵</source> (here, the quote), it produces the structure <source lang=apl inline>⍵ ⍺ ⍵ ⍺ ⍵ ⍵ ⍵ ⍵</source>. A more explicit version would be <source lang=apl inline>'{⍵,⍺,⍵,⍺,⍵,⍵,⍵,⍵}'{⍵,⍺,⍵,⍺,⍵,⍵,⍵,⍵}''''</source> which simply concatenates together the required parts. The original quine is very similar, only using the shorter <source lang=apl inline>4/⍵</source> to produce the 4 occurrences of <source lang=apl inline>⍵</source>, and [[code golf|golfs]] away the spaces, instead opting for [[Enlist]] (<source lang=apl inline>∊</source>) to flatten the intermediary [[nested array]].
The idea behind this quine is that the only thing you need to have a string containing the original code is to reproduce this structure: [quote] [function] [quote] [function] [quote] [quote] [quote] [quote]. This is precisely what the function does. Given the representation of a function <source lang=apl inline>⍺</source> (itself in this case), and character <source lang=apl inline>⍵</source> (here, the quote), it produces the structure <source lang=apl inline>⍵ ⍺ ⍵ ⍺ ⍵ ⍵ ⍵ ⍵</source>. A more explicit version would be <source lang=apl inline>'{⍵,⍺,⍵,⍺,⍵,⍵,⍵,⍵}'{⍵,⍺,⍵,⍺,⍵,⍵,⍵,⍵}''''</source> which simply concatenates together the required parts. The original quine is very similar, only using the shorter <source lang=apl inline>4/⍵</source> to produce the 4 occurrences of <source lang=apl inline>⍵</source>, and [[code golf|golfs]] away the spaces, instead opting for [[Enlist]] (<source lang=apl inline>∊</source>) to flatten the intermediary [[nested array]].


=== <source lang=apl inline>Based on code point of quote</source> ===
=== Based on code point of quote ===
In Jun 2022, [[Jay Foad]] shared the following:<ref>Message {{M|61482904}}. [[APL Orchard]]. 2022-06-30.</ref>
In Jun 2022, [[Jay Foad]] shared the following:<ref>Message {{M|61482904}}. [[APL Orchard]]. 2022-06-30.</ref>
<source lang=apl>
<source lang=apl>

Navigation menu