This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-06-11 15:12:17

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Unjoin Block and Contains Block

Unjoin Block:
When I was working on a project I noticed there is no way to unjoin things. I need to do this so the sprite can see what a user wants to do. My project will allow a user to control a Sprite by typing commands and other stuff but the Sprite won't know what to do without unjoining the phrase. Like this:

ScratchUser's Command wrote:

Move 10

Sprite wrote:

[Move (Unjoin |10| from |Move 10|) Steps]

So you would Move 10 Steps. This should allow more control over Strings. But with this you might not need (Letter (#) of [Word]). Instead you could just use unjoin by
(Unjoin |Letter| from |Word|) .

Contains Block:
I know there is 1 for lists but if we have < [letter, number, word, phrase, or List/Array] contains [same] > Then we can do more things with it.

These are basically changes to blocks or replacements of blocks.

Last edited by Magnie (2009-06-11 15:12:45)

Offline

 

#2 2009-06-11 15:53:48

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Unjoin Block and Contains Block

Hi Magnie, you could try using a loop and an index variable to copy each letter of the desired substring into a new list. This new list can - now, this is another new feature - be concatenated using the list reporter. If each element contains just a single character, no spaces will be added in between.


Jens Mönig

Offline

 

#3 2009-06-11 17:04:52

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Unjoin Block and Contains Block

Is this for your programming language? Also, will you join the ScratchText Team? I am looking for people to add to the ScratchText team. If you accept, please comment yes or no on ScratchText 1.1.3. This would mean that you would make "Magnie's ScratchText" projects and work on the original ScratchText series. You would also be given credit for however much of the ScratchText projects you worked on. For example, if you made half of a ScratchText project, you would be given credit for half of the project in the project notes and in the project. You could also share your ideas with the other members of the ScratchText team. So far, no one has answered back, but I have asked Paddle2See, tcb, and you.

Offline

 

#4 2009-06-11 19:24:43

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Unjoin Block and Contains Block

The Whiz: Sure, I'll join

Jens: 1st part: That is what I am currently doing. 2nd Part: I mean the Contain block instead of just <[List] contains [item]> it would be <[anything] contains [anything]>

Offline

 

#5 2009-06-11 20:57:24

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Unjoin Block and Contains Block

Magnie, perhaps I did not manage to explain cleary. If you take a look at my project Eliza you'll find - towards the bottom - two commented scripts named "find substring" and "copy substring", as well as two examples how to use these.


Jens Mönig

Offline

 

Board footer