[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua quine
- From: "Yuri Takhteyev" <yuri@...>
- Date: Mon, 12 May 2008 18:52:57 -0700
> A variant using "print" might be nice, to get a final newline:
>
> s=[[print('s=['..'['..s..']'..'];'..s)]];print('s=['..'['..s..']'..'];'..s)
For Lua console fans, the following version also prints the initial "> ":
s=[[print('> s=['..'['..s..']'..'];'..s)]];print('> s=['..'['..s..']'..'];'..s)
Then you get:
> s=[[print('> s=['..'['..s..']'..'];'..s)]];print('> s=['..'['..s..']'..'];'..s)
> s=[[print('> s=['..'['..s..']'..'];'..s)]];print('> s=['..'['..s..']'..'];'..s)
>
:)
- yuri
--
http://sputnik.freewisdom.org/