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

#1 2010-12-05 09:15:53

waja_zentrum
New Scratcher
Registered: 2010-08-30
Posts: 5

Source CODE from Project

Hello Everyone!

I have a very simple question but I did not see any other thread where it has been asked...

My problem:
Scratch is a graphical programming user interface. But if i wanted to 'translate' scratch-projects into another programming language like for example Python, I get the problem that I can not see written code. But there must be one, because on the Scratch-Site it is translatet into JAVA... so is there a possibility to see the written source code of scratch projects?

I would be glad if anyone could help me...

Thanks already-
Waja

Offline

 

#2 2010-12-05 09:34:47

ESN
New Scratcher
Registered: 2010-12-03
Posts: 100+

Re: Source CODE from Project

You can download the source code at http://info.scratch.mit.edu/Source_Code or you can browse and edit some coding by using the backdoor, which can be found by holding down 'shift' and left clicking on the top half of the R in the Scratch logo at the top left of the window in the application.


http://is.gd/jZ5chhttp://is.gd/jZhXDhttp://is.gd/jZhU7

Offline

 

#3 2010-12-05 12:03:03

waja_zentrum
New Scratcher
Registered: 2010-08-30
Posts: 5

Re: Source CODE from Project

1. I downloaded the source code, but what am I supposed to do when I have the data? Should I expand them to the scratch folder, because I am unable to open them...

2. When I hold down the 'shift' clicking on the top of the R in the scratch logo, it opens a menu with
-'turn fill screen off'
-'turn error catching off'
.'save image for end-user'
on it. None of this buttons shows me the source code...

But although thanks a lot for these suggestions-
waja

Offline

 

#4 2010-12-07 09:31:30

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Source CODE from Project

I don't know how good you are with computers, but the stuff you're talking about is extremely advanced.  Putting Scratch into Python would require both a great knowledge of Python, and of Squeak (the programming language Scratch is based upon). You said you didn't know what to do once you'd downloaded the source code... Well if you don't know what to do, then obviously this task is one which is too advanced.

There is a simple way to communicate to Scratch via Python however. See this Scratch Wiki article for more information.

Last edited by WeirdF (2010-12-07 09:31:40)


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

#5 2010-12-07 12:56:43

waja_zentrum
New Scratcher
Registered: 2010-08-30
Posts: 5

Re: Source CODE from Project

Sorry I think you understood me wrong...
the Scratch-Python translation was only an example.
The only thing I want to know is how I can see the source code of my projects.
I mean something similar to the source code of a web page. How can I manage that?

Offline

 

#6 2010-12-07 13:02:21

cheddargirl
Scratch Team
Registered: 2008-09-15
Posts: 1000+

Re: Source CODE from Project

waja_zentrum wrote:

Sorry I think you understood me wrong...
the Scratch-Python translation was only an example.
The only thing I want to know is how I can see the source code of my projects.
I mean something similar to the source code of a web page. How can I manage that?

Ah, I think you mean you want to see the code in Squeak (which is what the Scratch language is based upon) as opposed to seeing blocks.

I don't know the answer to your question, but someone else might. I'll move this topic to the Advanced Topics forum since it seems better suited there.  smile


http://i.imgur.com/8QRYx.png
Everything is better when you add a little cheddar, because when you have cheese your life is at ease  smile

Offline

 

#7 2010-12-07 20:49:19

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: Source CODE from Project

cheddargirl wrote:

waja_zentrum wrote:

Sorry I think you understood me wrong...
the Scratch-Python translation was only an example.
The only thing I want to know is how I can see the source code of my projects.
I mean something similar to the source code of a web page. How can I manage that?

Ah, I think you mean you want to see the code in Squeak (which is what the Scratch language is based upon) as opposed to seeing blocks.

No, they do want to see blocks. I think they mean that they want a text equivalent of the blocks.
waja_zentrum, the closest thing to the "source" of projects Scratch currently has is the Project Summary function. Open a project in Scratch, then shift-click the File menu and click "Write Project Summary". Hope this helps.  smile


Yawn.

Offline

 

#8 2010-12-08 08:50:37

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

Re: Source CODE from Project

Though I don't know the answer to this, I would aswell like to know it.


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

 

#9 2010-12-09 06:30:21

waja_zentrum
New Scratcher
Registered: 2010-08-30
Posts: 5

Re: Source CODE from Project

What I want is near to the what meowmeow55 meant...
But if I once converted the project into a .txt-File you can not use the txt File equal to the .sb ...

What I want is that you also can convert the written file into a scratch-file...

Waja

Offline

 

#10 2010-12-09 12:22:50

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

Re: Source CODE from Project

waja_zentrum wrote:

What I want is near to the what meowmeow55 meant...
But if I once converted the project into a .txt-File you can not use the txt File equal to the .sb ...

What I want is that you also can convert the written file into a scratch-file...

Waja

So basicly you want to see the code equivelent of the blocks?


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

 

#11 2010-12-09 14:58:24

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Source CODE from Project

waja_zentrum wrote:

What I want is near to the what meowmeow55 meant...
But if I once converted the project into a .txt-File you can not use the txt File equal to the .sb ...

What I want is that you also can convert the written file into a scratch-file...

Waja

I really do not think that is possible with the simple options the Scratch team made available. You could try importing into a Scratch Mod which has XML exporting option but the process would definitely become very long.

Why would you need this though?

Offline

 

#12 2010-12-09 15:39:14

waja_zentrum
New Scratcher
Registered: 2010-08-30
Posts: 5

Re: Source CODE from Project

LS97 wrote:

I really do not think that is possible with the simple options the Scratch team made available. [...]

Why would you need this though?

I can not really believe that nobody came to the idea before me. This is such an important role, that even the Scratch-Developerment team must have thought about it and I do not believe that there isn't a way.

Scratch must have a built-in translator that converts the Scratch-Projects into text. It might be either Java-Code or Squeek-Code.

I need this because I am not satisfied, when I am programming if I can not see any text...
Scratch is for sure one of the greates ideas and it could revolutionize programming but it must have a way to see the source code of the projects ;-)

Offline

 

#13 2010-12-09 15:47:25

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Source CODE from Project

waja_zentrum wrote:

LS97 wrote:

I really do not think that is possible with the simple options the Scratch team made available. [...]

Why would you need this though?

I can not really believe that nobody came to the idea before me. This is such an important role, that even the Scratch-Developerment team must have thought about it and I do not believe that there isn't a way.

Scratch must have a built-in translator that converts the Scratch-Projects into text. It might be either Java-Code or Squeek-Code.

I need this because I am not satisfied, when I am programming if I can not see any text...
Scratch is for sure one of the greates ideas and it could revolutionize programming but it must have a way to see the source code of the projects ;-)

You see, Scratch was developed to be a visual language and so the Scratch team worked towards that, ignoring possible text versions. Scratch uses special text versions of blocks called 'tuples', but they are really just a text representation of the block. say, the block [blocks]
<move(  )steps>[/blocks]
would become ('move (5) steps' r) or something similar.

The Java player online does not read JavaScript or the like.
It's coded by the Scratch team to decode those tuples and the sprites in a project to run corresponding Java code. Nothing major.

Offline

 

#14 2010-12-11 20:35:55

vrao
New Scratcher
Registered: 2010-12-11
Posts: 1

Re: Source CODE from Project

Why not let people program in that "text representation" with code such as

('move (5) steps' r)

That would make Scratch more of a "real" programming language.

Offline

 

#15 2010-12-12 02:52:01

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Source CODE from Project

There is nothing more "real" about text rather than graphical blocks, so perhaps by "real" you mean "traditional".  Both are ways to encode the underlying tuples in a human-readable way.  The Scratch team chose to make the editor and display software all use a graphical interface.  This has advantages (ease of manipulation and understanding by novices, simplified parsing since the editor maintains a consistent internal structure) and disadvantages (inability to edit with favorite other editors, difficulty generating code from another program).

More and more programming languages are choosing interfaces other than ASCII text, and I see nothing wrong with this for teaching languages.  (For larger programs, I prefer to have more choice of editor.)

It would not be too difficult to write a Python program to parse .sb files into human-readable tuples and to generate .sb files from a tuple format, though you might have to read a lot of Squeak code to reverse-engineer the binary format of the .sb files.

If it is specific concepts that you see lacking in Scratch, rather than a love of text for text's sake, you might want to look at BYOB:
http://gasstationwithoutpumps.wordpress.com/2010/09/18/build-your-own-blocks-extension-to-scratch/

For those looking for a more standard programming language after Scratch, I'd recommend Python as the next language to learn (before C or Java).

Offline

 

Board footer