Find words whose first and last three letters are equal: Difference between revisions

add RPL
(add RPL)
Line 942:
8. testes
done...
</pre>
 
=={{header|RPL}}==
The only way to use unixdict.txt as input is to convert it into a list of 25104 strings. Luckily, emulators can handle such a big data structure in RAM.
{{works with|Halcyon Calc|4.2.7}}
≪ { }
<span style="color:red">1</span> <span style="color:green">UnixDict</span> SIZE '''FOR''' j
‘<span style="color:green">UnixDict</span>’ j GET
'''IF''' DUP SIZE <span style="color:red">5</span> ≤ '''THEN''' DROP '''ELSE'''
DUP <span style="color:red">1 3</span> SUB
OVER DUP SIZE DUP <span style="color:red">2</span> - SWAP SUB
'''IF''' == '''THEN''' + '''ELSE''' DROP '''END'''
'''END'''
'''NEXT'''
≫ ≫ ‘<span style="color:blue">SAME3</span>’ STO
{{out}}
<pre>
1: { "antiperspirant" "calendrical" "einstein" "hotshot" "murmur" "oshkosh" "tartar" "testes" }
</pre>
 
1,150

edits