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

#76 2009-09-09 18:53:13

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

Re: Text-Based Scratch

But how would you program in it? Btw could you upload a version of it? I'll try it, but make sure the space taken is low and you can program in it. But I can only do it in Python. If you can learn to program in that, that would help A LOT.

Offline

 

#77 2009-09-09 18:55:10

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

Re: Text-Based Scratch

I have a very basic understanding of python - Can you show me the code to Emerald?

Last edited by The-Whiz (2009-09-09 18:55:24)

Offline

 

#78 2009-09-09 18:56:30

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

Re: Text-Based Scratch

Code:

# This is the greeting.
print \
"""
Emerald 0.1 - Based on Scratch by MIT
By Magnie
"""

commands = ["print","run","end","ask","save","load"] # Commands that you can type
encode = [] # for print and ask commands
encode2 = [] # for Variables
onOrOff = "off" # I switch I never really knew what to call it.
line = 0 # Just shows what line the Programming Language is accessing on the program
i = 0 # Another switch
program = [] # Where all the commands will be put.

# Start
while i != 1:
    while onOrOff == "off": # Add commands here
        command = raw_input("Type in a command: ")
        command.lower()
        if command != "run":
            if command == commands[0]: # Checks to see if it is print.
                recode = raw_input("What should your program print? ") # Allows you type type what you want for it to print.
                encode.append(recode)
                program.append(command)
                encode2.append(None)
            if command == commands[2]: # Checks to see if it's end.
                onOrOff = None # Makes it so you can't add a command and makes it so you can't run the program allowing it to close.
                i = 1 # Disables the whole script
                line = 9999
            if command == commands[3]: # Checks to see if the command is Ask.
                recode = raw_input("What should you ask them? ") # Allows you to type what the 'question' is.
                encode.append(recode)
                program.append(command)
                encode2.append(None)
            if command == commands[4]: # Checks to see if the command is Save.
                print "Your program has been saved."
                open(Program.py,"w")
            if command == commands[5]: # Checks to see if the command is Load.
                print "Your program has been loaded."
                import Program.py
        else: # If it is run.
            onOrOff = "on" # Makes the program run.
            print "\n\n"
            line = 0
    while line != len(program): # As long as 'line' is less than the length of the program it will run the program.
        if program[line] == commands[0]: # If it is 'print'
            print encode[line] # Print what was typed in.
            line += 1
        elif program[line] == commands[3]: # If it is 'ask'
            raw_input(encode[line]) # Ask so and so then allows the user to type.
            line += 1
        else:
            print "There seems to be something wrong with either your programming or my programming"
            line += 1
    onOrOff = "off" # Go back to adding commands mode.
    print "\n\n"
    line = 0

Just open it in IDLE and you'll see the coding.

OOOPS that's the code I'm working with to be able to save and load files/programs that you made in Emerald, I need help with that. So there's the basic code, I'll go get the actual code...

Here: The first one has the greeting change and this one is the Original.

Code:

# This is the greeting.
print \
"""
Emerald 0.1
By Magnie
"""

commands = ["print","run","end","ask"] # Commands that you can type
encode = [] # for print and ask commands
encode2 = [] # for Variables
onOrOff = "off" # I switch I never really knew what to call it.
line = 0 # Just shows what line the Programming Language is accessing on the program
i = 0 # Another switch
program = [] # Where all the commands will be put.

# Start
while i != 1:
    while onOrOff == "off": # Add commands here
        command = raw_input("Type in a command: ")
        command.lower()
        if command != "run":
            if command == commands[0]: # Checks to see if it is print.
                recode = raw_input("What should your program print? ") # Allows you type type what you want for it to print.
                encode.append(recode)
                program.append(command)
                encode2.append(None)
            if command == commands[2]: # Checks to see if it's end.
                onOrOff = None # Makes it so you can't add a command and makes it so you can't run the program allowing it to close.
                i = 1 # Disables the whole script
            if command == commands[3]: # Checks to see if the command is Ask.
                recode = raw_input("What should you ask them? ") # Allows you to type what the 'question' is.
                encode.append(recode)
                program.append(command)
                encode2.append(None)
        else: # If it is run.
            onOrOff = "on" # Makes the program run.
            print "\n\n"
    while line != len(program): # As long as 'line' is less than the length of the program it will run the program.
        if program[line] == commands[0]: # If it is 'print'
            print encode[line] # Print what was typed in.
            line += 1
        elif program[line] == commands[3]: # If it is 'ask'
            raw_input(encode[line]) # Ask so and so then allows the user to type.
            line += 1
        else:
            print "There seems to be something wrong with either your programming or my programming"
    onOrOff = "off" # Go back to adding commands mode.
    print "\n\n"
    line = 0

Last edited by Magnie (2009-09-09 19:01:28)

Offline

 

#79 2009-09-11 07:46:31

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Text-Based Scratch

...i really wish this will go into... like... commercial use...


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#80 2009-09-11 08:09:46

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

Re: Text-Based Scratch

I don't think so though.  sad  Someday it will die...  sad

Offline

 

#81 2009-09-12 04:40:01

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Text-Based Scratch

but it has to live, to die  big_smile


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#82 2009-09-12 09:27:28

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

Re: Text-Based Scratch

lol, true. You could help us if you want.  smile

Offline

 

#83 2009-09-15 02:09:54

tcb
Scratcher
Registered: 2008-03-25
Posts: 100+

Re: Text-Based Scratch

Please could you compile it into a .exe file? python hates me, and for all the mac users, python is built in anyway...


http://goo.gl/eCQLihttp://goo.gl/sK54shttp://goo.gl/jC0dehttp://goo.gl/yhGLQhttp://goo.gl/wqvsQ

Offline

 

#84 2009-09-15 12:30:09

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Text-Based Scratch

i dont know python, i would help if there was anything i could do, outside the programing area.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#85 2009-09-15 20:19:00

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

Re: Text-Based Scratch

Tcb: If I find a item that does that.  smile

Marky: Maybe you could do images/GUI? I sugest that we continue this on this topic (Emerald): http://scratch.mit.edu/forums/viewtopic.php?pid=220072

Offline

 

#86 2009-09-16 02:29:54

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

Re: Text-Based Scratch

I suggest that we get back on topic.

Only one post has been done here by the Scratch Team. Thank you Paddle2See. But is it possible to have a definite answer? Yes or no?


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

Offline

 

#87 2009-09-16 04:26:38

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

Re: Text-Based Scratch

Yes, that was what I was talking about on my last reply.  wink

Offline

 

#88 2009-09-16 04:36:42

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: Text-Based Scratch

ScratchScripter wrote:

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.

most text based programming languages have their comments like this

Code:

[var:hello]=10; the comment goes behind the ;

whatever script it is

Last edited by deatheater (2009-09-16 04:37:09)

Offline

 

#89 2009-09-16 09:48:59

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

Re: Text-Based Scratch

not really, most programming languages require ; as end of command. In C family, the comment is either
//single-lined or
/*
multi
line
*/

But in other languages, comments often start from # (and sometimes ; but not very often)


Converting my Scratch projects to Python!

Offline

 

#90 2009-09-23 14:19:55

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Text-Based Scratch

Jonathanpb wrote:

I suggest that we get back on topic.

Only one post has been done here by the Scratch Team. Thank you Paddle2See. But is it possible to have a definite answer? Yes or no?

I would have to say,t hat we dont really need a definite answer, unless Emeral is canceled, which i dont think'll happen. Though it would be nice (Not necessary) to have scratch team help.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#91 2009-09-23 14:51:12

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

Re: Text-Based Scratch

It would be really nice for the Scratch Team's help. But yes, not necessary.

Offline

 

#92 2009-09-23 16:41:21

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Text-Based Scratch

I suggested this a while ago...

Offline

 

#93 2009-09-27 23:56:48

ThePiGuy
Scratcher
Registered: 2009-08-27
Posts: 64

Re: Text-Based Scratch

filo5 wrote:

I already said I can help - I'm a beginning C# programmer, but I know few things. For example, C# is pretty object oriented; that helps a lot. Also, it is amazing, how many things you can do with a text string - instead of
"print (enter) LOL"
you could type
"print :LOL"

I WANT TO LEARN C#! Anyway I would like this as a Text-Based Scratch. Its....
Scratch#!

Code:

using scratch //I want to use scratch
using scratch.blocks //I want to use scratch blocks
using scratch.sprites //I want to use scratch sprites
using scratch.backgrouds //I want to use scratch backgrounds

project MyNewScratchProject  //Starts project
{
   public sprite Cat //The new project Cat sprite
   {
      Cat.loadcostume[0]="cat1-a.jpg"; //Set the costume
      scratch.flagclicked() //When the flag is clicked...
         {
            this.x=0;
            this.y=0; //Move to the center
            this.say("I'm back in the center of the screen"); //Say something
         }
      this.clicked() //When Cat is clicked...
         {
            this.x=mouse_x;
            this.y=mouse_y; // move to the mouse!
            playsound(getsound("meow.mp3")); //play sound
         }
   }
   static void Start() // main method
   {
      IntSprite(Cat); //Make a the cat
      Cat TestCat = new Cat; // A good thing about Scratch# is duplicating sprites
      TestCat.x=-100; //Make this new Cat be a little offset.
      Go(); // Play the project
   }
}

Last edited by ThePiGuy (2009-09-28 00:02:25)


PI IS AWESOME!! Yes, pi is not equal to 3.14. It's 3.1415926535897932384626433832795028841971693993751058...

Offline

 

#94 2009-09-28 00:05:44

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: Text-Based Scratch

I like this idea. I think it should be implemented, it looks like something anyone could figure out.


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#95 2009-09-28 04:20:12

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

Re: Text-Based Scratch

hmnwilson wrote:

I like this idea. I think it should be implemented, it looks like something anyone could figure out.

It's being worked on right now.  wink

Offline

 

#96 2009-09-28 05:31:23

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Text-Based Scratch

If your talking about Emerald Magnie, then yeah, if the scratch team is doing it as well, then i never heard.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#97 2009-09-28 05:34:19

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

Re: Text-Based Scratch

Yes, I'm talking about Emerald.  tongue

Offline

 

#98 2009-09-29 21:30:41

ThePiGuy
Scratcher
Registered: 2009-08-27
Posts: 64

Re: Text-Based Scratch

Anybody want me to try to make this(Not is scratch)?


PI IS AWESOME!! Yes, pi is not equal to 3.14. It's 3.1415926535897932384626433832795028841971693993751058...

Offline

 

#99 2009-09-29 21:56:38

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

Re: Text-Based Scratch

It's already being made.

Offline

 

#100 2009-09-29 22:51:04

ThePiGuy
Scratcher
Registered: 2009-08-27
Posts: 64

Re: Text-Based Scratch

Then, I'll just make my own version.


PI IS AWESOME!! Yes, pi is not equal to 3.14. It's 3.1415926535897932384626433832795028841971693993751058...

Offline

 

Board footer