S
Srinivas JONNALAGADDA
Dear all,
I was trying the well-known problem of writing a program that outputs
itself. Here is first trial.
s = "\nprint \"s = \\\"\"\n0.upto(s.length) { |i| printf(\"%c
\", ?s) }\nprint \"\\\"\"\nputs s"
print "s = \""
0.upto(s.length) { |i| printf("%c", ?s) }
print "\""
puts s
However, I am having a difficulty self-printing the literal line. Could
someone help?
Greetings,
JS
I was trying the well-known problem of writing a program that outputs
itself. Here is first trial.
s = "\nprint \"s = \\\"\"\n0.upto(s.length) { |i| printf(\"%c
\", ?s) }\nprint \"\\\"\"\nputs s"
print "s = \""
0.upto(s.length) { |i| printf("%c", ?s) }
print "\""
puts s
However, I am having a difficulty self-printing the literal line. Could
someone help?
Greetings,
JS