Good afternoon (or morning). Today I will make the daily challenge.
Task: make a procedure with three string input, to fill in the blanks of the sentence(s)
One word per blank ( _ ).
sentence
words
order
Output: The sentence with blanks filled.
Example:
Sentence: “Hello my_. Nice to_you_.” (with _
)
Words: “meet friends guys” (separate with space but the order is not ascending nor descending.)
Order: “2,1,3” (the order of the word in csv format)
Output:
“Hello my friends. Nice to meet you guys.” (a text string)
Good luck!
2 Likes
Yoshi
(KidKoder)
June 13, 2020, 8:27am
#2
Will they be in a list?
Also, can there be any number of gaps/words ?
1 Like
Yoshi
(KidKoder)
June 13, 2020, 8:45am
#3
WatermelonIce:
Hello my _ .
Here, you would have later:
“Hello my friends .” Because you have the space after the underscore… can you just remove the space behind it?
1 Like
Yoshi
(KidKoder)
June 13, 2020, 8:46am
#4
Btw, if you
I have a solution with 29 blocks.
1 Like
Yoshi:
Will they be in a list?
no.
WatermelonIce:
string input
Yoshi:
any number of gaps/word
My mistake
And why it is matter if i don’t remove the space? just curious.
Yoshi
(KidKoder)
June 13, 2020, 9:38am
#6
Then my out put would be:
1 Like
Yoshi
(KidKoder)
June 13, 2020, 9:39am
#7
WatermelonIce:
no.
So I can’t set the last input for the variable to list from csv row text 2,1,3
?
1 Like
no, the input should be string, but you can make whatever you want in the procedure.
Yoshi
(KidKoder)
June 13, 2020, 9:41am
#11
Ok. I’ll post my solution here now, but be aware! It’s completely untested since I have no Companion.
1 Like
Yoshi
(KidKoder)
June 13, 2020, 9:43am
#12
Now my solution has 31 blocks
Please test it for me since I don’t know if it works.
Thanks. Gtg now, will come back later. Happy Koding!
1 Like
Before you go can you tell me what does x x2 and x3 means?
1 Like
Yoshi
(KidKoder)
June 13, 2020, 9:57am
#14
Oh yes. sorry. I updated my Solution.
1 Like
It didn’t work, tips you should use replace list item instead of set item
1 Like
Yoshi
(KidKoder)
June 13, 2020, 10:01am
#17
Edited, Did it work now? Btw 35 blocks now.
1 Like
Yoshi:
Did it work now?
Yes but the output don’t have any space.
Like
Hellohowareyou
1 Like
Yoshi
(KidKoder)
June 13, 2020, 10:06am
#19
WatermelonIce:
Hellohowareyou
It should be
Hellomyfriends.Nicetomeetyouguys if it was like you say…
but anyway, I will work on it…
1 Like
Yoshi
(KidKoder)
June 13, 2020, 10:07am
#20
Are the words inserted however?
1 Like