[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua quine
- From: "Peter Cawley" <lua@...>
- Date: Tue, 13 May 2008 06:30:50 +0100
s="s=%qprint(s:format(s))"print(s:format(s))
2008/5/13 Yuri Takhteyev <yuri@sims.berkeley.edu>:
> > 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/
>