I wished to tally the frequency of occurrence of the words (there was a lot of repetition across levels).
The stack contained 26 cards, one for each letter of the alphabet, and each card had 8 fields - an identifying field and one for words of lengths from 2 to 8 letters.
Code: Select all
on mouseUp
repeat with a = 1 to 26
go to card a
repeat with b = 2 to 8
sort lines of field b ascending
repeat with c = number of lines in field b down to 1
put line c of field b into wurd
put 1 into count
if line (c-1) of field b = wurd then
repeat with d = (c-1) down to 1
if line d of field b = wurd then
add 1 to count
delete line d of field b
put c-1 into c
end if
end repeat
end if
put wurd && count into line c of field b
end repeat
end repeat
end repeat
end mouseUp
The eight-letter word field on the 'I' card contains six lines. Each one holds the word "infinity"
The field, after running that script contains six lines, each one reading "infinity 1"
If I replace the word infinity in the source data with, say "innocent", the script functions perfectly with just one line in that field, which reads "innocent 6".
Is "infinity" an issue when making a comparision?