Discuss Scratch
- Discussion Forums
- » Suggestions
- » Better Custom Blocks
- SimpleScratch
- Scratcher
500+ posts
Better Custom Blocks
Read 1st post on this thread - real shame that custom reporters have not been added in the last 8 years
- Tropic
- Scratcher
1000+ posts
Better Custom Blocks
Yeah Read 1st post on this thread - real shame that custom reporters have not been added in the last 8 years
This is the post you're talking about right?:
Support all! All are used in real coding; why not here?
- xRyeunMigsx
- Scratcher
87 posts
Better Custom Blocks
Supported.
This is a sigature.
BOOM BOOMY BOOM BOOMED
- thelegosensei
- Scratcher
21 posts
Better Custom Blocks
this is basically the perfect implementation of this concept: https://snap.berkeley.edu/
it's beautiful…
it's beautiful…
Last edited by thelegosensei (April 24, 2019 00:39:48)
I'm Batman.
- --Explosion--
- Scratcher
1000+ posts
Better Custom Blocks
Support, however I feel that there should be a way of having inputs inside the varible such as (custom block and ), sorry scratchblocks are hard
- --Explosion--
- Scratcher
1000+ posts
Better Custom Blocks
bump
- klasky1
- Scratcher
100+ posts
Better Custom Blocks
There are quite a few improvements I have noticed that could be made to custom blocks.
Please read entire post, especially if you are skeptical about it.
*NOTICE: Some of these are in other topics, but I feel I should mention them here as well.
IDEAS 1 & 2: (Can you guess what they are? )
#1: CUSTOM REPORTER BLOCKS
Custom reporters. If you don't know what a reporter is, here is a helpful wiki article. Basically, these would work similar to how they work in other programming languages. In other languages, it would look something like this:So obviously there would need to be some way to return a value.int getWaffles()
{
if (waffles == tasty)
{
return 20; //This tells you what "getWaffles()" is equal to. So if I were to say x = getWaffles(); x would either be equal to 20 or 0.
}
else
{
return 0;
}
}
That is where the “report” block comes in. This is based slightly off of BYOB, which uses the same statement. The reason for this is that report might be easier to understand then return, but it is possible to make it return as well. The bottom report block could be dragged and placed elsewhere in the block. (Thanks @TimothyLawyer for suggesting that!)
So how this would work is that when a custom reporter was used in a block, it would run the code and find the return / report value. If there was none, it would report the value at the bottom.
#2: CUSTOM BOOLEAN BLOCKS
These are obviously the same as custom reporter blocks, but are booleans. A function this could be used for is making a “is a multiple of” block or something similar. They could be used to say “string contains other string” and other functions that are too simple to be made into a full-fledged block, but good enough to make custom.
#3: LOCAL VARIABLES
These would be variables that were completely local to the block. No other part of the program could use them. How would these work?
There are 2 ideas:
This is the first one. But how would this work? Somewhere there would have to be something like a “create local variable” button. Obviously, a “create variable” block wouldn't work so well, because that would make it possible to lag out scratch. However, the idea of getting the set, change, etc. blocks by right clicking and pushing “get block…” is plausible.
I think this is the better solution. How it would work is similar to custom blocks. Only the blocks inside of the C-Block could use the variables. The weird looking variables and lists that look like “+” are just a quick sketch of how the using block could create more than one variable. However, I think it should only be able to hold either variables or lists.
The inspiration for this idea came from a language I use called C#, in which you can say this:I think that maybe these should also have different colors, and they should use the right-click functions to get the other blocks.void doStuff()
{
using (int x)
{
do stuff that uses int x
}
do stuff that doesn't use int x
}
NOW: THE ISSUES
There are a few problems with implementing these features.
a) New Scratchers might find them difficult - this is true. When I started doing real line-by-line coding, I found it hard to understand WHY a return value was needed. This was because I was calling the things as functions and not as values - so maybe it would make more sense here.
b) Hard to implement - this is the worst problem. Because they would be hard to use for new scratchers, it is not on the scratch team's list. Also, for custom variables, there would probably have to be a block editor. Otherwise, when would the variables you needed show? When you clicked on the script you were editing? Who knows?
c) Most of these features are already in BYOB, so you can just use that.
THE ADVANTAGES
a) This would allow people to make much more organized projects, make blocks that other scratchers could use to perform well-made functions, and make scripts much easier.
b) This would be a good way to learn about more advanced programming topics.
c) Even if they are in BYOB, it is much more advanced than Scratch, so this would make it easier for more people to learn about this kind of thing.
Nice!,PAR :: grey cap
that is{
PAR :: grey cap
}!:: #520AAA
- --Explosion--
- Scratcher
1000+ posts
Better Custom Blocks
SUPPORT!!!!!!!!!!!!!!!!! This would allow users to make much more advanced projectsin scratch
- Luvexina
- Scratcher
500+ posts
Better Custom Blocks
I support this. I code in other programming languages a lot, and I use things similar to this
Support trans youth, in Texas and across the globe!
- ResExsention
- New to Scratch
1000+ posts
Better Custom Blocks
Support as well. The lack of functionality in Scratch is insane, I would really like to see this.
How come nobody from the ST came and said they were considering it?
How come nobody from the ST came and said they were considering it?
Infrequently active.
It feels weird to see how far we've come. I hope you're well, wherever you are!
- klasky1
- Scratcher
100+ posts
Better Custom Blocks
and a reporter!try this:define (num1) ^ (num2)([e^ v] of ((power) * ([ln v] of ([abs v] of (base)))) :: operators)https://en.scratch-wiki.info/wiki/Solving_Exponents
define (num1) ^ (num2)
report ([e^ v] of ((num1) * ([ln v] of ([abs v] of (num2))))):: custom cap
Last edited by klasky1 (May 16, 2019 09:00:26)
- Monniasza_spzoo
- Scratcher
100+ posts
Better Custom Blocks
I want custom C-blocks and E-blocks.
Example:
Example:
define if <cond> run twice [action]
if <cond> then
action :: custom
end
if <some condition:: #ff00ff> run twice {
move (10) steps
}::custom
Last edited by Monniasza_spzoo (May 17, 2019 09:15:18)
- klasky1
- Scratcher
100+ posts
Better Custom Blocks
what? I want custom C-blocks and E-blocks.
Example:define if <cond> run twice [action]
if <cond> then
action :: custom
end
if <some condition:: #ff00ff> run twice {
move (10) steps
}::custom
define if <cond> run twice [action]
if <cond> then
action :: custom
end
if <some condition:: #ff00ff> run twice {
move (10) steps
}::custom
//not this:
if <> run twice []
//thats an error
Last edited by klasky1 (May 17, 2019 10:36:34)