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

#1 2012-01-28 05:52:49

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

new forum blocks editor

we should try and make a new editor for the new forum blocks( so you don't have to type them)

when gf clicked
if<you like it>
 say [lets make it!]
else
 ask [why not?] and wait

I've made a start reading project summery files :)

Last edited by TRocket (2012-01-28 07:14:21)


http://i.imgur.com/1QqnHxQ.png

Offline

 

#2 2012-01-28 05:55:45

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: new forum blocks editor

Sounds good! Can you read a sprite's scripts and convert them? Or provide an external editor? I vote for reading a sprite's scripts. Magnie or nXIII might be able to help you out there.

Last edited by Hardmath123 (2012-01-28 05:58:19)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#3 2012-01-28 06:18:11

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: new forum blocks editor

Hardmath123 wrote:

Sounds good! Can you read a sprite's scripts and convert them? Or provide an external editor? I vote for reading a sprite's scripts. Magnie or nXIII might be able to help you out there.

i think we could read them through their project summaries he is one for a project with the deafault scratch can and then

when gf clicked
broadcast [hi v]
when gf clicked
broadcast [hi v]
Project:
Totals:
    Sprites: 1
    Stacks: 2
    Unique costumes: 3
    Unique sounds: 2
--------
Sprite: Stage
  Costumes (1):
    background1 (480x360)
  Sounds (1):
    pop (0:00:00)
  No stacks.
--------
Sprite: Sprite1
  Costumes (2):
    costume1 (95x111)
    costume2 (95x111)
  Sounds (1):
    meow (0:00:01)
  Stacks (2):
    when green flag clicked
        broadcast "test"
    end

    when green flag clicked
        broadcast "test"
    end

-------


http://i.imgur.com/1QqnHxQ.png

Offline

 

#4 2012-01-28 10:41:03

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

Re: new forum blocks editor

I imagine there is a possibility of reading a project summary and maybe converting the summary into Scratch Forum Blocks. I was also thinking of maybe a Javascript page where you could drag blocks and then the script will output a list of Scratch Forum Blocks "code" which you can also copy and paste into your post.

I may be able to make something in Python, but if we wanted to convert it directly from a Scratch Project, I would need someone to explain the Scratch Project format.  smile

This would be a very useful tool for people that don't want to upload their project, but still get help with it. I like the idea!

Offline

 

#5 2012-01-29 07:43:49

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: new forum blocks editor

this is the output for magnie's hash:

when green flag clicked
        set [alphabet" to "ABCDEFGHIJKLMNOPQRSTUVWXYZ]
        ask [Hash Length] and wait
        set [length] to (answer)
        ask [Fast Hash? ((0)/(1))] and wait
        set [fast] to (answer)
        ask [Please enter a word or phrase without special letters or spaces.] and wait
        set [result" to "]
        set [n" to "(1)]
        repeat (length of (answer))  
            set [i" to "(1)]
            repeat until ((letter (n) of (answer)) = (letter (i) of (alphabet)))  
                change [i] by (1)
            set [result" to (join (result) (item (i) of "binary] ))
            change [n] by (1)
        say (result)
        delete [all" of "hash]
        repeat (length)  
            add [(1)" to "hash]
        set [n" to "(1)]
        set [i" to "(1)]
        if ((fast) = [(1)]) else 
            repeat (length of (result))  
                set [letter] to (letter (i) of (result))
                if ((n) = [(1)]) else 
                    set [letter" to ((letter) - (item "last" of "hash] ))
                else
                    set [letter" to ((letter) - (item ((n) - (1)) of "hash] ))
                replace item (n) of [hash] with ((letter) mod (9))
                change [i] by (1)
                set [n] to (((n) + (1)) mod (length))
                say (hash)
        else
            repeat (length of [hash] )  
                set [i" to "(1)]
                repeat (length of (result))  
                    set [letter] to ((letter (i) of (result)) * (length of (result)))
                    if ((n) = [(1)]) else 
                        set [letter" to ((letter) - (item "last" of "hash] ))
                    else
                        set [letter" to ((letter) - (item ((n) - (1)) of "hash] ))
                    replace item (n) of [hash] with ((letter) mod (9))
                    change [i] by (1)
                    set [n] to (((n) + (1)) mod (length))
                    say (hash)
    end

Last edited by TRocket (2012-01-29 07:44:16)


http://i.imgur.com/1QqnHxQ.png

Offline

 

#6 2012-01-29 08:20:45

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: new forum blocks editor

notice the repeat else block  hmm


http://i.imgur.com/1QqnHxQ.png

Offline

 

#7 2012-01-29 08:44:19

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: new forum blocks editor

TRocket wrote:

notice the repeat else block  hmm

That's because of misformatted code:

if <(n)=[1]>
blah
else
blah

Code:

<(n)=[1]>

NOT

((n) = [1])

Last edited by Hardmath123 (2012-01-29 08:44:57)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#8 2012-01-30 03:47:25

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

Re: new forum blocks editor

That's pretty interesting. Though, as you can probably see, there are some that need some fixing up. The quotes need to be turned into the [ and ]. The operators need to be switched to < and >. And that if-else needs to be fixed.

Hmm, what language is this coded in? Can you post the source?

Offline

 

#9 2012-01-30 03:54:02

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: new forum blocks editor

TRocket wrote:

notice the repeat else block  hmm

Notice that there are two of "else"? It's not a normal IF or REPEAT block as I know it.

EDIT: Example with if block

if <(5) > (1)>
blocks here . . .
else
moar blocks here . . .
else
what . . .
a second else
end

Last edited by rdococ (2012-01-30 03:55:47)

Offline

 

#10 2012-01-30 05:12:49

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: new forum blocks editor

Magnie wrote:

I may be able to make something in Python, but if we wanted to convert it directly from a Scratch Project, I would need someone to explain the Scratch Project format.  smile

I have some Python code I've been meaning to upload that can read/write scratch .sprite files, and project files too, I think. It's written using the awesome Construct library, which is a must for something like this. My code is still a little funny about writing images embedded in the Scratch files, but I think it would work well enough for reading scripts. I must upload it sometime soon...

If you do decide to write your own, take a look at the wiki I made that collects a lot of info on the Scratch format in one place.  smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#11 2012-01-30 11:18:52

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: new forum blocks editor

Magnie wrote:

That's pretty interesting. Though, as you can probably see, there are some that need some fixing up. The quotes need to be turned into the [ and ]. The operators need to be switched to < and >. And that if-else needs to be fixed.

Hmm, what language is this coded in? Can you post the source?

this is coded in JAVA i will post the library for reading project summarys soon


http://i.imgur.com/1QqnHxQ.png

Offline

 

Board footer