Discuss Scratch

__Falcon-Games__
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

Scratch is a good language for absolute beginner kid programmers but I think that this suggestion could be implemented to make it easier for those kids when they transition from Scratch to a text-based programming language like Python or Javascript.

It is adding structures to Scratch, let me explain. There will be a new section, Structures, here you'll be able to add structures. There will be an Add Structure button to add one. A structure will be able to contain named attributes, for example an animal structure could contain the name of the animal and where the animal lives.
structure [animal] :: looks hat
value [name] :: looks
value [location] :: looks
You will now be able to create instances of structures via dragging the block for the structure from the Structures section.
create instance of  [animal v] with values [Rabbit] [grasslands] named [rabbit] :: looks
This will have a new type of a variable, instances, these variables will have nested values which you will be able to access.
< value [name v] of [rabbit v] :: looks >
Basically these are simpler to understand for kids version of classes, they will be a big help in making complex projects with complex objects that could now be represented with structures, for example you could represent enemy data with structures.
structure [enemy] :: looks hat
value [id] :: looks
value [health] :: looks
For projects that have a lot of different type of data and a lot of objects like big games for example with tons of enemies, it would make their code way more cleaner. This would also help kids transition from block-based programming to text-based programming. You might be asking though, will a eight year old understand this?. It is a more complex concept so it might take them a while for them to get to the stage of understanding it but it can be summed up simply through “you have these variables, now you can create containers that can have multiple variables”, It's usefulness in creating big projects outweighs it's challenges to learn for eight year olds and it's difficulty to implement. It might be a bit difficult but it's similar to lists but with named values, so some code from lists could be copied. At the end of the day I truly think that this feature will be very useful for the Scratch community to a point that exceeds it's difficulty to learn and implement. What I have put in this post is just an example of how it could be implemented, it could be made more simpler or could be made to use less sections, basically it could be adapted to how the ST will think it will be understandable for kids and will be useful for the Scratch community but the basic idea is that structures will be easier to understand and overall simpler versions of classes that could hold multiple named variables and could have instances of them made.

Try out Noml!
__Falcon-Games__
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

this got drowned out pretty quick, I am going to bump it to the top of the forums again.

Try out Noml!
Crispydogs101
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

How does the value term work in python?

Hey! Look at this DTA!
Hej! My username is @Crispydogs101. I like listening to music, playing games, and more!
Sarah and duck, Pete the cat, Pegboard nerds, Tokyo machine, FORZA FAN!! Be High contrast Blue Be rich
__Falcon-Games__
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

Crispydogs101 wrote:

How does the value term work in python?
This is for kids so of course it's drastically simplified but in Python to have “values”, you use self.valuename like this.
>>> class Animal:
...    def __init__(self, name, location):
...        self.name = name
...        self.location = location
... 
>>> rabbit = Animal("Rabbit", "Grasslands")
>>> rabbit.name
'Rabbit'
>>> rabbit.location
'Grasslands'
>>>

Try out Noml!
Crispydogs101
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

__Falcon-Games__ wrote:

Crispydogs101 wrote:

How does the value term work in python?
This is for kids so of course it's drastically simplified but in Python to have “values”, you use self.valuename like this.
>>> class Animal:
...    def __init__(self, name, location):
...        self.name = name
...        self.location = location
... 
>>> rabbit = Animal("Rabbit", "Grasslands")
>>> rabbit.name
'Rabbit'
>>> rabbit.location
'Grasslands'
>>>
Good to know. Maybe support so kids can know how the value structure works in coding.

Hey! Look at this DTA!
Hej! My username is @Crispydogs101. I like listening to music, playing games, and more!
Sarah and duck, Pete the cat, Pegboard nerds, Tokyo machine, FORZA FAN!! Be High contrast Blue Be rich
WindowsMeRules2000
Scratcher
500+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

__Falcon-Games__ wrote:

Scratch is a good language for absolute beginner kid programmers but I think that this suggestion could be implemented to make it easier for those kids when they transition from Scratch to a text-based programming language like Python or Javascript.

It is adding structures to Scratch, let me explain. There will be a new section, Structures, here you'll be able to add structures. There will be an Add Structure button to add one. A structure will be able to contain named attributes, for example an animal structure could contain the name of the animal and where the animal lives.
structure [animal] :: looks hat
value [name] :: looks
value [location] :: looks
You will now be able to create instances of structures via dragging the block for the structure from the Structures section.
create instance of  [animal v] with values [Rabbit] [grasslands] named [rabbit] :: looks
This will have a new type of a variable, instances, these variables will have nested values which you will be able to access.
< value [name v] of [rabbit v] :: looks >
Basically these are simpler to understand for kids version of classes, they will be a big help in making complex projects with complex objects that could now be represented with structures, for example you could represent enemy data with structures.
structure [enemy] :: looks hat
value [id] :: looks
value [health] :: looks
For projects that have a lot of different type of data and a lot of objects like big games for example with tons of enemies, it would make their code way more cleaner. This would also help kids transition from block-based programming to text-based programming. You might be asking though, will a eight year old understand this?. It is a more complex concept so it might take them a while for them to get to the stage of understanding it but it can be summed up simply through “you have these variables, now you can create containers that can have multiple variables”, It's usefulness in creating big projects outweighs it's challenges to learn for eight year olds and it's difficulty to implement. It might be a bit difficult but it's similar to lists but with named values, so some code from lists could be copied. At the end of the day I truly think that this feature will be very useful for the Scratch community to a point that exceeds it's difficulty to learn and implement. What I have put in this post is just an example of how it could be implemented, it could be made more simpler or could be made to use less sections, basically it could be adapted to how the ST will think it will be understandable for kids and will be useful for the Scratch community but the basic idea is that structures will be easier to understand and overall simpler versions of classes that could hold multiple named variables and could have instances of them made.
This is literally just lists, no support

Having trouble with My Stuff, or profile comments? Discuss the issues here: https://scratch.mit.edu/discuss/topic/727967/
Hello, I’m WindowsMeRules2000. I am mainly active on Questions about Scratch, Help with Scripts, Suggestions, and Bugs and Glitches, and I often reply to posts with zero responses. I like Love Live! and Doki Doki Literature Club. Follow me so I can get to 2K!

I apologise but my signature (and now yours) has the Social Virus and cannot appear in public. If you have seen this social experiment and want to join in, simply replace your signature (or a line of your signature) with this.

(๑\>◡\<๑ :: sensing) // This is Sayori, she spreads positive vibes
(¬_¬ :: #ffc2fd) // This is Natsuki, she prevents dupe suggestions and identifies rejected suggestions
(ーー; :: looks) // This is Yuri, she answers questions in the QaS forum
(:\) :: pen) // This is Monika, she helps people in the Help with Scripts forum

CST1229
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

WindowsMeRules2000 wrote:

(#6)
This is literally just lists, no support
Lists are inconvienient for working with anything that has multiple instances of it or has named indexes (especially since Scratch also doesn't have custom reporters or temporary variables).

Last edited by CST1229 (Aug. 28, 2023 15:25:13)


This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023



WindowsMeRules2000
Scratcher
500+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

CST1229 wrote:

WindowsMeRules2000 wrote:

(#6)
This is literally just lists, no support
Lists are inconvienient for working with anything that has multiple instances of it or has named indexes (especially since Scratch also doesn't have custom reporters or temporary variables).
Then just make another list with indexes

Having trouble with My Stuff, or profile comments? Discuss the issues here: https://scratch.mit.edu/discuss/topic/727967/
Hello, I’m WindowsMeRules2000. I am mainly active on Questions about Scratch, Help with Scripts, Suggestions, and Bugs and Glitches, and I often reply to posts with zero responses. I like Love Live! and Doki Doki Literature Club. Follow me so I can get to 2K!

I apologise but my signature (and now yours) has the Social Virus and cannot appear in public. If you have seen this social experiment and want to join in, simply replace your signature (or a line of your signature) with this.

(๑\>◡\<๑ :: sensing) // This is Sayori, she spreads positive vibes
(¬_¬ :: #ffc2fd) // This is Natsuki, she prevents dupe suggestions and identifies rejected suggestions
(ーー; :: looks) // This is Yuri, she answers questions in the QaS forum
(:\) :: pen) // This is Monika, she helps people in the Help with Scripts forum

__Falcon-Games__
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

WindowsMeRules2000 wrote:

CST1229 wrote:

WindowsMeRules2000 wrote:

(#6)
This is literally just lists, no support
Lists are inconvienient for working with anything that has multiple instances of it or has named indexes (especially since Scratch also doesn't have custom reporters or temporary variables).
Then just make another list with indexes
That doesn't solve the multiple instances issue and that will get pretty ugly pretty quick also you'll need to implement a lot of custom blocks and logic for those to work.

Try out Noml!
__Falcon-Games__
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

going to bump this to the top.

Try out Noml!
blablablahello
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

Isn't this basically object oriented programming? Pretty sure scratch is already object oriented due to the existance of sprites, clones, and local variables? I dont see how this would add anything to scratch except maybe a different way of understanding class, as they dont provide any new functionality (I guess you could use these to make easier stamp clones, but when you're using stamps as clones, you should be advanced enough to make systems like this without a specific inbuilt one)

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




Taro--Sasaki
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

This would've helped me so good before I started OOP. Support. My only drawback is the comple-

Edit: nvm, my drawback was dumb.

Last edited by Taro--Sasaki (Aug. 28, 2023 22:07:25)


rec room on top
gimme gifts
CST1229
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

blablablahello wrote:

(#11)
Isn't this basically object oriented programming? Pretty sure scratch is already object oriented due to the existance of sprites, clones, and local variables? I dont see how this would add anything to scratch except maybe a different way of understanding class, as they dont provide any new functionality (I guess you could use these to make easier stamp clones, but when you're using stamps as clones, you should be advanced enough to make systems like this without a specific inbuilt one)
The thing with clones is that it's hard to access variables from other clones (you could use a list that clones put their variables into, but you could just not use clones altogether at that point), as the `of` block only accesses the original sprite.

This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023



__Falcon-Games__
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

Surprisingly, this is getting support. One thing I will add to this is that there should probably be a way to nest structures because it makes sense that containers can have containers that have containers and so on because the kids probably know from the physical world that things can nest and that would actually help a thousand times more with complex projects. Like if you could do this:
< [habitat v] of < [animal v] of [myrabbit v] :: looks > :: looks >
Maybe this is too complex though, I am not really sure.

Last edited by __Falcon-Games__ (Aug. 29, 2023 08:12:36)


Try out Noml!
__Falcon-Games__
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

bumpy dumpy humpy.

Try out Noml!
cookieclickerer33
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

blablablahello wrote:

Isn't this basically object oriented programming? Pretty sure scratch is already object oriented due to the existance of sprites, clones, and local variables? I dont see how this would add anything to scratch except maybe a different way of understanding class, as they dont provide any new functionality (I guess you could use these to make easier stamp clones, but when you're using stamps as clones, you should be advanced enough to make systems like this without a specific inbuilt one)
Not really

Object oriented programming from what I know is having multiple sprites and one main script that controls those sprites

In scratch each sprite has its own script and the 2 cannot command eachother programatically apart from broadcasts, but those are just entirely Un ideal

⠀ ⠀ I beat Mario 64 yay! ⠀⠀ ⠀ ⠀ ⠀ ⠀ I love you ivy & may :3
⠀ ⠀ ⠀ ⠀ ⠀ ⠀⠀ ⠀ ⠀GEOMETRY DASH

blablablahello
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

cookieclickerer33 wrote:

snip-
Not really

Object oriented programming from what I know is having multiple sprites and one main script that controls those sprites

In scratch each sprite has its own script and the 2 cannot command eachother programatically apart from broadcasts, but those are just entirely Un ideal
True, but they're similar enough due to the “when I start as a clone” header.

CST1229 wrote:

snip-
The thing with clones is that it's hard to access variables from other clones (you could use a list that clones put their variables into, but you could just not use clones altogether at that point), as the `of` block only accesses the original sprite.

Indeed that is an issue, however, it would be more easily solved via the other suggestion about allowing accessing variables of clones and stuff (which also comes with naming clones)

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




cookieclickerer33
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

blablablahello wrote:

cookieclickerer33 wrote:

snip-
Not really

Object oriented programming from what I know is having multiple sprites and one main script that controls those sprites

In scratch each sprite has its own script and the 2 cannot command eachother programatically apart from broadcasts, but those are just entirely Un ideal
True, but they're similar enough due to the “when I start as a clone” header.

CST1229 wrote:

snip-
The thing with clones is that it's hard to access variables from other clones (you could use a list that clones put their variables into, but you could just not use clones altogether at that point), as the `of` block only accesses the original sprite.

Indeed that is an issue, however, it would be more easily solved via the other suggestion about allowing accessing variables of clones and stuff (which also comes with naming clones)
I think at this point it would be easier to switch over to an entirely different language then have st add this and need to learn it

⠀ ⠀ I beat Mario 64 yay! ⠀⠀ ⠀ ⠀ ⠀ ⠀ I love you ivy & may :3
⠀ ⠀ ⠀ ⠀ ⠀ ⠀⠀ ⠀ ⠀GEOMETRY DASH

blablablahello
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

cookieclickerer33 wrote:

snip-
I think at this point it would be easier to switch over to an entirely different language then have st add this and need to learn it
Agreed. My main point is that although this suggestion might be slightly helpful, it overlaps with too much of clones and local variables to be worth it to add. If people really wanted/needed this, editing clones would be a better choice

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




__Falcon-Games__
Scratcher
1000+ posts

Adding Structures To Scratch (READ ENTIRE OP BEFORE REPLYING!)

blablablahello wrote:

cookieclickerer33 wrote:

snip-
I think at this point it would be easier to switch over to an entirely different language then have st add this and need to learn it
Agreed. My main point is that although this suggestion might be slightly helpful, it overlaps with too much of clones and local variables to be worth it to add. If people really wanted/needed this, editing clones would be a better choice
Another point comes though, that would make kids adapt to other programming languages really hard. They would be used to using this alternative method and they might implement some stuff in not recommended ways, yes it's already hard for kids to adapt to text-based programming but blocks map to functions easily like say maps to print and so on, the main issue is that more broader concepts like modules or classes kids don't understand. This would make that way easier and would strengthen that understanding also see this which could also make this very useful:

__Falcon-Games__ wrote:

Surprisingly, this is getting support. One thing I will add to this is that there should probably be a way to nest structures because it makes sense that containers can have containers that have containers and so on because the kids probably know from the physical world that things can nest and that would actually help a thousand times more with complex projects. Like if you could do this:
< [habitat v] of < [animal v] of [myrabbit v] :: looks > :: looks >
Maybe this is too complex though, I am not really sure.

Try out Noml!

Powered by DjangoBB