Narcissist: Difference between revisions

no edit summary
No edit summary
Line 152:
=={{header|Haskell}}==
<lang Haskell>main = let fi t e c = if c then t else e in do ct <- getContents; putStrLn $ fi ['a','c','c','e','p','t'] ['r','e','j','e','c','t'] $ take (length ct - 1) ct == let q s = (s ++ show s) in q "main = let fi t e c = if c then t else e in do ct <- getContents; putStrLn $ fi ['a','c','c','e','p','t'] ['r','e','j','e','c','t'] $ take (length ct - 1) ct == let q s = (s ++ show s) in q "</lang>
 
=={{header|Huginn}}==
<lang huginn>#! /bin/sh
exec huginn --no-argv -E "${0}"
#! huginn
 
main() {
c = "#! /bin/sh{1}~"
"exec huginn --no-argv -E {3}${{0}}{3}{1}#! huginn{1}{1}~"
"main() {{{1}{2}c = {3}{0}{3};{1}~"
"{2}s = {3}{3};{1}~"
"{2}while ( ( line = input() ) != none ) {{{1}~"
"{2}{2}s += line;{1}~"
"{2}}}{1}~"
"{2}self = copy( c ).replace( {3}{5}{3}, {3}{3} )~"
".format({1}{2}{2}c.replace( {3}{5}{3}, ~"
"{3}{5}{4}{3}{4}n{4}t{4}t{4}{3}{3} ), ~"
"{3}{4}n{3}, {3}{4}t{3}, {3}{4}{3}{3}, {3}{4}{4}{3}, ~"
"{3}{5}{3}{1}{2});{1}~"
"{2}print( s == self ? {3}1{4}n{3} : {3}0{4}n{3} );{1}}}{1}{1}";
s = "";
while ( ( line = input() ) != none ) {
s += line;
}
self = copy( c ).replace( "~", "" ).format(
c.replace( "~", "~\"\n\t\t\"" ), "\n", "\t", "\"", "\\", "~"
);
print( s == self ? "1\n" : "0\n" );
}
</lang>
 
=={{header|Icon}} and {{header|Unicon}}==
Anonymous user