Discuss Scratch

DataLabGames
Scratcher
100+ posts

Custom c blocks and hat blocks

Support, but this might be a little confusing to new scratchers.

“Questions are why answers exist”
-@DataLabGames

Most active in the suggestions forum on the forums. I give suggestions and talk about other suggestions.

Check out these cool suggestions by other people:
• https://scratch.mit.edu/discuss/topic/420549/
https://scratch.mit.edu/discuss/topic/416708/


Oh dear, ST. It appears that your new announcement is now a war zone XD
Priff
Scratcher
66 posts

Custom c blocks and hat blocks

Support. This could make it easier to make long “if else” chains

A good tutorial >> https://scratch.mit.edu/projects/403861132/ <<
A great game >> https://scratch.mit.edu/projects/412122077/ <<

when green flag clicked
forever
imagine
program
share
end
gilbert_given_189
Scratcher
500+ posts

Custom c blocks and hat blocks

Well, to my mind, there is no other programming languages that have this feature. So…

If you see a line above this text, it means that below this text is my signature.
This place is just a memory to me, I may return occasionally but I'm busy.
I guess I'm an ATer now.

I think I may have seasoned my posts a bit too much.


Colored Pencil is supposed to color the siggy, but Scratch says it's too big.


There is nothing here…



don don pan pan
dondo pan pan
Programmer_55
Scratcher
51 posts

Custom c blocks and hat blocks

define c_block{Code}
//{Code} is meant to be a block insert, but for some reason forum scratchblocks doesn't support that.
...//Your code here
Code::custom-arg
...//More of your code here
Support.

Old account of Ninji2701. Go check that for more info.
space_elephant
Scratcher
500+ posts

Custom c blocks and hat blocks

gilbert_given_189 wrote:

Are you suggesting to make a custom C-block? How would it function? Like this?
de​fine {custom c block! (number :: custom) (string :: custom) <boolean :: custom>{
}foo{
}bar{
} :: custom}{run [ v] :: custom cap} :: custom hat
if <(number :: custom) = (string :: custom)> then
run [custom c-block v] :: custom cap
else
if <<boolean :: custom> = <not <>>> then
run [foo v] :: custom cap
end
run [bar v] :: custom cap
end


when green flag clicked
custom c block! () [] <>{
}foo{
}bar{
} :: custom

edit: i need to fix up a lot of errors i made
No. C-mouthes are just like other inputs.
de​fine {if <cond1::custom-arg>{
act1::custom-arg
}else if <cond2::custom-arg>{
act2::custom-arg
}else{
none::custom-arg
} :: custom} :: custom hat
if <cond1::custom-arg>::control
act1::custom-arg
else
if <cond2::custom-arg>::control
act2::custom-arg
else
none::custom-arg
end
end

red link
[url=redlink.com][color=red][u]red link[/u][/color][/url]
scratchastroLOL
Scratcher
1000+ posts

Custom c blocks and hat blocks

i think the define block should be more like this:

define Custom Hat block
wait until <>
run script :: custom cap

and for the c block:

define C block
run script :: custom

Support. I think it's useful because there are tons of blocks that could be made with this. The only con is that new scratchers could be confused.

Last edited by scratchastroLOL (July 15, 2020 00:50:16)

scwestbrook
Scratcher
100+ posts

Custom c blocks and hat blocks

I think this would be very useful! For example:
define when <Boolean>::event
Return true when <Boolean>::custom

Hi! I'm in the process of reviving a dead account!

when I receive [Pride Month]
switch costume to [Pride_Flag]
sportfan999
Scratcher
1000+ posts

Custom c blocks and hat blocks

100% support! I've always wanted to do this !

look who's back!
gilbert_given_189
Scratcher
500+ posts

Custom c blocks and hat blocks

bump but it's colored by your average color pencil
I don't think the colors are right…

If you see a line above this text, it means that below this text is my signature.
This place is just a memory to me, I may return occasionally but I'm busy.
I guess I'm an ATer now.

I think I may have seasoned my posts a bit too much.


Colored Pencil is supposed to color the siggy, but Scratch says it's too big.


There is nothing here…



don don pan pan
dondo pan pan
Basic88
Scratcher
1000+ posts

Custom c blocks and hat blocks

no support. such a thing does not exist in other programming languages. Custom stacks are basically functions.

I have moved to @BrowserExtension
jettypumpkin07
Scratcher
1000+ posts

Custom c blocks and hat blocks

Basic88 wrote:

no support. such a thing does not exist in other programming languages. Custom stacks are basically functions.
You can do it in Snap….. But yeah you have a point there.
for (i) in 1 to (10) {

} :: control

-jettypumpkin07 Profile ~ GitHub ~ Wiki Edits ~ Stats ~ Posts
I haven't really been active much since 2021. I now mostly look at / help with other people's projects, answer questions on the forums and work on stuff in other programming languages like JavaScript. Scratch is still awesome and I don't think I'll be leaving it any time soon. <3


Check out ocular, a Scratch forum search tool by jeffalo that helps find lost posts, or the Hidden Blocks TurboWarp extension I helped create that has a bunch of useful hacked blocks ready to add to your Scratch projects. (PR for details, see the Hidden Blocks category to the left of the editor.)


Super Mario World Maker 3.0 Update coming soon ~ Suggest what you want added!

The state of my life right now (I'm in Grade 12 next year):

Bonus image for Extension users and Inspect Element bois:

I'm the guy who made the ‘Multiple rows in backpack’ addon btw, you should try it!
Basic88
Scratcher
1000+ posts

Custom c blocks and hat blocks

jettypumpkin07 wrote:

Basic88 wrote:

no support. such a thing does not exist in other programming languages. Custom stacks are basically functions.
You can do it in Snap….. But yeah you have a point there.
for (i) in 1 to (10) {

} :: control
I meant text based ones. It definitely doesn't exist in lua, and I am certain it does not exist in js.

I have moved to @BrowserExtension
space_elephant
Scratcher
500+ posts

Custom c blocks and hat blocks

Basic88 wrote:

no support. such a thing does not exist in other programming languages. Custom stacks are basically functions.
Javascript lets you do it with inline functions, but not easily. However, this is a good feature, and scratch need it.
EDIT: The first post I made was completely wrong.

Last edited by space_elephant (Oct. 15, 2020 13:45:00)


red link
[url=redlink.com][color=red][u]red link[/u][/color][/url]
FlickF
Scratcher
2 posts

Custom c blocks and hat blocks

if <> then
<[(distance to [ Poison] = [ Eat]>])
end
Hearst10
Scratcher
100+ posts

Custom c blocks and hat blocks

duplicate.

Moving from Scratch? Don't learn C or Java, try Snap!
gosoccerboy5
Scratcher
1000+ posts

Custom c blocks and hat blocks

This is custom c blocks and hats, not custom reporters and booleans.

gilbert_given_189 wrote:

Well, to my mind, there is no other programming languages that have this feature. So…
Got it! Now other programming languages are the standard for which we add blocks…?!?!

PkmnQ
Scratcher
1000+ posts

Custom c blocks and hat blocks

Basic88 wrote:

jettypumpkin07 wrote:

Basic88 wrote:

no support. such a thing does not exist in other programming languages. Custom stacks are basically functions.
You can do it in Snap….. But yeah you have a point there.
for (i) in 1 to (10) {

} :: control
I meant text based ones. It definitely doesn't exist in lua, and I am certain it does not exist in js.
You can sorta do it in python with decorators.
# This is the "custom c block"
def repeatUntil(func):
    def inner():
        while not func("bool"):
            func("run")
    return inner
i = 1 # This is the variable definition that comes before the repeat until
@repeatUntil # This shows that we are beginning the repeat until.
def run(arg):
    if arg == "bool":
        return i < 5 # This is the boolean, this is the most effective way I found to get it.
    else:
        print(i) # This is the inside of the custom c block.
        i += 1

Last edited by PkmnQ (Nov. 19, 2020 01:04:24)


This is an account that exists.

Here, have a useful link:
The Official List of Rejected Suggestions by Za-Chary

jettypumpkin07
Scratcher
1000+ posts

Custom c blocks and hat blocks

if <you want [custom c-blocks v] :: operators> then
use Snap! :: custom
else
ask [why are you here?] and wait
end
>>> snap.berkeley.edu/snap/snap.html <<<

And no that isn't blockspam because I'm not spamming and it relates to the topic.

-jettypumpkin07 Profile ~ GitHub ~ Wiki Edits ~ Stats ~ Posts
I haven't really been active much since 2021. I now mostly look at / help with other people's projects, answer questions on the forums and work on stuff in other programming languages like JavaScript. Scratch is still awesome and I don't think I'll be leaving it any time soon. <3


Check out ocular, a Scratch forum search tool by jeffalo that helps find lost posts, or the Hidden Blocks TurboWarp extension I helped create that has a bunch of useful hacked blocks ready to add to your Scratch projects. (PR for details, see the Hidden Blocks category to the left of the editor.)


Super Mario World Maker 3.0 Update coming soon ~ Suggest what you want added!

The state of my life right now (I'm in Grade 12 next year):

Bonus image for Extension users and Inspect Element bois:

I'm the guy who made the ‘Multiple rows in backpack’ addon btw, you should try it!
gosoccerboy5
Scratcher
1000+ posts

Custom c blocks and hat blocks

jettypumpkin07 wrote:

-blockspam snip-
>>> snap.berkeley.edu/snap/snap.html <<<

And no that isn't blockspam because I'm not spamming and it relates to the topic.
set [answer v] to [Because Snap doesn't have a community, I feel the UI is outdated, and because Snap is simply very advanced] :: sensing
broadcast [mic drop v]
say [thank you for coming to my ted talk]


TheStarTrekFan
Scratcher
27 posts

Custom c blocks and hat blocks

well i really want to have custom c blocks but you dont really need c blocks for that
define c block <if this>
if <if this> then

end

Last edited by TheStarTrekFan (Nov. 21, 2020 17:48:43)

Powered by DjangoBB