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 2009-12-03 02:34:40

The-Whiz
Opal Creator
Registered: 2009-11-29
Posts: 48

Opal

The official Opal topic.

*Opal is sponsored by The Emerald Team*

Opal 0.1 download
Opal 0.2 download
Opal 0.3 download
Updates since 0.2:
+ New program function
+ Saving and loading programs
+ Deleting lines
+ Editing lines
+ Inserting lines

Last edited by The-Whiz (2009-12-05 18:43:34)


Creator of Opal

Offline

 

2009-12-03 02:34:40

AdBot
Advertisements

#2 2009-12-03 03:29:00

Magnie
> I am Ninja! <
From: Polaris, the planet
Registered: 2009-10-08
Posts: 321
Website

Re: Opal

Okay. :)


- I speak IF Common -
  ~ Magnie Mozios ~

Offline

 

#3 2009-12-03 16:24:01

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

Re: Opal

Sooooo... why is opal being developed aswell as Emerald and Emerald+? Shouldn't we stick to one thing insted of several? As my dad says, learn to walk before you run.


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

Offline

 

#4 2009-12-03 18:37:04

filo5
Diamond Creator
From: Catford, London, UK
Registered: 2009-10-08
Posts: 253
Website

Re: Opal

Opal with better waiting (now in seconds) and you can now exit it.

Code:

import time

# 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]:
        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)
    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]:
        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)
    elif command == '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 ""
    elif command == '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 ""
    elif command == '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 ""
    elif command == 'exit':
        print "Are you sure? Yes/No"
        sureyesno = raw_input("")
        if sureyesno[0] == 'y':
            running_opal = 0  # terminate the loop in a polite way, not polite way: break
    else:
        print "That is not a valid command."

http://img8.imageshack.us/img8/429/filo5newsigsg1planf.png

Offline

 

#5 2009-12-03 21:40:08

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

Re: Opal

cool, ou created a wait block, intresting. :D


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

Offline

 

#6 2009-12-03 22:47:12

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

Re: Opal

Not sure, but in the future, we do have an open to everyone FTP site.

Host: 97.74.144.1
User: emeraldteam
Password: Diamond1
(case sensitive)'
Protocol: FTP

Files are uploaded to http://www.gershmer.net/emeraldteam/<whatever>

Just in the future, you can upload the .py files, instead of sharing the code in

Code:

boxes

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

Offline

 

#7 2009-12-03 23:19:51

The-Whiz
Opal Creator
Registered: 2009-11-29
Posts: 48

Re: Opal

OK, thanks... I figured out what was wrong.


Creator of Opal

Offline

 

#8 2009-12-04 17:18:53

Magnie
> I am Ninja! <
From: Polaris, the planet
Registered: 2009-10-08
Posts: 321
Website

Re: Opal

I actually prefer the

Code:

Boxes

gershmer. :P

I changed everything to defs:

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."

- I speak IF Common -
  ~ Magnie Mozios ~

Offline

 

#9 2009-12-04 18:21:17

filo5
Diamond Creator
From: Catford, London, UK
Registered: 2009-10-08
Posts: 253
Website

Re: Opal

Hmm, we can think about merging Opal into Emerald to make something cooler. BTW, how about making a RegExp for calls like this:

Code:

print("text")
print ( "text" )
print( "text" )
print ("text")

I mean, in normal language it is allowed to have spaces in there. Emerald should allow them too.


http://img8.imageshack.us/img8/429/filo5newsigsg1planf.png

Offline

 

#10 2009-12-04 18:26:26

filo5
Diamond Creator
From: Catford, London, UK
Registered: 2009-10-08
Posts: 253
Website

Re: Opal

Gershmer, can you configure the Visual Studio-preferred way (FrontPage Server Extensions)? No? Thought so. Anyway, thing is, when I change my Internet plan to Unlimited and get a new computer, I'll probably set up a web server... For myself, buaha, haha. And thus, I shall take thy control over thy plan of hosting - because I shall make my own...


http://img8.imageshack.us/img8/429/filo5newsigsg1planf.png

Offline

 

#11 2009-12-04 19:58:29

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

Re: Opal

Magnie wrote:

I actually prefer the

Code:

Boxes

gershmer. :P

I changed everything to defs:

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."

Alright, I can see where it is better. Is the new def-based Opal going to be considered v0.15? Or should I just leave it as it is 'til 0.2?


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

Offline

 

#12 2009-12-04 20:53:41

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

Re: Opal

so how is opal gonna be used to help Emerald? will it be like python is to scratch, an external extension?


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

Offline

 

#13 2009-12-04 21:02:20

The-Whiz
Opal Creator
Registered: 2009-11-29
Posts: 48

Re: Opal

I'm almost done with 0.2...


Creator of Opal

Offline

 

#14 2009-12-04 21:16:37

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

Re: Opal

markyparky56 wrote:

so how is opal gonna be used to help Emerald? will it be like python is to scratch, an external extension?

Opal's code will most likely be used as the base for Emerald 0.4/0.5.


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

Offline

 

#15 2009-12-04 21:17:10

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

Re: Opal

The-Whiz wrote:

I'm almost done with 0.2...

Based on the def based version, or the old version?


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

Offline

 

#16 2009-12-04 21:57:34

The-Whiz
Opal Creator
Registered: 2009-11-29
Posts: 48

Re: Opal

The old version... I already have a lot of commands in it, and it'll be a hassle to convert it...


Creator of Opal

Offline

 

#17 2009-12-04 22:04:58

The-Whiz
Opal Creator
Registered: 2009-11-29
Posts: 48

Re: Opal

Currently the 0.2 version is huge: 183 lines of code...


Creator of Opal

Offline

 

#18 2009-12-04 22:09:43

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

Re: Opal

The-Whiz wrote:

The old version... I already have a lot of commands in it, and it'll be a hassle to convert it...

It's fine if it's not in defs...


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

Offline

 

#19 2009-12-04 22:39:39

The-Whiz
Opal Creator
Registered: 2009-11-29
Posts: 48

Re: Opal

I'm ready to upload it...
I think I'll add Ifs in the next version...


Creator of Opal

Offline

 

#20 2009-12-04 22:40:51

The-Whiz
Opal Creator
Registered: 2009-11-29
Posts: 48

Re: Opal

Oh, and how do I upload stuff to the emerald site?


Creator of Opal

Offline

 

#21 2009-12-04 23:05:38

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

Re: Opal

1. Download CyberDuck http://cyberduck.ch/ (I assume you are still on Mac)
2. http://www.gershmer.net/ftpMAC.png

What it calls / is really /emeraldteam.

The emeraldteam account is a limited access account, because I don't want people accessing the root of my site.

So, upload the .py IN A ZIP FILE to that site.

To test it, http://www.gershmer.net/emeraldteam/name_of_file

I will edit the Emerald home page (http://www.gershmer.net/emeraldteam) to show the new Opal version.


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

Offline

 

#22 2009-12-04 23:17:18

The-Whiz
Opal Creator
Registered: 2009-11-29
Posts: 48

Re: Opal

OK, thank you...
EDIT: It won't work...

Last edited by The-Whiz (2009-12-04 23:38:03)


Creator of Opal

Offline

 

#23 2009-12-05 00:08:44

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

Re: Opal

Try on Port 21.


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

Offline

 

#24 2009-12-05 00:27:51

The-Whiz
Opal Creator
Registered: 2009-11-29
Posts: 48

Offline

 

#25 2009-12-05 00:30:27

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

Re: Opal

Okay then. I'll have the site updated in a bit.


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

Offline

 

Adverts

Board footer

Powered by FluxBB
Hosted by PunBB-Hosting