RosettaCodeData/Task/Abbreviations-automatic/SenseTalk/abbreviations-automatic-1.sensetalk
2023-07-01 13:44:08 -04:00

18 lines
545 B
Text

function AbbreviationsAutomatic days
put 1 into abbreviationLength
put the number of items in days into len
repeat forever
put () into abbreviations
repeat with each item day in days
put the first abbreviationLength characters of day into abbreviation
if abbreviations contains abbreviation
exit repeat
end if
insert abbreviation after abbreviations
if the number of items in abbreviations is len
return abbreviationLength
end if
end repeat
add 1 to abbreviationLength
end repeat
end AbbreviationsAutomatic