Discuss Scratch

-stache-
Scratcher
500+ posts

Code Scratch in Text

NoxSpooth wrote:

-stache- wrote:

Scratch is to help people to get rid of their fears of programming by making things big chunky and colorful.
And why couldn't it be able to do that with text-based programming as well?
Because scratch was not designed to be a text-based language… A text-based language just wouldn't work…

What'd it do if you tried to “compile”
1^2-1+6
?
Would it follow the order of operations like “(1^2)-(1+6)” which few beginners understand, or something like “((1^2)-1)+6”? Also, would it just be like
say (theanswertotheequation)
or would it do nothing?
NoxSpooth
Scratcher
1000+ posts

Code Scratch in Text

BookOwl wrote:

I think that @-stache-'s point was that if you are willing to learn text based scratch, just go ahead and learn a “real” text based language like Python or JS, which are both much more powerful than Scratch.
“Why use X when you can use Y, which is way more powerful?”

I don't necessarily agree with that statement because it can already be used against Scratch in general. If other programming languages are more powerful and already easy to use, according to -stache-, then why bother using Scratch at all?

The thing is, it's meant to introduce people to the programming environment. How would it be harmful in any way to assist younglings with the text-based environment as well?
-stache-
Scratcher
500+ posts

Code Scratch in Text

NoxSpooth wrote:

BookOwl wrote:

I think that @-stache-'s point was that if you are willing to learn text based scratch, just go ahead and learn a “real” text based language like Python or JS, which are both much more powerful than Scratch.
“Why use X when you can use Y, which is way more powerful?”

I don't necessarily agree with that statement because it can already be used against Scratch in general. If other programming languages are more powerful and already easy to use, according to -stache-, then why bother using Scratch at all?

The thing is, it's meant to introduce people to the programming environment. How would it be harmful in any way to assist younglings with the text-based environment as well?
lol younglings
Because scratch already pushes people into bad programming habits.
For example,
switch(value) {
case "thisvalue":
dostuff...
break;
case "thatvalue"
dootherstuff...
break;
}
will be translated to
if <(value) = [thisvalue]> then 
dostuff...
else
if <(value) = [thatvalue]> then
dostuff...
end
end
by most scratchers who don't know better, and this can be dramatically slower than the thing that JS already gives you because the scratch version is in O(n) time while the JS version is optimized.
NoxSpooth
Scratcher
1000+ posts

Code Scratch in Text

Point taken. I still believe this would be a great idea, though. So maybe we could do something to optimize Scratch in some sort.
-stache-
Scratcher
500+ posts

Code Scratch in Text

NoxSpooth wrote:

Point taken. I still believe this would be a great idea, though. So maybe we could do something to optimize Scratch in some sort.
FYI I am working on making a scheme-like language to help kids learn, while having features like lambda, hash tables, and much more!

The benefits of teaching with text-based languages is that you have access to everything, while you don't necessarily have to know about them and be afraid of them.
Jonathan50
Scratcher
1000+ posts

Code Scratch in Text

-stache- wrote:

by most scratchers who don't know better, and this can be dramatically slower than the thing that JS already gives you because the scratch version is in O(n) time while the JS version is optimized.
I understand nothing about big O, but isn't that better than O(n)? I think it would be O(n) if it was like
if <(value) = [thisvalue]> then
dostuff...
end
if <(value) = [thatvalue]> then
dostuff...
end
I think the biggest problem with nesting IF THEN ELSEs is it's unreadable.

Last edited by Jonathan50 (Sept. 28, 2016 21:06:02)

-stache-
Scratcher
500+ posts

Code Scratch in Text

Jonathan50 wrote:

-stache- wrote:

by most scratchers who don't know better, and this can be dramatically slower than the thing that JS already gives you because the scratch version is in O(n) time while the JS version is optimized.
I understand nothing about big O, but isn't that better than O(n)? I think it would be O(n) if it was like
if <(value) = [thisvalue]> then
dostuff...
end
if <(value) = [thatvalue]> then
dostuff...
end
I think the biggest problem with nesting IF THEN ELSEs is it's unreadable.
Oh yeah… It is O(log2(n))…

The best way is using jump tables …
banana439monkey
Scratcher
1000+ posts

Code Scratch in Text

Duplicate https://scratch-mit-edu.ezproxyberklee.flo.org/discuss/topic/232783/?page=1#post-2367267 (and by the way, even though it's a newer topic, it was reposted after one older than this)

Banana

EDIT: Whoops.

Last edited by banana439monkey (Jan. 27, 2017 18:58:22)

PAPERKING
Scratcher
72 posts

Code Scratch in Text

if you're saying scripts instead of blocks, then im pretty sure scratch would lose its simplicity.
pixelFlow
Scratcher
100+ posts

Code Scratch in Text

>>> https://tosh.tjvr.org <<< Thanks!
Pezd
Scratcher
100+ posts

Code Scratch in Text

I think it would make the transition from programming in scratch to doing other text-based programming easier.
SuperDoom
Scratcher
1000+ posts

Code Scratch in Text

100% support.
This needs to happen, and while tosh seems like the right thing, it doesn't convert the blocks into JavaScript/6502/C#/anything useful (I don't think).


Also, I tried that as its own project: Scritch!
cs115088
New Scratcher
1 post

Code Scratch in Text

scratch should have both typed and blocks
Botcho_Otkho
Scratcher
1000+ posts

Code Scratch in Text

No support. If you want a text code,just move to another programming language.
MrCrazy455
Scratcher
2 posts

Code Scratch in Text

It doesn't matter the age of the people that do this, for the ones that want to convert scratch blocks to, say, Java or Python, there should be an option. I would personally like this, for I have my reasons.
when green flag clicked
forever
if <key [ space] pressed> then
think [SLOOOOOOOW DOOOOOWN] for (2) secs
end
end

Last edited by MrCrazy455 (Sept. 19, 2017 04:03:27)

DaEpikDude
Scratcher
1000+ posts

Code Scratch in Text

MrCrazy455 wrote:

It doesn't matter the age of the people that do this, for the ones that want to convert scratch blocks to, say, Java or Python, there should be an option. I would personally like this, for I have my reasons.
when green flag clicked
forever
if <key [ space] pressed> then
think [SLOOOOOOOW DOOOOOWN] for (2) secs
end
end
1: Don't blockspam.
2: There are lots of things in Scratch that just don't convert well to other languages (for example, Python: how would the project draw sprites? How would it know to import time for time.sleep if there was a wait block? etc). Plus, if someone wanted to code in another language, shouldn't they be learning that other language?
No support for reasons stated above.
Sean222
Scratcher
12 posts

Code Scratch in Text

You can use the same method used for hacking scratch blocks; opening it with a zip opener and editing the project.json.
Charles12310
Scratcher
1000+ posts

Code Scratch in Text

Support. Since we can't convert Scratch to other programming languages, I think it's good what Scratch should have their own text-language. There should be an option and should be for advanced (no not advanced commands but a more advanced appearance for scripts) (or not) such as:
onGreenFlagClick [
forever [
if votes > 9 then
sprite.say(“About 10 votes! Awesome!”)
else
sprite.say(“Keep it up!”)
end]
end]

def script change position by x: (var x) y: (var y) [
sprite.xPosition = sprite.xPosition + x
sprite.yPosition = sprite.yPosition + y
end]

onReceive(“Stop all”) [
sprite.stop.otherscripts
end]

onGreenFlagClick [
var.local.allsprites = timer1
sprite.timer.reset
forever [
timer = sprite.timer + 0.1
end]

def boolean stopSignclick [
return sprite.timer > sprite.vars.timer

This is just an example. If you want it simple then that is fine.
I-Iz-A-Litten
Scratcher
1000+ posts

Code Scratch in Text

no support, Scratch is supposed to be four 7 year-olds, this isn't Unity

Last edited by I-Iz-A-Litten (Nov. 14, 2017 02:17:46)

I-Iz-A-Litten
Scratcher
1000+ posts

Code Scratch in Text

Foxisdaily wrote:

_Comicfan_ wrote:

No support. Scratch is made up of younger kids, and you thing 6 and 5 years old can do it?
True but there are older kids to and it is a good idea to have a Choice between block coding and the ability to type it as well



there are other programs for that

Powered by DjangoBB