M30W Programming Forum

M30W is a text-based version of Scratch

You are not logged in.

Announcement

This is the development forum for M30W (also known as Emerald, do not confuse with Emerald Programming Language).
Our Non-development forums are available here

M30W(Emerald) 0.3 is out! (Download) Requires Python 2.6 or higher.
Opal 0.3(A better command line M30W) is out! (Download) Requires Python 2.6 or higher.
M30W 0.3.6 GUI barebones (Download) Requires Python 2.6 or higher and wxPython
Diamond-2 RED2 GUI Barebones (Fancy M30W editor) s out! (Download) Requires .NET Framework 3.5 or higher, does not require Python
M30W++ GUI barebones (Java M30W) Alpha 1 is out! (Download) Requires Java.


Gershmer.net, our hosting, will close in February 2011. We have not fully decided what to do with our hosting after that, but we will tell you when we decide.

Adverts

Adverts

#1 2010-03-06 20:08:47

hidas
M30W Team
From: The 3rd dimension
Registered: 2009-11-11
Posts: 142
Website

Functions, and M3OW 0.1

How's about we rewrite Emerald using defs, add extremely basic sprite functionality like Magnie said, and then upload it as M3OW 0.1?
I'd be willing to do the graphics things.


Heh heh heh (Semi-evil laugh)

Offline

 

2010-03-06 20:08:47

AdBot
Advertisements

#2 2010-03-06 20:15:07

cds56
THE TOOOTH! THE TOOOOOOOOOOOOTH!!!!!
From: Canamadiana
Registered: 2009-11-07
Posts: 423

Re: Functions, and M3OW 0.1

Lovely.

What are these mystical "defs"?

I thought that was what we were doing anyways, right?


http://www.catb.org/esr/faqs/glider.png

Offline

 

#3 2010-03-06 20:42:03

Gershmer
Admin
From: Newton Centre, Massachusetts
Registered: 2009-10-08
Posts: 515
Website

Re: Functions, and M3OW 0.1

I have opal in defs on my computer somewhere, we can use that.


http://card.ly/images/vcard-green-small.png

Offline

 

#4 2010-03-06 20:49:16

Gershmer
Admin
From: Newton Centre, Massachusetts
Registered: 2009-10-08
Posts: 515
Website

Re: Functions, and M3OW 0.1

Code:

import time

# Defs

def help():
    print "Opal help"
    print ""
    print "Here are Opal's commands:"
    print "print 'text' - prints text"
    print "wait # s - waits the specified # of seconds."
    print "list - lists the program"
    print "run - runs the program"
    print ""

def list():
    print "Program:"
    print ""
    for i in range(0, len(commands)):
        if commands[i] == 'print':
            print "print '" + commands2[i] + "'"
        elif commands[i] == 'wait':
            print "wait " + commands2[i] + " s"  #" cycles"
    print ""

def run():
    print "Running program:"
    print ""
    for i in range(0, len(commands)):
        if commands[i] == 'print':
            print commands2[i]
        elif commands[i] == 'wait':
            time.sleep(int(commands2[i]))
    print ""

def exit():
    print "Are you sure? Y/N"
    sureyesno = raw_input("")
    if sureyesno[0] == 'y':
        running_opal = 0  # terminate the loop in a polite way, not polite way: break

def a():
    i = 7
    to_print = ''
    while i < len(command) - 1:
        to_print = to_print + command[i]
        i = i + 1
    commands.append('print')
    commands2.append(to_print)

def b():
    i = 5
    to_wait = ''
    while i < len(command) - 2:
        to_wait = to_wait + command[i]
        i = i + 1
    commands.append('wait')
    commands2.append(to_wait)

# Start Program
print "Opal v0.1"
print "A text-based programming language"
print "Based on 'Emerald' by the Emerald Team"
place_holder = raw_input("Hit enter to initiate Opal")
valid_commands = ['print', 'wait']
commands = []
commands2 = []
running_opal = 1
running_program = 0
while running_opal == 1:
    print "Enter command:"
    command = raw_input("")
    if command[0] == valid_commands[0][0] and command[1] == valid_commands[0][1] and command[2] == valid_commands[0][2] and command[3] == valid_commands[0][3] and command[4] == valid_commands[0][4]:
        a()
    elif command[0] == valid_commands[1][0] and command[1] == valid_commands[1][1] and command[2] == valid_commands[1][2] and command[3] == valid_commands[1][3]:
        b()
    elif command == 'help':
        help()
    elif command == 'list':
        list()
    elif command == 'run':
        run()
    elif command == 'exit':
        exit()
    else:
        print "That is not a valid command."

OK. Here you go.


http://card.ly/images/vcard-green-small.png

Offline

 

#5 2010-03-06 21:37:13

cds56
THE TOOOTH! THE TOOOOOOOOOOOOTH!!!!!
From: Canamadiana
Registered: 2009-11-07
Posts: 423

Re: Functions, and M3OW 0.1

Those look a lot like functions, but then again, it's python, so you never know...

Last edited by cds56 (2010-03-06 21:37:42)


http://www.catb.org/esr/faqs/glider.png

Offline

 

#6 2010-03-07 09:45:58

markyparky56
Hi...
From: Scotland
Registered: 2009-10-08
Posts: 910
Website

Re: Functions, and M3OW 0.1

That code starts off looking simple, but then... it gets a bit more confusing....


I am A M30Wr.
I always get the last word.

Offline

 

#7 2010-03-08 02:09:24

hidas
M30W Team
From: The 3rd dimension
Registered: 2009-11-11
Posts: 142
Website

Re: Functions, and M3OW 0.1

Great! Um, I'll add dicts and basic sprites to it, not much school tomorrow.


Heh heh heh (Semi-evil laugh)

Offline

 

#8 2010-03-08 19:22:18

markyparky56
Hi...
From: Scotland
Registered: 2009-10-08
Posts: 910
Website

Re: Functions, and M3OW 0.1

hidas wrote:

Great! Um, I'll add dicts and basic sprites to it, not much school tomorrow.

Not much? Half day or something?


I am A M30Wr.
I always get the last word.

Offline

 

#9 2010-03-08 19:42:52

hidas
M30W Team
From: The 3rd dimension
Registered: 2009-11-11
Posts: 142
Website

Re: Functions, and M3OW 0.1

cds56 wrote:

Those look a lot like functions, but then again, it's python, so you never know...

defs are functions.


Heh heh heh (Semi-evil laugh)

Offline

 

#10 2010-03-08 19:43:17

hidas
M30W Team
From: The 3rd dimension
Registered: 2009-11-11
Posts: 142
Website

Re: Functions, and M3OW 0.1

markyparky56 wrote:

hidas wrote:

Great! Um, I'll add dicts and basic sprites to it, not much school tomorrow.

Not much? Half day or something?

Just history, math, and piano.


Heh heh heh (Semi-evil laugh)

Offline

 

#11 2010-03-08 19:51:13

markyparky56
Hi...
From: Scotland
Registered: 2009-10-08
Posts: 910
Website

Re: Functions, and M3OW 0.1

hidas wrote:

markyparky56 wrote:

hidas wrote:

Great! Um, I'll add dicts and basic sprites to it, not much school tomorrow.

Not much? Half day or something?

Just history, math, and piano.

How old are you?


I am A M30Wr.
I always get the last word.

Offline

 

#12 2010-03-08 20:07:19

hidas
M30W Team
From: The 3rd dimension
Registered: 2009-11-11
Posts: 142
Website

Re: Functions, and M3OW 0.1

13. I see this one coming: no I'm not in college, but homeschooled.


Heh heh heh (Semi-evil laugh)

Offline

 

#13 2010-03-08 21:04:16

markyparky56
Hi...
From: Scotland
Registered: 2009-10-08
Posts: 910
Website

Re: Functions, and M3OW 0.1

hidas wrote:

13. I see this one coming: no I'm not in college, but homeschooled.

Ahhh... same.


I am A M30Wr.
I always get the last word.

Offline

 

#14 2010-03-08 22:54:27

cds56
THE TOOOTH! THE TOOOOOOOOOOOOTH!!!!!
From: Canamadiana
Registered: 2009-11-07
Posts: 423

Re: Functions, and M3OW 0.1

markyparky56 wrote:

hidas wrote:

13. I see this one coming: no I'm not in college, but homeschooled.

Ahhh... same.

You're both homeschooled, 13, and not in college? creepy


http://www.catb.org/esr/faqs/glider.png

Offline

 

#15 2010-03-09 13:57:45

hidas
M30W Team
From: The 3rd dimension
Registered: 2009-11-11
Posts: 142
Website

Re: Functions, and M3OW 0.1

WE ARE THE SAME PERSON IN SEPARATE DIMENSIONS. OOOOHHHHHHGGGGGGGGGGG..........


Heh heh heh (Semi-evil laugh)

Offline

 

#16 2010-03-09 16:27:10

markyparky56
Hi...
From: Scotland
Registered: 2009-10-08
Posts: 910
Website

Re: Functions, and M3OW 0.1

I was meaning age, im not homeschooled, if i was, it would be creepy though.


I am A M30Wr.
I always get the last word.

Offline

 

#17 2010-03-09 17:39:07

hidas
M30W Team
From: The 3rd dimension
Registered: 2009-11-11
Posts: 142
Website

Re: Functions, and M3OW 0.1

Oh. I just turned 13 a few days ago.


Heh heh heh (Semi-evil laugh)

Offline

 

#18 2010-03-09 18:43:53

markyparky56
Hi...
From: Scotland
Registered: 2009-10-08
Posts: 910
Website

Re: Functions, and M3OW 0.1

hidas wrote:

Oh. I just turned 13 a few days ago.

strangely, my birthday is on the 9th of the 9th. which is kinda wierd, yet i like it.


I am A M30Wr.
I always get the last word.

Offline

 

#19 2010-03-09 19:15:46

hidas
M30W Team
From: The 3rd dimension
Registered: 2009-11-11
Posts: 142
Website

Re: Functions, and M3OW 0.1

My birthday is on the 3rd of the 3rd. That's just scary.


Heh heh heh (Semi-evil laugh)

Offline

 

#20 2010-03-10 16:17:52

markyparky56
Hi...
From: Scotland
Registered: 2009-10-08
Posts: 910
Website

Re: Functions, and M3OW 0.1

hidas wrote:

My birthday is on the 3rd of the 3rd. That's just scary.

im 3 times better than you then. XD jk what about th person born on the 6th, of the 6th, of the 6th, THE NUMBER OF THE BEST!!!


I am A M30Wr.
I always get the last word.

Offline

 

#21 2010-03-10 16:36:01

hidas
M30W Team
From: The 3rd dimension
Registered: 2009-11-11
Posts: 142
Website

Re: Functions, and M3OW 0.1

BEAST YOU MEAN!


Heh heh heh (Semi-evil laugh)

Offline

 

#22 2010-03-10 19:08:15

markyparky56
Hi...
From: Scotland
Registered: 2009-10-08
Posts: 910
Website

Re: Functions, and M3OW 0.1

hidas wrote:

BEAST YOU MEAN!

YES!!!!!!!!!!!


I am A M30Wr.
I always get the last word.

Offline

 

#23 2010-03-11 02:53:31

cds56
THE TOOOTH! THE TOOOOOOOOOOOOTH!!!!!
From: Canamadiana
Registered: 2009-11-07
Posts: 423

Re: Functions, and M3OW 0.1

NUMBER OF THE BEST IS BETTER SOMEHOW


http://www.catb.org/esr/faqs/glider.png

Offline

 

#24 2010-03-11 16:02:22

markyparky56
Hi...
From: Scotland
Registered: 2009-10-08
Posts: 910
Website

Re: Functions, and M3OW 0.1

cds56 wrote:

NUMBER OF THE BEST IS BETTER SOMEHOW

number of best is best. ;)


I am A M30Wr.
I always get the last word.

Offline

 

#25 2010-03-11 16:06:16

hidas
M30W Team
From: The 3rd dimension
Registered: 2009-11-11
Posts: 142
Website

Re: Functions, and M3OW 0.1

this is getting WAY off topic.


Heh heh heh (Semi-evil laugh)

Offline

 

Adverts

Board footer

Powered by FluxBB
Hosted by PunBB-Hosting