View Category
Fun

produces a copy of its own source code

In computing, a quine is a computer program which produces a copy of its own source code as its only output.
fantom
class Q
{
static Void main()
{
r := "class Q\n{\n static Void main()\n {\n r := "
s := "\n s := \n echo (r+r.toCode+s[0..9]+s.toCode+s[10..-1])\n }\n}"
echo (r+r.toCode+s[0..9]+s.toCode+s[10..-1])
}
}
class Q{static Void main(){s:="class Q{static Void main(){s:=;c:=34.toChar;echo(s[0..<30]+c+s+c+s[30..-1]);}}";c:=34.toChar;echo(s[0..<30]+c+s+c+s[30..-1]);}}