I think Scratch should have a Remove block and Replace block for variables and lists.
It would work like this.
Replace block:
[When flag clicked]
[Set (Whatever) to (1222333111222)]
[Replace (1)s of variable (Whatever) with (5)s]
(Now the Variable would look like this: 5222333555222).
------------------------------------------------------------------------------
Remove block:
[When flag clicked]
[Set (Whatever) to (192399994999999999999599996)]
[Remove (9)s of variable (Whatever)]
(Now the Variable would look like this: 123456).
-----------------------------------------------------------------------------
These blocks would be EXTREMELY helpful to me.
And I would love it even more if you could remove/replace, Spaces.
Supporters:
CheeseMunchy
GOD_MOD3
destroydaworld111
Last edited by CheeseMunchy (2012-01-21 12:46:17)
Offline
G0D_M0D3 wrote:
Well, that would be nice, but hard to code.
What do you mean?
Offline
CheeseMunchy wrote:
G0D_M0D3 wrote:
Well, that would be nice, but hard to code.
What do you mean?
Well, every block in scratch is coded in Squeak.
For example, the move (num) steps block's codde looks like this:
forward: t1 | t2 t3 t4 t5 t6 | t2 _ rotationDegrees degreesToRadians. t3 _ t2 cos @ t2 sin * t1. t4 _ self position + t3. t5 _ t4 x. t6 _ t4 y. t5 isNaN ifTrue: [t5 _ 0]. t5 isInf ifTrue: [t5 _ t5 sign * 10000]. t6 isNaN ifTrue: [t6 _ 0]. t6 isInf ifTrue: [t6 _ t6 sign * 10000]. self position: t5 @ t6. self keepOnScreen
So something even less simple would require more code.
Offline
G0D_M0D3 wrote:
CheeseMunchy wrote:
G0D_M0D3 wrote:
Well, that would be nice, but hard to code.
What do you mean?
Well, every block in scratch is coded in Squeak.
For example, the move (num) steps block's codde looks like this:Code:
forward: t1 | t2 t3 t4 t5 t6 | t2 _ rotationDegrees degreesToRadians. t3 _ t2 cos @ t2 sin * t1. t4 _ self position + t3. t5 _ t4 x. t6 _ t4 y. t5 isNaN ifTrue: [t5 _ 0]. t5 isInf ifTrue: [t5 _ t5 sign * 10000]. t6 isNaN ifTrue: [t6 _ 0]. t6 isInf ifTrue: [t6 _ t6 sign * 10000]. self position: t5 @ t6. self keepOnScreenSo something even less simple would require more code.
Oh, I thought you were talking about something else.
Offline
My ROT13 project's script would be so much shorter if I had that
Offline
I support this idea.
Offline
It should be a single reporter block: (replace [] with [] in []). To remove, leave the WITH field blank.
And Scratch 2.0 is going to be in Flash, and I think they have a function that does exactly this.
Last edited by scimonster (2012-01-22 10:18:23)
Offline
scimonster wrote:
It should be a single reporter block: (replace [] with [] in []). To remove, leave the WITH field blank.
![]()
And Scratch 2.0 is going to be in Flash, and I think they have a function that does exactly this.![]()
GREAT!
I'm working on a project where this feature is Vital.
Offline
Bump.
Offline
Bump.
Y u fall down topic? D:
Offline