Unique characters: Difference between revisions

Content added Content deleted
Line 1,392: Line 1,392:


=={{header|RPL}}==
=={{header|RPL}}==
{{works with|Halcyon Calc|4.2.7}}
≪ DUP SIZE → string length
≪ DUP SIZE → string length
≪ 1 length '''FOR''' n
≪ 1 length '''FOR''' n
Line 1,433: Line 1,434:
DROP2
DROP2
‘UNCHR’ STO
===Shorter code but increased memory requirements===
≪ → strings
≪ { 255 } 0 CON 1 strings SIZE '''FOR''' j
strings j GET 1 OVER SIZE '''FOR''' k
DUP k DUP SUB NUM ROT SWAP DUP2 GET 1 + PUT SWAP
'''NEXT'''
DROP
'''NEXT'''
"" 1 255 '''FOR''' j
'''IF''' OVER j GET 1 == '''THEN''' j CHR + '''END'''
'''NEXT'''
SWAP DROP
‘UNCHR’ STO
‘UNCHR’ STO


{"133252abcdeeffd", "a6789798st", "yxcdfgxcyz"} UNCHR
{"133252abcdeeffd", "a6789798st", "yxcdfgxcyz"} UNCHR
{{works with|Halcyon Calc|4.2.7}}
{{out}}
{{out}}
<pre>
<pre>