Narcissist: Difference between revisions

no edit summary
m (Use Template:Task instead of Template:Puzzle. The Puzzle template's meaning is rather vague, and there is probably a better way to handle that information.)
No edit summary
Line 48:
<pre>: (narcissist "(Str) (= Str (str narcissist))")
-> T</pre>
 
=={{header|Ruby}}==
Translation of the C version.
<lang ruby>s = "s = %s%s%s; puts(gets.chomp == (s %% [34.chr, s, 34.chr]) ? 'accept' : 'reject')"; puts(gets.chomp == (s % [34.chr, s, 34.chr]) ? 'accept' : 'reject')</lang>
Output:
<pre>$ ruby narcissist.rb < narcissist.rb
accept</pre>
 
=={{header|Tcl}}==