Determine if a string has all unique characters: Difference between revisions

Easylang
(Initial FutureBasic task solution added)
(Easylang)
Line 1,247:
String contains a repeated character.
Character "0" (hex 0030) occurs at positions 11 and 26.</pre>
 
=={{header|EasyLang}}==
<syntaxhighlight lang="easylang">
func$ hex h .
for d in [ h div 16 h mod 16 ]
if d > 9
d += 7
.
h$ &= strchar (d + 48)
.
return h$
.
proc unichar s$ . .
len d[] 65536
s$[] = strchars s$
for i to len s$[]
h = strcode s$[i]
if d[h] <> 0
write "length: " & len s$ & " duplicates: '" & s$[i]
print "' positions: " & d[h] & ", " & i & " hex: " & hex h
return
.
d[h] = i
.
print "ok"
.
repeat
s$ = input
until s$ = "EOF"
print s$
call unichar s$
print ""
.
input_data
 
.
abcABC
XYZ ZYX
1234567890ABCDEFGHIJKLMN0PQRSTUVWXYZ
EOF
</syntaxhighlight>
 
=={{header|Erlang|Erlang}}==
2,022

edits