Discuss Scratch

mybearworld
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

PLEASE READ THE WHOLE POST BEFORE REPLYING.
Note that this is not rejected, as said by Za-Chary, here


These are Scratch's blocks:
when gf clicked
say [Hello!]
if <touching [mouse pointer v]?> then
change [color v] effect by (25)
else
think [Nothing happens] for (2) secs
But in a text-based language, it would look different, like this:
self.say("Hello")
if self.touching("mouse"):
    self.effects["color"] += 25
else:
    self.think("Nothing happens", secs=2)
While text based programming is rejected (§2.2), there could be a mode called “PYMode” where blocks would still be dragged and dropped, but the blocks would be more like a text-based language:
when @greenFlag clicked // This can remain as-is.
self.say\("[Hello]"\) :: looks
if <self.touching\([mouse v]\) :: sensing>: {
self.effects\[[color v]\] += (25) :: looks
} else: {
self.think\("[Nothing happens]"\, secs=(2)) :: looks
} :: control
This could be integrated into the “Theme” section in the navigation bar.

Related:

Note
If you want to include these blocks in your post, you'll need to escape certain characters.
self.say("[Hello, world]") :: looks //  self.say("[Hello, world]") :: looks
self.say\("[Hello, world!]"\) :: looks // self.say\("[Hello, world!]"\) :: looks

12/04/2024 - Made the post less terrible
17/12/2020 - Added the change * and / to × or ⋅ and ÷ suggestion Thanks PkmnQ
29/11/2020 - Little update Thanks sportfan9998!
29/11/2020 - Added Za-Chary's post stating that this is not rejected.
29/11/2020 - Renamed Word Mode to PYMode, and added “self” to the blocks Thanks Maximouse!
29/11/2020 - Created the topic

Last edited by mybearworld (April 12, 2024 13:59:31)

Maximouse
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

This would be a better idea if it was based on a particular programming language.

For example, if it was JavaScript:
when flag clicked
this.say\([Hello]\) :: looks
if \(<this.touching\([mousePointer v]\) :: sensing>\) \{{
this.effects.[color v] += (25) :: looks
}\} else \{{
this.thinkSecs\([Nothing happens], (2)\) :: looks
}\} :: control

Or Python:
when flag clicked
self.say\([Hello]\) :: looks
if <self.touching\([mouse_pointer v]\) :: sensing>: {
self.effects.[color v] += (25) :: looks
} else: {
self.think\([Nothing happens], secs=(2)\) :: looks
} :: control

“This” or “self” means “this sprite”.

Edit: And, of course, it should be named “JavaaScript mode” or “Python mode”, not “Word mode” (which is confusing).

Last edited by Maximouse (Nov. 29, 2020 12:34:42)

mybearworld
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

Maximouse wrote:

This would be a better idea if it was based on a particular programming language.

For example, if it was JavaScript:
when flag clicked
this.say\([Hello]\) :: looks
if \(<this.touching\([mousePointer v]\) :: sensing>\) \{{
this.effects.[color v] += (25) :: looks
}\} else \{{
this.thinkSecs\([Nothing happens], (2)\) :: looks
}\} :: control

Or Python:
when flag clicked
self.say\([Hello]\) :: looks
if <self.touching\([mouse_pointer v]\) :: sensing>: {
self.effects.[color v] += (25) :: looks
} else: {
self.think\([Nothing happens], secs=(2)\) :: looks
} :: control

“This” or “self” means “this sprite”.

Edit: And, of course, it should be named “JavaaScript mode” or “Python mode”, not “Word mode” (which is confusing).
I based my suggestion on Python.
I like the “self” idea, and rename it PYMode maybe?
Maximouse
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

mybearworld wrote:

I like the “self” idea, and rename it PYMode maybe?
That would work as a name too. “Self” is used in object oriented programming to refer to the current instance of a class.
mybearworld
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

Maximouse wrote:

mybearworld wrote:

I like the “self” idea, and rename it PYMode maybe?
That would work as a name too. “Self” is used in object oriented programming to refer to the current instance of a class.
I know about “self”, I just didn't think of using it
I edited the post now to include your ideas.
SausageMcSauce
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

I am leaning to no support. This might not be necessary and it would be easier for children to use blocks named in normal languages rather than one similar to a real programming language.

Also, Scratchers who do not speak English might get confused as programming language keywords are usually never translated into other languages. Scratch could do that, but it would seem unrealistic towards text-based programming languages to do that.
Vibrato
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

SausageMcSauce wrote:

I am leaning to no support. This might not be necessary and it would be easier for children to use blocks named in normal languages rather than one similar to a real programming language.

Also, Scratchers who do not speak English might get confused as programming language keywords are usually never translated into other languages. Scratch could do that, but it would seem unrealistic towards text-based programming languages to do that.
Linguistic languages are indeed easier to learn than programming languages when you're just starting out, but I get the feeling that this mode will be a toggle for more experienced programmers that can handle it. It may even make it easier for them.
Maximouse
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

SausageMcSauce wrote:

I am leaning to no support. This might not be necessary and it would be easier for children to use blocks named in normal languages rather than one similar to a real programming language.
This would be optional, and would be helpful for people who want to learn a text-based programming language.
Za-Chary
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

I'll be honest, this looks cool. Somewhat unnecessary, but it's still cool.

I'm also here to confirm that this is not rejected (before anyone tries saying otherwise).
mybearworld
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

Za-Chary wrote:

I'll be honest, this looks cool. Somewhat unnecessary, but it's still cool.

I'm also here to confirm that this is not rejected (before anyone tries saying otherwise).

Back to the OP

Last edited by mybearworld (Nov. 29, 2020 15:10:46)

sportfan999
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

As someone who is looking into Python, this is an interesting suggestion.

I think it looks just a little strange, seeing brackets, parentheses, periods, and whatnot on the Scratchblocks.
Also, how this would be implemented? Would it be a seperate button to toggle this, or would it be in the “Languages” section of the editor?
There are some uses in this, though, especially people who use text-based languages and Scratch.

If we are going to make this a ballot box, I guess you can put me as Semi-Support.
mybearworld
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

sportfan999 wrote:

I think it looks just a little strange, seeing brackets, parentheses, periods, and whatnot on the Scratchblocks.
It actually is, but I guess you could get used to it.

sportfan999 wrote:

Would it be a seperate button to toggle this, or would it be in the “Languages” section of the editor?
Maybe in account settings?

sportfan999 wrote:

There are some uses in this, though, especially people who use text-based languages and Scratch..
So me
mybearworld
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

sportfan999 wrote:

or would it be in the “Languages” section of the editor?
I think this is the best idea.

In 2.0 offline editor, you can actually select your own .po files
I made a py.po that looks like python, but it doesn't work on 3.0
secretagent123
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

Support this would be better for programmers with more experaince.
mybearworld
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

Bump!
chrdagos
Scratcher
500+ posts

"PYMode" [READ FULL POST]

this seems unnecessary.
mybearworld
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

chrdagos wrote:

this seems unnecessary.
It is quite useful for experienced programmers.
Maximouse
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

mybearworld wrote:

chrdagos wrote:

this seems unnecessary.
It is quite useful for experienced programmers.
I don't actually think experienced programmers would use this, but people learning Python probably would.

And a question: would lists use zero-based indexing in this mode? Because a block that looks like this:
([list v]\[(1)\] :: list)
and uses one-based indexing could confuse users.

Edit: or the block could be
([list v]\[(1) - 1\] :: list)

Last edited by Maximouse (Dec. 17, 2020 15:02:50)

PkmnQ
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

I think there should be an extra toggle.
mybearworld
Scratcher
1000+ posts

"PYMode" [READ FULL POST]

Maximouse wrote:

And a question: would lists use zero-based indexing in this mode? Because a block that looks like this:
([list v]\[(1)\] :: list)
and uses one-based indexing could confuse users.

Edit: or the block could be
([list v]\[(1) - 1\] :: list)
That's a great point.
I don't think the last one should be used..
Maybe if you drag one out the first time, it will open a little window telling you about it.

Powered by DjangoBB