www.digitalmars.com         C & C++   DMDScript  

D - Quine

Has anyone else tried writing a quine in D yet?

Here's one of mine:

char[]q="\";int main(){
  return printf(q[81..89]~q[0..1]~q[89..90]~q~q[89..90]~q[0..81]);}
char[]q=\\";int main(){
  return printf(q[81..89]~q[0..1]~q[89..90]~q~q[89..90]~q[0..81]);}

(Here's one place where line breaks within strings are a neat invention....)

Stewart.

-- 
My e-mail is valid but not my primary mailbox, aside from its being the 
unfortunate victim of intensive mail-bombing at the moment.  Please keep 
replies on the 'group where everyone may benefit.
Jan 27 2004