Narcissist: Difference between revisions
Content added Content deleted
Line 28: | Line 28: | ||
Based upon the quine. Reads until EOF or newline from stdin, and writes "1" or "0" to stdout. |
Based upon the quine. Reads until EOF or newline from stdin, and writes "1" or "0" to stdout. |
||
<lang c>extern void*stdin;main(){ char*p = "extern void*stdin;main(){ char*p = %c%s%c,a[300],b[300];sprintf(a,p,34,p,34);fgets(b,300,stdin);putchar(48+!strcmp(a,b)); }",a[300],b[300];sprintf(a,p,34,p,34);fgets(b,300,stdin);putchar(48+!strcmp(a,b)); }</lang> |
<lang c>extern void*stdin;main(){ char*p = "extern void*stdin;main(){ char*p = %c%s%c,a[300],b[300];sprintf(a,p,34,p,34);fgets(b,300,stdin);putchar(48+!strcmp(a,b)); }",a[300],b[300];sprintf(a,p,34,p,34);fgets(b,300,stdin);putchar(48+!strcmp(a,b)); }</lang> |
||
=={{header|Common Lisp}}== |
|||
Only checks the first line of stdin: |
|||
<lang lisp>#1=(PRINT (EQUAL (WRITE-TO-STRING '#1# :CIRCLE 1) (READ-LINE *STANDARD-INPUT*)))</lang> |
|||
=={{header|Forth}}== |
=={{header|Forth}}== |