try with this block from "list utility" library: "#" is a counter (index)
I will experiment with it thanks for the tip
True! The script below uses O(n) computing time; because it uses built-in functions working on a list it’s typically over 5 times faster than an algorithm working on individual words, which may count if the input text is really long:
If you select single stepping (remember to move slider across to the left)
and then click on this extracted version of your block
and then click on the yellow step icon
then I think you'll be able to see where things are going wrong once your repeat loop is processing the 3
Wouldn’t that latest version of the script report 4x “love”?
A little detail: I recommend SPLIT BY WORD rather than SPLIT BY (space). Then you don't have to worry about multiple spaces between words or spaces at the beginning or end.
yeah, if abuzars keep this logic, it will return:
But for now, this script doesn't work...
Another thing: Test your script with this sentense...
I 3 love 3 you
I think if you keep this script, you will get :
I love love love love love love love you
(because (index of 3) + 1)
the block "index of" isn't the solution...
this is the way to the solution:
or
also test your script with these sentenses
I 3 2 love you
I love you 2
I 1 love you
I 0 love you (zero)
this works:
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.