Discuss Scratch

vandjac
Scratcher
38 posts

Help with join block needed

I am making a project where I need to join a bunch of things together using the join block. I am taking things from a list and joining them together, but I can't join more than about 20 before scratch starts to lag. I was wondering if there was a way that is a lot easier or more efficient than what I am trying to do now. Any help would be greatly appreciated! Thanks!
It looks something like this, except with a lot more joins:
(join (join (join (join [] [world]) [world]) [world]) [world])

Last edited by vandjac (Oct. 29, 2015 23:25:13)

drmcw
Scratcher
1000+ posts

Help with join block needed

If it's a subset of a llist then copy the subset to another list then use

(list :: list)

The only gotcha is if all the list items are single character then they will be joined without spaces, so you effectively get a word from letters but a sentence from words as for everything else the items are space separated.
vandjac
Scratcher
38 posts

Help with join block needed

Well I am trying to join a bunch of list items that are single characters into one code without spaces.
drmcw
Scratcher
1000+ posts

Help with join block needed

That's perfect for you then
vandjac
Scratcher
38 posts

Help with join block needed

I am kind or confused by what you mean. Could you give me an example?


drmcw wrote:

If it's a subset of a llist then copy the subset to another list then use

(list :: list)

KryptykProductions
Scratcher
96 posts

Help with join block needed

Here's what I do in this situation:
set [Joiner v] to [  ]//Completely blank
set [List Item v] to (0)
repeat (20)

change [List Item v] by (1)//Uses next list item
set [Joiner v] to (join (Joiner) (item (List Item) of [List v]))
end
Use (Joiner) for whatever you need here...::motion

This will give you 20 list items joined together.
Hope this helps!
vandjac
Scratcher
38 posts

Help with join block needed

Never mind I figured it out. Thank you though! I will give you the link to the project as soon as it is shared. Thank you guys again for all the help and support!
vandjac
Scratcher
38 posts

Help with join block needed

Here is the link:
https://scratch.mit.edu/projects/84482436/

forever

say [Scratch is awesome!] for (infinite) secs
end

Powered by DjangoBB