Discuss Scratch

LW_Studios
New to Scratch
3 posts

"Go to" Blocks

This is something I've seen in a lot of automation programs that use if/if else conditions. The only way I know how to describe it is with examples;

So lets say you're working on a project and you have a very long script filled with if/else conditions, like below;

forever
if <true> then
do stuff
end
if <true> then
do other stuff
end
if <true> then
do stuff
end
if <true> then
do more stuff
end
if <true> then
do stuff
end
end

Now lets say that you don't want the middle blocks to be checked if the first or second one renders true. Instead, you'd rather have the last block checked if the first or second is true. This is where labels and go to's come in;

forever
if <true> then
do stuff
end
if <true> then
do other stuff
go to [ Skipper]
end
if <true> then
do some stuff
if <true> then
do more stuff
end
Label: Skipper
if <true> then
do stuff
end
end

Users would create as many labels as needed, such as variables, and a “go to” block would contain a pull down list of all the labels they have created. These blocks would probably have a different color scheme, such as grey for the go to block, and beige for the labels, just to add clarity to the scripts.

This method of labeling and assigning go-to blocks could also be used as a form of looping!;

when green flag clicked
Label: Start loop
if <true> then
go to [ End loop]
else
go to [ Start loop]
end
Label: End loop
Continue with the rest of the script
This would be a great feature because I hate it when you want to make a loop with if-Blocks but you must duplicate the hole code.
Thoughts?

Last edited by LW_Studios (June 22, 2018 20:37:50)

Wahsp
Scratcher
1000+ posts

"Go to" Blocks

Not thinking 100% clearly at the moment, but I think this might be able to done with variables (can’t really come up with how to describe it)

Last edited by Wahsp (June 23, 2018 01:10:41)


​I am Wahsp
______________________________________________________

Formerly pretty active on the forums, probably mostly retired now…
If you see one of my posts send me a hello!
______________________________________________________
Sheep_maker
Scratcher
1000+ posts

"Go to" Blocks

I believe this is workaroundable using the broadcast blocks.

Also, I heard that using “go to” commands is considered bad practice because it makes the code harder to follow.

Additionally, I found this duplicate, which strangely has the same content as the OP.

- Sheep_maker This is a kumquat-free signature. :P
This is my signature. It appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
mica43683
Scratcher
500+ posts

"Go to" Blocks

go to x: () y: ()
go to [Sprite v]
I believe these already exist.

I got a lot of compliments on my last signature, and I think that's kind of strange. I wrote it when I was 12 and it wasn't very good. I acted like PS4 controllers were the epitome of human technology, for God's sake! I tried too hard to be philosophical, or maybe I tried too hard to be funny, or maybe it was something else. But that signature was bad. It wasn't good. It might be strange for some of you to hear this, seeing as this site is full of kids, but 12-year-old me was practically a baby. I think that's something you realise when you grow up. That you're always better than you were last year. I was looking through old Skype messages between me and a friend of mine from when we were 12, and as I read them, I couldn't stop thinking, “Woah. I was the worst.” It's important to know that you're always the worst. I can almost guarantee that future you is thinking negatively of you right now, just as future me is thinking negatively of me. It's important not to let that get to you. Remember to stay in the present. Tomorrow hates you, but it can't hurt you because you'll never get to tomorrow. When I was 10 or 11, I remember seeing the world very cynically. I thought that human life was inherently selfish, and that we were only put on this planet to destroy it. I'm so glad 10 or 11 year old me is gone, because 17 year old me would NOT get along with that kid.
Sheep_maker
Scratcher
1000+ posts

"Go to" Blocks

mica43683 wrote:

go to x: () y: ()
go to [Sprite v]
I believe these already exist.

mica43683 wrote:

go to x: () y: ()
go to [Sprite v]
I believe these already exist.
I believe you misinterpreted the suggestion.

- Sheep_maker This is a kumquat-free signature. :P
This is my signature. It appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
Happysoul05
Scratcher
100+ posts

"Go to" Blocks

Sheep_maker wrote:

I believe this is workaroundable using the broadcast blocks.

Also, I heard that using “go to” commands is considered bad practice because it makes the code harder to follow.

Additionally, I found this duplicate, which strangely has the same content as the OP.
I think like it's copied
I dont remember any language that has this thing.
There are problems with blocks:
1) In which category? : control
2)So it will have 2 blocks i)
 go to [yay v]::control 
ii)
 lablel : [yay v]::control 
So it will do nothing if one label block is missing ?
3) Why do you need it? I never saw this type of problem.I know if I saw it somewhere I have used broadcasts or vars for that.It will make it like flow chart's connector!
4) Kids cant understand this easily.

No support
LW_Studios
New to Scratch
3 posts

"Go to" Blocks

Sheep_maker wrote:

I believe this is workaroundable using the broadcast blocks.

Also, I heard that using “go to” commands is considered bad practice because it makes the code harder to follow.

Additionally, I found this duplicate, which strangely has the same content as the OP.

I' ve copied this because there was no usable answer.
Sheep_maker
Scratcher
1000+ posts

"Go to" Blocks

LW_Studios wrote:

Sheep_maker wrote:

I believe this is workaroundable using the broadcast blocks.

Also, I heard that using “go to” commands is considered bad practice because it makes the code harder to follow.

Additionally, I found this duplicate, which strangely has the same content as the OP.

I' ve copied this because there was no usable answer.
Why not post on the other topic? Necroposting isn't a thing on the suggestions forums, given that the suggestion hasn't been implemented yet and the post is constructive.

- Sheep_maker This is a kumquat-free signature. :P
This is my signature. It appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
TheAdriCoolManDude
Scratcher
1000+ posts

"Go to" Blocks

Shouldn't this topic be closed. And no support for reasons above.


Powered by DjangoBB