Discuss Scratch

SonicFanX123_321
Scratcher
1000+ posts

jump to block and scripts labels

table of contents
I. introduction
II. how would this look?
III. blocks
IV. workarounds
V. pros and cons
VI. closing remarks

I. introduction
in (all variations of) assembly, one can do this (this is 6502 assembly, but other variations are similar or the exact same):
code1:
jmp code2
code2:
jmp code1

the parts ‘code1:’ and ‘code2:’ are labels and their locations are saved by the assembler so that whenever they're referenced (i.e. by a JMP instruction just like here) the assembler substitutes the locations of these labels. in other words: assuming code1 is at location $0000 and code 2 is at location $0003, this would be changed by the assembler to this:
$0000: jmp $0003
$0003: jmp $0000
(the $0000 and $0003 at the beginning of each line is the location of that line)
this would then be assembled by the assembler (we don't care about this step).

II. how would this look?
labels:

how to assign label to code:
I. click on its beginning hat block
II. click “assign label”
III. type in label name (label must not share name with another label in this sprite or background)
IV. click OK


III. blocks
there'll just be one block, it'll be:
jump to [reset v] ::control
other styles could be:
go to label [reset v] ::control

jump to label [reset v] ::control
“go to label” could easily be confused with the motion blocks, though.

IV. workarounds
currently there are a couple of workarounds that come into my mind:
IV.I. broadcasts
when green flag clicked
broadcast [reset v] // jump to label [reset v]

when I receive [reset v] // code label reset
...
IV.II. variables
when green flag clicked
set [run code v] to [reset]

when green flag clicked
forever
if ((runcode) = [reset]) then
...
else
if ((runcode) = [start level]) then
...
end
end
end
V. pros and cons
V.I. pros
- easier method to jump between code
V.II. cons
- might be confusing to new users (although you could technically say that variables could be confusing to the new users, or broadcasts)
VI. closing remarks
overall, I think this could be a good thing to add to scratch. I understand this would be a huge change, but introducing something like this I'd say is a good change. although I think only assembly standard has this in place of functions, but still. I'd like to see this added to scratch.

this is my page

I'm not active on scratch anymore, I moved on.
blablablahello
Scratcher
1000+ posts

jump to block and scripts labels

Personally i wouldn't consider myself a “new user”, but this is quite confusing.

One thing I dont understand is why you cant just workaround this via if statements and other stuff. For example, say I want to skip a part of the code when the other code reachs a certain part, why cant I just, not add in the part im skipping? and if its in a forever loop, it would kinda make sense but tbh variables seem good enough for this (as you would be saving 2 blocks and its not any less confusing)

Highlight, Hold shift, Press down arrow to scroll down


HEHEHEHAW

Everytime someone says “I did a quick search”, I question wether they meant they did a quicksearch (The algorithm) or a quick search (Quickly searching)

鸡你
实在是太美哦贝贝
实在是太美
多一眼就会爆炸
近一点会被融化
干嘛
你干嘛哈哈诶有
oh yea哈哈
多一眼就会爆炸
近一点会~融~化~~~

我个人认为,这个意大利面就应该拌四十二号混凝土,因为这个螺丝钉的长度,很容易会直接影响到挖掘机的扭矩,你知道吧,你往里砸的时候,一瞬间,他就会产生大量的高能蛋白,俗称UFO,会严重影响经济的发展,甚至对整个太平洋以及充电器,都会造成一定的核污染,你知道吧,啊,再者说根据勾股定理,你可以很容易的推断出,人工饲养的东条鹰鸡,它是可以捕获野生的三角函数的,所以说这个这个这个,你不管秦始皇的切面是否具有放射性,特朗普的n次方,是否含有沉淀物,都不应影响这个这个沃尔玛跟维尔康在南极汇合,啊!

大家好,我是练习两年半的个人练习生蔡徐坤!我喜欢唱,跳,rap,还有打篮球

早上好中国我喜欢吃冰淇凌!



















why are you down here why are you down here why are you down here




qwertycodechamp90411
Scratcher
100+ posts

jump to block and scripts labels

Maybe not the warning that each label must be different - you can just have a pop-up just like variables.

Useful Links: Text Generator ——— Encoders/Decoders (Normal, Case Sensitive) ——— New Math Blocks ——— Comment what next on my profile!
Wait, we’re at 900 million projects? So close to 1 billion projects uploaded to the server!

<((x) ^ ((1) / (y))::operators) = ((y) √ (x)::operators)> // is false if x < 0???
Hi! I'm qwertycodechamp90411. I'm most active on the suggestions forum and the help with scripts forum, because I like to help other people and improve scratch! I like to think I'm good at scratch, but there's a lot I don't know/understand (how on earth do scrolling platformers work lol). As a general rule of thumb, I should have the answer if it's math related, because I'm a very stereotypical nerd when it comes to math.
qwerty_wasd_gone
Scratcher
1000+ posts

jump to block and scripts labels

what is the difference between this and broadcasts

shift+ctrl+down arrow to scroll
I may sometimes make mistakes, change my mind, etc., and edit my posts
When (::red) clicked :: events hat
repeat until <key [all v] pressed?>{
destroy this sprite::control cap
when @greenFlag misclicked::events hat
become idiot::custom}::control
(╯°□° ╯︵ ┻━┻::red)::#000000 reporter//this is brad, he creates cursed scripts like the one you saw above
(ㆆ_ㆆ)//this is max, he stares at you with that expression if you say you don't support my suggestion


You found me
SonicFanX123_321
Scratcher
1000+ posts

jump to block and scripts labels

MythosLore wrote:

I think this is rejected.
no, I think you mean it's a duplicate.

this is my page

I'm not active on scratch anymore, I moved on.
k7e
Scratcher
1000+ posts

jump to block and scripts labels

SonicFanX123_321 wrote:

MythosLore wrote:

I think this is rejected.
no, I think you mean it's a duplicate.
… Of a rejected suggestion.

@mythoslore was so much more obvious than @spookily

Powered by DjangoBB