This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-12-12 16:06:22

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

A new way to program in scratch!

It will be a text based scratch. blocks will be replaced by text, but if you open a scratch text project in the regular scratch, the text can be converted into blocks.

A simple ball script:

blocks:
http://i.imgur.com/8dVGW.gif

text:

/when flag clicked\
[forever]
[move (10) steps]
[if on edge bounce]
[if <touching [edge]?> ]
[turn right (pick random (-10) to (10)) degrees]
[/if]
[/forever]

this might be better for slower computers, to script. the text based scratch will also have a stage, sprites, open/save/save as... just no blocks, just text.

Last edited by owetre18 (2010-12-12 16:06:57)

Offline

 

#2 2010-12-12 16:32:00

NeoAtVic
Scratcher
Registered: 2010-10-04
Posts: 67

Re: A new way to program in scratch!

You'd also need a place for variable declaration etc...

Also would you want to keep the same sprite interface as the one that already exists? because to me scratch is the type of programming that is easy to visualize as it is all up in the box up the top right  smile

I do think text based for some people is a good thing, for those that have slower computers or even for people that just prefer to type  smile

Just my thoughts on this idea  smile


http://farm3.static.flickr.com/2796/4519763712_5fab3a6935_o.png

Offline

 

#3 2010-12-12 16:49:39

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: A new way to program in scratch!

I wrote:

same as scratch, but not blocks, just text

Last edited by owetre18 (2010-12-12 16:49:54)

Offline

 

#4 2010-12-12 18:15:06

ESN
New Scratcher
Registered: 2010-12-03
Posts: 100+

Re: A new way to program in scratch!

Well, Scratch was designed for drag-and-drop simplicity for new programmers.

I guess there could be a text function, but it'd be a lot of unnecessary programming.


http://is.gd/jZ5chhttp://is.gd/jZhXDhttp://is.gd/jZhU7

Offline

 

#5 2010-12-12 18:22:44

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: A new way to program in scratch!

It should be like you can type in the first part, and i'll give you the choices. like if i said:
go to
it would give me:
go to x: y:
go to [mouse]

and so you wouldn't have to go back and forth between the categories.

Offline

 

#6 2010-12-13 08:07:23

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: A new way to program in scratch!

Me and MathWizz are going to do this!

Offline

 

#7 2010-12-13 16:09:35

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: A new way to program in scratch!

ProgrammingFreak wrote:

Me and MathWizz are going to do this!

thanks, it was just a suggestion. or an idea. I have no clue how to do stuff like that.

Offline

 

#8 2010-12-13 16:34:58

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: A new way to program in scratch!

I would suggest two things:

/when green flag clicked\ is unecessarily long and complicated to type. Define hats using a colon ( smile  like a script head in many scripting languages so example could be

when flag:
when "space" pressed

use speech marks to refer to arguments in a block:

repeat ( ) = repeat "10"

unless you are naming a variable (including existing, in-game variables)

repeat variable

repeat xposition

make variables a naming function at the top of a script.

var=variable name

smile


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#9 2010-12-13 16:50:41

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: A new way to program in scratch!

sparks wrote:

I would suggest two things:

/when green flag clicked\ is unecessarily long and complicated to type. Define hats using a colon ( smile  like a script head in many scripting languages so example could be

when flag:
when "space" pressed

use speech marks to refer to arguments in a block:

repeat ( ) = repeat "10"

unless you are naming a variable (including existing, in-game variables)

repeat variable

repeat xposition

make variables a naming function at the top of a script.

var=variable name

smile

well, I wouldn't know other languages, cuz I don't use any others. (except scratch and some mods)

Offline

 

#10 2010-12-13 18:17:00

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: A new way to program in scratch!

I say make a completely text-based Scratch. XD
You can use sprite decelerations at the top!

And you can have like little mini-pages for each Sprite and Stage. XD
And it would all translate into Scratch via a reader. XD

__________

I abused the XD! XD
lol


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#11 2010-12-13 22:50:17

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: A new way to program in scratch!

Code:

start {
forever {
point towards [Mouse]
if <<Mouse Down> == 'True'> { move 5 } else { move -5 }
}}

Makes the cat point towards the mouse and move towards it ( the "new" Hello world! program  tongue  ) or if you press the Mouse Left Key, it will move away from the mouse.

Offline

 

#12 2010-12-14 18:52:56

windows-vista
Scratcher
Registered: 2010-11-12
Posts: 4

Re: A new way to program in scratch!

NeoAtVic wrote:

You'd also need a place for variable declaration etc...

Also would you want to keep the same sprite interface as the one that already exists? because to me scratch is the type of programming that is easy to visualize as it is all up in the box up the top right  smile

I do think text based for some people is a good thing, for those that have slower computers or even for people that just prefer to type  smile ,But scratch is meant to be much simpler than text.

Just my thoughts on this idea  smile

Offline

 

#13 2011-07-09 10:00:49

poemon1
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: A new way to program in scratch!

where do i type the text, i want 2 try it


http://i47.tinypic.com/rrqe13.gif

Offline

 

#14 2011-07-10 04:57:36

ZeroLuck
Scratcher
Registered: 2010-02-23
Posts: 500+

Re: A new way to program in scratch!

Hey
I can help to program something like that in Java.


http://3.bp.blogspot.com/-oL2Atzp0Byw/T465vIQ36dI/AAAAAAAAADo/1vqL4PvhkM0/s1600/scratchdachwiki.png

Offline

 

#15 2011-07-10 21:12:15

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: A new way to program in scratch!

poemon1 wrote:

where do i type the text, i want 2 try it

oh, it's just an idea. so far, you can't

Offline

 

#16 2011-07-10 21:13:15

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: A new way to program in scratch!

ZeroLuck wrote:

Hey
I can help to program something like that in Java.

Awesome! This is very old. Maybe we shouldn't do this.

Offline

 

#17 2011-07-10 22:49:42

poemon1
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: A new way to program in scratch!

owetre18 wrote:

poemon1 wrote:

where do i type the text, i want 2 try it

oh, it's just an idea. so far, you can't

oh


http://i47.tinypic.com/rrqe13.gif

Offline

 

#18 2011-07-11 08:44:30

whizzer
Scratcher
Registered: 2008-05-27
Posts: 500+

Re: A new way to program in scratch!

We could make it a bit like C:

onFlag();
onKey(space);
onClick();
onRecieve(message);

for the hat blocks, then things like:

goFor(10)
addX(10)
addY(10)
send(message)
sendWait(message)
speech(Hello!, 2)
speechForever(Hello!)
thought(Hmm..., 2)
thoughtForever(Hmm...)


http://i46.tinypic.com/33df6me.png I'm whizzer0 for all things Minecraft.

Offline

 

#19 2011-07-11 10:52:29

parcheesidude
Scratcher
Registered: 2009-10-07
Posts: 500+

Re: A new way to program in scratch!

I like owetre18's idea for this... and maybe if you could, add mesh blocks.


My signature is trying to find itself :3

Offline

 

#20 2011-07-11 13:23:26

ZeroLuck
Scratcher
Registered: 2010-02-23
Posts: 500+

Re: A new way to program in scratch!

I already started to program somethig like that!
The code highlighter works alredy  big_smile


http://3.bp.blogspot.com/-oL2Atzp0Byw/T465vIQ36dI/AAAAAAAAADo/1vqL4PvhkM0/s1600/scratchdachwiki.png

Offline

 

#21 2011-07-11 15:29:48

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: A new way to program in scratch!

ZeroLuck wrote:

I already started to program somethig like that!
The code highlighter works alredy  big_smile

Cool! What's it called?

Offline

 

#22 2011-07-12 10:19:23

ZeroLuck
Scratcher
Registered: 2010-02-23
Posts: 500+

Re: A new way to program in scratch!

I have no idea how to call it  big_smile
ScratchText?  hmm


http://3.bp.blogspot.com/-oL2Atzp0Byw/T465vIQ36dI/AAAAAAAAADo/1vqL4PvhkM0/s1600/scratchdachwiki.png

Offline

 

#23 2011-07-12 10:26:25

ZeroLuck
Scratcher
Registered: 2010-02-23
Posts: 500+

Re: A new way to program in scratch!

What do you think about that?

<Sprites>
   Sprite1 = "C:/MyPicture1.png";
   Sprite2 = "C:/MyPicture2.png";
</Sprites>

function onStart(){
    Sprite1.setX(399);
    Sprite1.setVisible(true);
    Sprite1.sav("Hello");
    if(Sprite2.touchs(Sprite1)){
          Sprite2.say( "I'm touching Sprite1" );
    }
}
function onKey(char k){
    if(k == 'A'){
        Sprite1.say( "Key 'A' pressed" );
    }
}


http://3.bp.blogspot.com/-oL2Atzp0Byw/T465vIQ36dI/AAAAAAAAADo/1vqL4PvhkM0/s1600/scratchdachwiki.png

Offline

 

#24 2011-07-12 11:57:13

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: A new way to program in scratch!

ZeroLuck wrote:

What do you think about that?

<Sprites>
   Sprite1 = "C:/MyPicture1.png";
   Sprite2 = "C:/MyPicture2.png";
</Sprites>

function onStart(){
    Sprite1.setX(399);
    Sprite1.setVisible(true);
    Sprite1.sav("Hello");
    if(Sprite2.touchs(Sprite1)){
          Sprite2.say( "I'm touching Sprite1" );
    }
}
function onKey(char k){
    if(k == 'A'){
        Sprite1.say( "Key 'A' pressed" );
    }
}

A bit complicated... anyone remember Jens XML import/export block thing? I fixed it and can send the new code for 1.4 to you when I am off vacation, but anyways, look at how it saves the XML, see how neat and simple it looks? THAT is how this should be.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#25 2011-07-12 13:52:57

ZeroLuck
Scratcher
Registered: 2010-02-23
Posts: 500+

Re: A new way to program in scratch!

Pecola1 wrote:

A bit complicated... anyone remember Jens XML import/export block thing? I fixed it and can send the new code for 1.4 to you when I am off vacation, but anyways, look at how it saves the XML, see how neat and simple it looks? THAT is how this should be.

Thats cool!
If this works i'll try to program my own Scratch project runner!

Pecola1 wrote:

I fixed it and can send the new code for 1.4 to you when I am off vacation

Thanks!

Last edited by ZeroLuck (2011-07-12 14:08:09)


http://3.bp.blogspot.com/-oL2Atzp0Byw/T465vIQ36dI/AAAAAAAAADo/1vqL4PvhkM0/s1600/scratchdachwiki.png

Offline

 

Board footer