Talk:Quine: Difference between revisions

2,180 bytes added ,  11 years ago
→‎REXX Quine: clarify what the Rexx Quine submissions should contain.
m (→‎REXX Quine: corrected spelling of EEX and used HTML tag for the ''greater than'' symbol. -- ~~~~)
(→‎REXX Quine: clarify what the Rexx Quine submissions should contain.)
Line 102:
 
:: I found that the original program (well, at least, the current program) has 52 lines of source code, not 53. If there's a new-line after the "End x_", I can't see it. I looked at the Rosetta Code program via "edit", and there is no blank line after the trailing underscore. I used Regina (REGINA Q3.REX > Q3.OUT) and again verified that the version 3 REXX program did indeed write an extra blank line (for a total of 53.) The Rosetta Code view of the program does not show a blank line after the program. However, to ensure a blank line after the original source, I then added a blank line after the Q3 program and ''it still produced the same result!'' (53 lines). So two different REXX programs produced the same (quine) output, but the two REXX programs are different. So the one that produced the output as the same as the source is the quine program, and the other, ... is not. I used the FC (MS DOS), WINDIFF (MS Windows), and KEDIT programs to verify the outputs. -- [[User:Gerard Schildberger|Gerard Schildberger]] 01:51, 28 June 2012 (UTC)
 
: The ''original'' code on my system is 53 lines long. It produces another file that's also 53 lines long as demonstrated above: that's what it's meant to do. I can't be held responsible for any accidental changes that get made to the contents of the wiki (they even post caveats about merciless editing of things you write in many places). I'm pretty sure I didn't delete the last newline and as I normally put the <tt>&lt;/lang&gt;</tt> tag on a line of its own I can't believe I chose this entry to do something different. (I have edited the sample to insert a newline at the end of the source.)
: The fact that two programs with varying numbers of blank lines (at the end or otherwise) produce the same output is beside the point. The one that (in this case) starts with 53 lines, produces a file that's 53 lines long and is identical to itself is the quine, the others aren't; regardless of what they produce as output.
: Here's a thought though:
:# Run the program extracted from the wiki in whatever state it is in.
:# Capture the output from 1 and save it as a source program.
:# Run the program from 2 and capture its output too.
:# Compare the results of the output from 3 with those from 2.
: Dollars to doughnuts they'll both be 53 lines long, identical and a quine. (I tried it: they are.) --[[User:Alansam|Alansam]] 06:05, 28 June 2012 (UTC)
 
:: Also, since this discussion is now in the ''talk'' page, I'd like to point out that saying another version is a cheat isn't professional nor appropriate. If it ''is'' a cheat, then flag it as '''incorrect''' and state why. The REXX versions 1 and 2 don't open any external files, as per the task's description/requirements. -- [[User:Gerard Schildberger|Gerard Schildberger]] 02:01, 28 June 2012 (UTC)
 
: I didn't say the other version "is a cheat", I said it was "kind of a cheat", there's a '''huge''' difference in emphasis. Please don't cherry-pick other people's words to score points: that's unprofessional!
: Now we're here though; if you read the description of what a Quine is supposed to be (see above) with particular reference to the quote from Wikipedia:
<pre>
Note that programs that take input are not considered quines. This would allow the source code to be fed to the program via keyboard input, opening the source file of the program, and similar mechanisms...
</pre>
: I suspect that using <tt>sourceline()</tt> falls squarely into the category of "opening the source file of the program and similar mechanisms" which disqualifies it as a Quine. --[[User:Alansam|Alansam]] 06:05, 28 June 2012 (UTC)
Anonymous user