Discuss Scratch

AonymousGuy
Scratcher
1000+ 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:
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;
}
}
So obviously there would need to be some way to return a value.
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:
void doStuff()
{
using (int x)
{
do stuff that uses int x
}
do stuff that doesn't use int x
}
I think that maybe these should also have different colors, and they should use the right-click functions to get the other blocks.



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.

Last edited by AonymousGuy (Nov. 27, 2016 06:53:47)

Firedrake969
Scratcher
1000+ posts

Better Custom Blocks

Support all! All are used in real coding; why not here?

'17 rickoid

bf97b44a7fbd33db070f6ade2b7dc549
jontmy00
Scratcher
500+ posts

Better Custom Blocks

Support.

Hello.
DotDash
Scratcher
1000+ posts

Better Custom Blocks

SUPPORT

My browser / operating system: MacOS Macintosh X 10.8.5, Chrome 29.0.1547.76, Flash 11.8 (release 800)
meowflash
Scratcher
500+ posts

Better Custom Blocks

(unneeded quote text removed by moderator - please keep your posts concise)

Brilliant!

Last edited by Paddle2See (Dec. 24, 2013 22:52:59)


More Stuff|My Bandcamp
My DeviantArt|Intro Voting For December 2015 August 10th 2016
My dank userscript|Check out my Github, too!

Kumquats, this signature is inedible and poisonus.
Also try the code below in IBNIZ.
sxsaxAr+waxBr-*
Mrcomputer1
Scratcher
500+ posts

Better Custom Blocks

+1
Good idea.

My Profile / OS Projects / My Test Account / Bored Activities / My website /
——————–
Progress bar to 500+ Posts - Image not updated lots (Progress last updated: I forget to update this :P)

——————–
My browser / operating system: Windows 10 (NT 10.0), Firefox 49.0, Flash 23.0 (release 0)
——————–
My Scratch Extensions——–If you like this post then give me an internet!——–Sharp Scratch Mod
AonymousGuy
Scratcher
1000+ posts

Better Custom Blocks

meowflash wrote:

*Collapsed*
Brilliant!

Does that mean you support?
cobraguy
Scratcher
1000+ posts

Better Custom Blocks

I like the Local Variables and have come across a few times when I could have used them. I'm sorta on the fence about this because it would be confusing for new scratchers.
LeadToGold
Scratcher
96 posts

Better Custom Blocks

I support this suggestion as well.

I think the highest priority is the return value. (boolean is sort of a special case of return value).

Function local variables would certainly be useful but the I worry that the implementation would add more confusion for beginning programmers.

Sean

set (TheQuestion) to <<(2b) = [0]> or <not <(2b) = [0]>>>
k9lego
Scratcher
1000+ posts

Better Custom Blocks

Support! And my sister's account @v9lego Supports too! So please add us both to the support list. k9lego

- Let's Eat  Grandma! This is a hidden advertisement for the Collab Hyper Cloud Inc. :)
- Let's Eat, Grandma!
Commas Save Lives!























Nothing Much here…



















If you want to reply to me, please comment with the link to the topic “On my profile page”. thanks. k9lego
mathfreak231
Scratcher
1000+ posts

Better Custom Blocks

AonymousGuy wrote:

#1: CUSTOM REPORTER BLOCKS
Not the best mock-up I've ever seen. The oval should be outlined subtly and not colored in, like the define shape. (is this clear)

Also, the return thing shouldn't be at the end; what if I wanted to use if blocks to first report and stop if one condition is true before another? (is this clear)

Otherwise, support.

Last edited by mathfreak231 (Nov. 22, 2013 01:58:56)


3DS FC: 3239-6065-2543 (Ask me before adding) | AS: Alex~ | X: Alex (DWS)
Ask me on my profile about XYORAS breeding requests!

My browser / operating system: MacOS Macintosh X 10.11.3, Safari 9.0.3, Flash 20.0 (release 0)
AonymousGuy
Scratcher
1000+ posts

Better Custom Blocks

mathfreak231 wrote:

AonymousGuy wrote:

#1: CUSTOM REPORTER BLOCKS
Not the best mock-up I've ever seen. The oval should be outlined subtly and not colored in, like the define shape. (is this clear)

Also, the return thing shouldn't be at the end; what if I wanted to use if blocks to first report and stop if one condition is true before another? (is this clear)

Otherwise, support.

1) The mock-up was rushed - but built from screenshots taken directly from the editor (I used a colored IF … THEN block to make the bar to the side, and a define block and a custom block to build the rest)
2) Well… there are ways around this (especially if there were local variables) but I understand
3) OK.

Last edited by AonymousGuy (Nov. 22, 2013 02:16:03)

TheGuyWithTheHat2
Scratcher
33 posts

Better Custom Blocks

Support!

define change signature
go to [computer v]
go to [scratch.mit.edu/discuss v]
point towards [change signature v]
click [change signature v]
delete (dumb satire or something about ducks v) of [signature v]
add [two other things] to [signature v]
play sound [doot do doo changing my sig v] until done
click [submit v]

When someone says something offensive to you





Guy who said something offensive




AonymousGuy
Scratcher
1000+ posts

Better Custom Blocks

12 supporters! Can we get more?
conorb
Scratcher
9 posts

Better Custom Blocks

Nice Information
AonymousGuy
Scratcher
1000+ posts

Better Custom Blocks

conorb wrote:

Nice Information

Do you support?
TimothyLawyer
Scratcher
1000+ posts

Better Custom Blocks

1. Support
2. (1) takes care of this with other blocks already in Scratch.
3. I support local variables in principle, but do not see a way to add this to Scratch that is easy enough.

Here is a mock-up extending the idea in (1) for custom reporters in Scratch:



AonymousGuy
Scratcher
1000+ posts

Better Custom Blocks

TimothyLawyer wrote:

1. Support
2. (1) takes care of this with other blocks already in Scratch.
3. I support local variables in principle, but do not see a way to add this to Scratch that is easy enough.

Here is a mock-up extending the idea in (1) for custom reporters in Scratch:




Thanks for supporting!
Good mock-up art! I wondered how it would be good to implement making new return blocks.

Last edited by AonymousGuy (Nov. 25, 2013 16:21:44)

Photoguy77
Scratcher
100+ posts

Better Custom Blocks

Supporting!

-Photoguy77

“Without enjoying, one will never truly learn” ~Flome

“Finding happiness starts in you” ~ProdigyZeta7

TimothyLawyer
Scratcher
1000+ posts

Better Custom Blocks

AonymousGuy wrote:

Thanks for supporting!
Good mock-up art! I wondered how it would be good to implement making new return blocks.
Thank you for this thread and your ideas!

I have been thinking about how to simplify this.

From my mock-up, get rid of the Make a Reporter button and New Reporter dialog box.

Instead:

Add a “Return a value” checkbox to the New Block dialog box. (This could be at the top.)

If “Return value” is checked, the outline of the block becomes a reporter (capsule shaped) both in the dialog box and the define block (and after it is made).

The other change is to the define block. Like in the mock-up, it is a wrap block. And the blue return value cap block is affixed to it.

But the C (wrap) is collapsed so the return cap block is connected, at start, to the top tab of the define block.

Since the return block is connected like a normal stack block, it is obvious to Scratchers they can add new blocks in between.

Since the return block is connected like a normal stack block, it is obvious the definition returns whatever value is in the return cap block, if no other changes are made.

As in the mock-up, the return value cap block can be clicked-and-dragged from the define block to create new cap blocks to use elsewhere in the definition (like blue reporter blocks in Scratch block definitions).

When I get a chance, I'll create new mock-up art.

Powered by DjangoBB

Standard | Mobile