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

#76 2012-02-29 14:44:01

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

Re: The Return Of M30W

roijac wrote:

http://nullpointer.ph/questions/3021/in-oop-what-is-so-important-about-information-hiding
^^  tongue
>>sourceforge forums  smile

I can't access the forums for some reason. Can we just keep the discussion in here?

Offline

 

#77 2012-03-01 05:57:30

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: The Return Of M30W

weird, can you still not access it?
and what command do i need to update the repo?  hmm
edit: nevermind, i got it  smile

Last edited by roijac (2012-03-01 05:58:55)

Offline

 

#78 2012-03-01 09:41:08

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

Re: The Return Of M30W

roijac wrote:

weird, can you still not access it?
and what command do i need to update the repo?  hmm
edit: nevermind, i got it  smile

Hmm, now I can. Over time, I'll end up forgetting about those forums. Scratch is the only site I've stayed on permanently. So if we just keep the discussion here, I'm less likely to abandon the project.

We'll go with importing. So how should we set up the program?

Offline

 

#79 2012-03-01 10:30:54

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: The Return Of M30W

come on, it's funnier without planning  smile
just add some code if you feel like  big_smile

but maybe we should start with the language. like basic commands and that.

Offline

 

#80 2012-03-01 12:04:35

undefeatedgames
Scratcher
Registered: 2011-05-22
Posts: 1000+

Re: The Return Of M30W

cool


Please call me udg or bearsfan, not undefeated.
Scratch and Misc.! Click here for Misc.'s Successorhttps://lh3.googleusercontent.com/-jkhes3yzmQk/T7G_BnxT9xI/AAAAAAAABYI/xhoN1Jk2M08/s513/sigp1.gif

Offline

 

#81 2012-03-01 12:37:41

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: The Return Of M30W

thanks!  smile

Offline

 

#82 2012-03-01 12:59:27

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

Re: The Return Of M30W

Haha. Yeah, if we don't plan, it'll never even get done.  tongue

I'm thinking of having the same syntax as the Scratch Forum Blocks. What are your thoughts?

Offline

 

#83 2012-03-01 13:16:10

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: The Return Of M30W

that could sortof work, but i really don't like the endless ([<>])  hmm  maybe just ' ' ftw?  big_smile

Offline

 

#84 2012-03-01 13:35:31

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

Re: The Return Of M30W

Yeah, we can change the ([<>]) to something else that's more reasonable.

Offline

 

#85 2012-03-02 03:13:36

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: The Return Of M30W

but it's still unreadable, especially with nested blocks :S
maybe we should make it more like python functions...

Offline

 

#86 2012-03-02 09:58:48

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

Re: The Return Of M30W

roijac wrote:

but it's still unreadable, especially with nested blocks :S
maybe we should make it more like python functions...

I write my Scratch Blocks like this:

Code:

when gf clicked
set [var v] to (1234567890)
forever
    if <touching [sprite v]?>
        say [How are you?] for (3) secs
    end

When ever I try to simplify it though, it gets confusing how [text] and (numbers) will end up working. So I think how it is right now is pretty good.

Offline

 

#87 2012-03-02 10:11:21

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: The Return Of M30W

ok, i'm good with it  smile
maybe hat blocks should be like this?:

Code:

greenflag:
some code
end script

clicked:
some code
end script

should i write a parser?  big_smile

Offline

 

#88 2012-03-02 10:15:12

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

Re: The Return Of M30W

roijac wrote:

ok, i'm good with it  smile
maybe hat blocks should be like this?:

Code:

greenflag:
some code
end script

clicked:
some code
end script

should i write a parser?  big_smile

Maybe ":end" should be used for the end of a script instead of "end script". And yes, a parser would be nice.  smile

Offline

 

#89 2012-03-02 11:07:06

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: The Return Of M30W

okay, i'll try to finish it till next week  smile
you're going to work on UI?

Offline

 

#90 2012-03-02 14:39:44

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

Re: The Return Of M30W

roijac wrote:

okay, i'll try to finish it till next week  smile
you're going to work on UI?

Not sure. I have no idea how to use wx or tkinter.  hmm

If you get a base up with a couple basic blocks, then I might be able to code everything else. If you have anything specific that isn't related to the GUI, I can probably work on it.

Offline

 

#91 2012-03-03 15:06:11

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: The Return Of M30W

ok, what do you say about making the sprite and project dtd?

Offline

 

#92 2012-03-03 22:13:38

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

Re: The Return Of M30W

Hmm, okay. I'll do DTD first.

Code:

<!DOCTYPE meow_project [
    <!ELEMENT meow_project (meow_settings, project_settings, project_sprites)>
        <!ELEMENT meow_settings (version)>
            <!ELEMENT version (#PCDATA)>

        <!ELEMENT project_settings (author, name)>
            <!ELEMENT author (#PCDATA)>
            <!ELEMENT name (#PCDATA)>

        <!ELEMENT project_sprites (#PCDATA)>
            <!ELEMENT sprite (name, costumes, sounds, scripts)>
                <!ELEMENT name (#PCDATA)>

                <!ELEMENT costumes (costume)>
                    <!ATTLIST costume id CDATA #REQUIRED>

                <!ELEMENT sounds (sound)>
                    <!ATTLIST sound id CDATA #REQUIRED>

                <!ELEMENT scripts (script)>
                    <!ATTLIST script id CDATA #REQUIRED>
]>

What do you think?

Offline

 

#93 2012-03-04 05:12:18

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: The Return Of M30W

project notes missing, but everything else is good  smile
parser will have to wait a bit, too many tests  sad

Offline

 

#94 2012-03-04 12:54:58

bendad
Scratcher
Registered: 2008-06-14
Posts: 100+

Re: The Return Of M30W

Hi guys!
Great work so far, sorry for not being around.

I'm not exactly a coding master, but I know a few things. I'd love to help out with syntax ideas, art for the GUI, and website management.

Sorry for not getting the site up, I've been really busy lately and I keep on meaning to but life gets in the way.

I can't check out the sourceforge site because it's blocked on my school laptop (Which I'm on right now  tongue ). I'll see it when I get home.

So what have we decided on the site, sharing files, and other things?


Hi!  big_smile
Good to see you. (Even if I don't know you  wink  )

Offline

 

#95 2012-03-04 13:50:00

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: The Return Of M30W

hi, nice to c u  smile
are u good with wx?

Offline

 

#96 2012-03-04 15:49:54

bendad
Scratcher
Registered: 2008-06-14
Posts: 100+

Re: The Return Of M30W

no. I know the basics of python but I could learn wx.


Hi!  big_smile
Good to see you. (Even if I don't know you  wink  )

Offline

 

#97 2012-03-05 09:19:41

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

Re: The Return Of M30W

Code:

<!DOCTYPE meow_project [
    <!ELEMENT meow_project (meow_settings, project_settings, project_sprites)>
        <!ELEMENT meow_settings (version)>
            <!ELEMENT version (#PCDATA)>

        <!ELEMENT project_settings (author, name)>
            <!ELEMENT author (#PCDATA)>
            <!ELEMENT name (#PCDATA)>
            <!ELEMENT notes (#PCDATA)>

        <!ELEMENT project_sprites (#PCDATA)>
            <!ELEMENT sprite (name, costumes, sounds, scripts)>
                <!ELEMENT name (#PCDATA)>

                <!ELEMENT costumes (costume)>
                    <!ATTLIST costume id CDATA #REQUIRED>
                    <!ATTLIST costume name CDATA #REQUIRED>

                <!ELEMENT sounds (sound)>
                    <!ATTLIST sound id CDATA #REQUIRED>
                    <!ATTLIST sound name CDATA #REQUIRED>

                <!ELEMENT scripts (script)>
                    <!ATTLIST script id CDATA #REQUIRED>
]>

I'm still trying to figure out how we should implement images and sounds all into a single file.

Offline

 

#98 2012-03-05 10:46:04

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: The Return Of M30W

http://stackoverflow.com/questions/3715493/encoding-an-image-file-with-base64^^

Offline

 

#99 2012-03-11 07:53:01

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: The Return Of M30W

parser development is active  smile

Code:

#Only proof of concept
import re
class ParseError(Exception):
    def __init__(self, message):
        self.message = message
    def __str__(self):
        return repr(self.message)
specs = [ r'move %n steps',
        r'turn %n degrees',
        r'point in direction %n',
        r'go to %n:%n',
        r'set x to %n',
        r'set y to %n',
        r'change y by %n',
        r'change x by %n',
        r'stop script']
for i in range(len(specs)):
    specs[i] = specs[i].replace('%n', r'([0-9.]*)')
    #Another symbols come here :)

def getinputs(block):
    for spec in specs:
        if re.match(spec, block):
            print 'Found block spec!\n' + block + ' is ' + spec
            print 'Inputs are ' + str(re.match(spec, block).groups())
            break
    else:
        raise ParseError('Block not recognised!')

if __name__ == '__main__':
    block = 'turn 12.43 degrees'
    getinputs(block)

Offline

 

#100 2012-03-11 14:12:50

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: The Return Of M30W

do you think we should allow different spellings/writing of blocks?
for example goto instead of go to, etc.?

Offline

 

Board footer