Narcissist: Difference between revisions

m
→‎{{header|Phix}}: missing /, or type it in
m (→‎{{header|Wren}}: Changed to Wren S/H)
m (→‎{{header|Phix}}: missing /, or type it in)
 
(4 intermediate revisions by 2 users not shown)
Line 416:
 
=={{header|Phix}}==
<!--<syntaxhighlight lang="phix">(notonline)-->
<syntaxhighlight lang="phix">
<span style="color: #008080;">without</span> <span style="color: #008080;">js</span> <span style="color: #000080;font-style:italic;">-- (file i/o)</span>
printf(1,"\n\n%t\n\n",get_text(command_line()[2],GT_LF_LAST)[1]=gets(0))
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,{</span><span style="color: #008000;">"\n\ntrue\n\n"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"\n\nfalse\n\n"</span><span style="color: #0000FF;">}[</span><span style="color: #000000;">1</span><span style="color: #0000FF;">+(</span><span style="color: #7060A8;">gets</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">open</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">command_line</span><span style="color: #0000FF;">()[</span><span style="color: #000000;">2</span><span style="color: #0000FF;">],</span><span style="color: #008000;">"r"</span><span style="color: #0000FF;">))!=</span><span style="color: #7060A8;">gets</span><span style="color: #0000FF;">(</span><span style="color: #000000;">0</span><span style="color: #0000FF;">))])</span>
<!--</syntaxhighlight>-->
{{out}}
Can be run using <code>p test.exw < test.exw</code> or the input manually typed in
<pre>
true
</pre>
<small>Aside: I suppose there should really be a leading <code>without js -- file i/o</code>, but I wanted to keep it a 1-liner.<br>
Interpreted-only, as is: to allow a compiled version to run, change <code>command_line()[2]</code> to (say) <code>"test.exw"</code><br>
or maybe <code>substitute(command_line()[2],".exe",".exw")</code>, and ship with/install the source code file.</small>
 
=={{header|PicoLisp}}==
Line 546 ⟶ 554:
1: 1
</pre>
=={{header|RPL}}==
« LASTARG RCL →STR == » '<span style="color:blue">NARCISSIST</span>' STO
 
"« LASTARG RCL →STR == »" '<span style="color:blue">NARCISSIST</span>' EVAL <span style="color:grey">@ returns 1</span>
"string" '<span style="color:blue">NARCISSIST</span>' EVAL <span style="color:grey">@ returns 0</span>
=={{header|Ruby}}==
Translation of the C version.
7,805

edits