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

#1 2009-08-27 19:32:22

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Text-Based Scratch

Text-based Scratch. This is how I think it might look.

http://img190.imageshack.us/img190/6416/txtbsedscrch.png

List of Commands

Code:

>"hat" blocks<
^loop blocks^
[command blocks]
(reporter blocks)
<boolean blocks>

Code:

-Motion-

[move( )steps] 
[turn( )degrees]

[pointInDirection( )]
[pointTowards"    "]

[goToX( )Y( )]
[goTo"    "]
[glide( )secsToX( )Y( )]

[changeXby( )]
[setXto( )]
[changeYby( )]
[setYto( )]

[ifOnEdgeBounce]

(Xposition)
(Yposition)
(direction) 

-Control-

>whenFlagClicked<
>when"    "keyPressed<
>when"SpriteName"clicked<

[wait( )secs]

^forever^    (add ^endLoop^ at the end of all loops)
^repeat( )^

[broadcast"    "]
[broadcast"    "andWait]

>whenIrecieve"    "<

^foreverIf< >^
^if < >^
^if< > else^

[waitUntil< >]
^repeatUntil < >^

[stopScript]
[stopAll]


-looks-

[switchToCostume"    "]
[nextCostume]
(costume#)

[say"    "for( )secs]
[say"    "]
[think"    "for( )secs]
[think"    "]

[change"    "effectBy( )]
[set"    "effectTo( )]
[clearGraphicEffects]

[changeSizeBy( )]
[setSizeTo( )]
(size)

[show]
[hide]

[goToFront]
[goBack( )layers]


-sensing-

<touching"    ">
<touchingColor[#:#]>        (colorValue:shadeValue)
<color[]touching[#:#]>

[ask"    "andWait]
(answer)

(mouseX)
(mouseY)
<mouseDown>

<key"    "pressed>

(distanceTo"    ")

[resetTimer]
(timer)

("    "of"    ")

(loudness)
<loud>

("    "sensorValue)
<sensor"    ">


-sound-

[playSound"    "]
[playSound"    "untilDone]
[stopAllSounds]

[playDrum( )for( )beats]
[restFor( )beats]

[playNote( )for( )beats]
[setInstramentTo( )]

[changeVolumeBy( )]
[setVolumeTo( )%]

[changeTempoBy( )]
[setTempoTo( )bpm]
(tempo)


-operators-

(( )+( ))
(( )-( ))
(( )*( ))
(( )/( ))

(pickRandom( )to( ))

<" "<" ">
<" "=" ">
<" ">" ">

<< >and< >>
<< >or< >>
<not< >>

(join"    " "    ")
(letter( )of"    ")
(lengthOf"    ")

(( )mod( ))
(round( ))

("    "of( ))


-pen-

[clear]

[penDown]
[penUp]

[setPenClorTo[#:#]
[changePenColorBy( )]
[setPenColorTo( )]

[changePenShadeBy( )]
[setPenShadeTo( )]

[changePenSizeBy( )]
[setPenSizeTo( )]

[stamp]


-variables and lists-

(var:"    ")

[changeVar"    "by( )]
[setVar"    "to( )]
[showVar"    "]
[hideVar"    "]

(list:"    ")

[add"    "to"    "]

[delete( )of"    "]
[insert"    "at( )of"    "]
[replaceItem( )of"    "with"    "]

(item( )of"    ")
(lengthOf"    ")
<"    "contains"    ">

Sample Script:
http://img33.imageshack.us/img33/7392/costumer.png

Last edited by illusionist (2009-09-09 22:48:37)


http://i.imgur.com/8LX1NrV.png

Offline

 

#2 2009-08-27 19:40:39

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Text-Based Scratch

That looks pretty nice actually...

Offline

 

#3 2009-08-27 19:53:47

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Re: Text-Based Scratch

I started the list of commands. If your interested.


http://i.imgur.com/8LX1NrV.png

Offline

 

#4 2009-08-27 20:01:42

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Text-Based Scratch

Nice...

Offline

 

#5 2009-08-27 20:08:15

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Re: Text-Based Scratch

R U in a bad mood? you seem a bit quiet.  neutral


http://i.imgur.com/8LX1NrV.png

Offline

 

#6 2009-08-27 20:16:06

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Text-Based Scratch

No...

Offline

 

#7 2009-08-27 20:29:01

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Re: Text-Based Scratch

...okay...


http://i.imgur.com/8LX1NrV.png

Offline

 

#8 2009-08-27 21:08:33

Louis2018
Scratcher
Registered: 2008-06-13
Posts: 1000+

Re: Text-Based Scratch

cool




http://incubators.dragcave.net/incubator_Louis2018.png

Click the Dragons or they die

Last edited by Louis2018 (2009-08-27 21:27:32)


http://img707.imageshack.us/img707/4547/louis2018.gif

Offline

 

#9 2009-08-27 21:11:14

Louis2018
Scratcher
Registered: 2008-06-13
Posts: 1000+

Re: Text-Based Scratch

The-Whiz wrote:

No...

How do you get that thing thats says your name behind your dragons?


http://img707.imageshack.us/img707/4547/louis2018.gif

Offline

 

#10 2009-08-27 21:16:34

TimeFreeze
Scratcher
Registered: 2008-08-11
Posts: 500+

Re: Text-Based Scratch

Louis2018 wrote:

The-Whiz wrote:

No...

How do you get that thing thats says your name behind your dragons?

Please don't stray off of the topic. I'll answer your question anyway... When you go to your scroll, hit "generate incubator".

Anyways, illusionist, this looks great! Might I suggest these?

Code:

Variables:

[Set variable "  " to ( )]
[Change variable "  " by ( )]
[Hide variable "  "]
[Show variable "  "]

Too lazy to put anything else...

Last edited by TimeFreeze (2009-08-27 21:20:34)


There are 10 types of people in this world: Those who understand binary, and those who don't. --[insert unrelated transition]-- GRANDILOQUENCE FTW!

Offline

 

#11 2009-08-27 22:32:24

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Re: Text-Based Scratch

TimeFreeze wrote:

Louis2018 wrote:

The-Whiz wrote:

No...

How do you get that thing thats says your name behind your dragons?

Please don't stray off of the topic. I'll answer your question anyway... When you go to your scroll, hit "generate incubator".

Anyways, illusionist, this looks great! Might I suggest these?

Code:

Variables:

[Set variable "  " to ( )]
[Change variable "  " by ( )]
[Hide variable "  "]
[Show variable "  "]

Too lazy to put anything else...

You seem to know the code pretty well already!  big_smile


http://i.imgur.com/8LX1NrV.png

Offline

 

#12 2009-08-27 23:54:28

dingdong
Scratcher
Registered: 2007-08-09
Posts: 1000+

Re: Text-Based Scratch

whoa that's cool, really cool actually, but sadly it isn't worth anything since it doesn't run faster or contain more actions, but it's pretty neat to know scratch can do that


http://img851.imageshack.us/img851/2829/superanbanner.png
click the image for my music

Offline

 

#13 2009-08-28 01:07:54

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Text-Based Scratch

Awesome! I normally thought that it would be impossible to program, but when you put it like that, there seems to be a slim chance...


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#14 2009-08-28 01:11:23

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Text-Based Scratch

Oh... now that it's shown like that, it actually makes sense. Still, it has those drawbacks as mentioned in a different suggestion.


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#15 2009-08-28 06:05:48

redware
Scratcher
Registered: 2007-05-21
Posts: 92

Re: Text-Based Scratch

Could you have a block called SPEAK that works a little like the SAY command ? You might also SET VOICE TO female/male etc.

Offline

 

#16 2009-08-28 06:07:54

ScratchScripter
Scratcher
Registered: 2008-08-21
Posts: 73

Re: Text-Based Scratch

I have a suggestion on how comments would be displayed.

http://img143.imageshack.us/img143/6742/greenflagcomment.gif
Would result in this:

Code:

>whenFlagClicked< //0:1:Comment

The 0 means that the comment has minimum width.
The 1 shows that the comment is expanded, 0 would indicate a collapsed comment.

A floating comment would look like this:

Code:

//0:1:10:10:Comment/nNew line

The first and second values are the same as with the attached comment,
the third and fourth values store the X and Y position on the scripts pane.

Offline

 

#17 2009-08-28 08:51:39

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Re: Text-Based Scratch

ScratchScripter wrote:

I have a suggestion on how comments would be displayed.

http://img143.imageshack.us/img143/6742 … omment.gif
Would result in this:

Code:

>whenFlagClicked< //0:1:Comment

The 0 means that the comment has minimum width.
The 1 shows that the comment is expanded, 0 would indicate a collapsed comment.

A floating comment would look like this:

Code:

//0:1:10:10:Comment/nNew line

The first and second values are the same as with the attached comment,
the third and fourth values store the X and Y position on the scripts pane.

Hmmm... but who can read that? a project made in text mode will download in text mode.


http://i.imgur.com/8LX1NrV.png

Offline

 

#18 2009-08-28 11:14:55

ScratchScripter
Scratcher
Registered: 2008-08-21
Posts: 73

Re: Text-Based Scratch

illusionist wrote:

ScratchScripter wrote:

I have a suggestion on how comments would be displayed.

http://img143.imageshack.us/img143/6742 … omment.gif
Would result in this:

Code:

>whenFlagClicked< //0:1:Comment

The 0 means that the comment has minimum width.
The 1 shows that the comment is expanded, 0 would indicate a collapsed comment.

A floating comment would look like this:

Code:

//0:1:10:10:Comment/nNew line

The first and second values are the same as with the attached comment,
the third and fourth values store the X and Y position on the scripts pane.

Hmmm... but who can read that? a project made in text mode will download in text mode.

I don't know, the comments with their position values have to be implemented somehow, or else the comment positions would get lost and the commments would probably end up in the top left corner of the scripts pane if you switched between Text mode and Blocks mode.

Offline

 

#19 2009-08-28 11:53:14

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: Text-Based Scratch

All those [go to x:() y:()], >When (x) Clicked< are good, but I think I have a better idea...

This'd be my text version of the sentence speaking loop of SentenceSynthesier:

Code:

whenIReceive ("PLAY")
{
    `iter` = 0;
    `length` = (lengthOf("LIST") + 1);
    `speaking?` = 1;
    repeatUntil `iter` == `length`
    {
        `currently speaking` = elementOf("Sentence", `iter`);
        replaceListItem(`iter`, "Sentence", elementOf("LIST", `iter`));
        playSoundUntilDone(`iter`);
        replaceListItem(`iter`, "Sentence", `currently speaking`);
        `iter` + 1;
    }
    `speaking` = 0;
}

Last edited by filo5 (2009-08-28 11:53:37)


Converting my Scratch projects to Python!

Offline

 

#20 2009-08-28 16:54:19

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Re: Text-Based Scratch

filo5 wrote:

All those [go to x sad ) y sad )], >When (x) Clicked< are good, but I think I have a better idea...

This'd be my text version of the sentence speaking loop of SentenceSynthesier:

Code:

whenIReceive ("PLAY")
{
    `iter` = 0;
    `length` = (lengthOf("LIST") + 1);
    `speaking?` = 1;
    repeatUntil `iter` == `length`
    {
        `currently speaking` = elementOf("Sentence", `iter`);
        replaceListItem(`iter`, "Sentence", elementOf("LIST", `iter`));
        playSoundUntilDone(`iter`);
        replaceListItem(`iter`, "Sentence", `currently speaking`);
        `iter` + 1;
    }
    `speaking` = 0;
}

This isn't Java Filo. Text-mode is to pepare scratchers for other languages. Its just to tell them a little bit about what its like.  neutral


http://i.imgur.com/8LX1NrV.png

Offline

 

#21 2009-08-28 17:00:57

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Text-Based Scratch

That is much more confusing too...

Offline

 

#22 2009-08-28 17:13:12

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

Re: Text-Based Scratch

I think that is a cool idea. It would be like text programming in plain English.


http://i48.tinypic.com/2z5pqad.png

Offline

 

#23 2009-08-28 17:16:24

elephaant
Scratcher
Registered: 2009-08-21
Posts: 38

Re: Text-Based Scratch

illusionist, this owns.

Offline

 

#24 2009-08-28 20:21:26

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Re: Text-Based Scratch

elephaant wrote:

illusionist, this owns.

glad you like it.  smile


http://i.imgur.com/8LX1NrV.png

Offline

 

#25 2009-08-28 20:31:27

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Text-Based Scratch

I still think it's a good idea... Hope the Scratch Team sees this.

Offline

 

Board footer