Talk:Quine: Difference between revisions

1,181 bytes added ,  11 years ago
Conversation moved to talk. Clarify results.
m (Create 1st section header.)
(Conversation moved to talk. Clarify results.)
Line 74:
return 0;
}</lang> which does require a trailing newline, btw. Being "more correct", It definitely does not help one read or understand the code. --[[User:Ledrug|Ledrug]] 03:53, 1 September 2011 (UTC)
 
== REXX Quine ==
<br><br>'''Error?'''
<br><br>The REXX program (below) produces an extra blank line in the output.
<br>This extra blank line can't be noticed easily (or not at all) when just viewing the output,
<br>but if the output is re-directed to a file, the extra blank line then becomes obvious.
<br>The definition of a quine isn't clear in this regard. Is a listing (of a 19-line program)
<br>with an extra blank line equal to a 19-line program?
 
'''IEC999I “Probable user error. Correct job input and resubmit.”'''
: It doesn't for me.
: The original program contains 53 lines of code (there's a new-line after the last end clause), as does the result; passing the original program and its output through both <tt>diff</tt> and <tt>wc</tt> confirm this:
<pre>
$ wc -lmw RQuine03.rex
53 215 1029 RQuine03.rex
$ cat RQuine03.rex | wc -lmw
53 215 1029
$ rexx RQuine03.rex | wc -lmw
53 215 1029
$ regina RQuine03.rex | wc -lmw
53 215 1029
$ rexx RQuine03.rex |diff -s RQuine03.rex -
Files RQuine03.rex and - are identical
$ regina RQuine03.rex |diff -s RQuine03.rex -
Files RQuine03.rex and - are identical
</pre>
Anonymous user