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

#1 2007-05-28 08:40:41

mohlar
Scratcher
Registered: 2007-05-24
Posts: 100+

Long programs - how easy to read?

A long-distance friend of mine (ie: we're separated by the Atlantic Ocean) recently made a good point as we swapped emails comparing 'Tales Animator' and 'Scratch'. In most programming languages, it is relatively easy to construct long programs and still be able to read them quite easily. Certainly you can usually print out listings to study them. How are more experienced or advanced users of Scratch coping with the apparent inability to do anything like this? (eg: In 'Tales Animator' you can't print a listing, but you can copy the text and paste into a word processor. In MSWLogo, you can print whole listings at will.)

My own programming experience goes way back to the days of naming subroutines and calling them as necessary. That of course, was when you REALLY needed to be able to print out a listing.

I'm fully aware that Scratch is designed primarily for younger users and I'm 100% in support of that, together with it's uniquely clever GUI and method of inputing and constructing programs. But isn't it quite feasible that many users will want to grow with the program and create ever more complex (and lengthy) listings? Many, hopefully, will move on to other software, but many, I guess, will want to stay with Scratch.

So, after all that rambling - how are more expert users of Scratch finding it as they develop long programs, many of which will presumably have Scratch-equivalents of subroutines, nested loops, procedures etc. etc.

And is it envisaged that there will ever be a way to print out listings so as to study them? I've already noticed a few 'conversations' in the forum as members try to explain in words their Scratch programs or try to suggest solutions to problems. Some even revert to trying to translate these into the normal text-style presentation that I'm referring to.

Offline

 

#2 2007-05-28 11:04:16

Duncan
Scratcher
Registered: 2007-05-15
Posts: 47

Re: Long programs - how easy to read?

Holding the Shift key while clicking on the Extras button will give you the option to Write Project Summary which will save a text listing of your programme - each script roughly equatable to ye olde sub-routines.

I agree these forums are not ideal for exchanging coding examples.  I set up a gallery specifically for providing help but am not sure that that is the answer either.

Offline

 

#3 2007-05-28 12:35:36

mohlar
Scratcher
Registered: 2007-05-24
Posts: 100+

Re: Long programs - how easy to read?

Thanks Duncan.

Is that tip listed in any of the documentation, I wonder?

I've tried your idea and see the option in the pull-down menu. I did a couple of tests but can't see where it saves the file so that it can opened in something like Notepad (I assume that's the format). There's nothing in clipboard (which was my first assumption).

Can you solve that mystery as well?

Last edited by mohlar (2007-05-28 12:59:47)

Offline

 

#4 2007-05-28 13:29:17

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

Re: Long programs - how easy to read?

I normally write rather large programs in c++ (one of the ones I'm working on is about 70,000 lines of code). So I don't do printouts---I have no desire to try to thumb through over a 1000 pages of code.   I rely on using emacs and viewing the code on screen.

I don't think scratch could create programs that big, and the current mechanisms are adequate for the tiny programs that scratch is relevant for.

Offline

 

#5 2007-05-28 14:56:16

mohlar
Scratcher
Registered: 2007-05-24
Posts: 100+

Re: Long programs - how easy to read?

kevin_karplus wrote:

I don't think scratch could create programs that big, and the current mechanisms are adequate for the tiny programs that scratch is relevant for.

70,000 lines. Yes, I agree. But even with moderately complex programs it is easy to end up scrolling up and down a column of blocks. Although these are VERY well thought out and cover pretty well everything a 'Scratcher' will need, by their very nature they occupy a lot of space. If you're having to scroll up and down, it can become rather confusing.

Offline

 

#6 2007-05-28 15:29:27

Duncan
Scratcher
Registered: 2007-05-15
Posts: 47

Re: Long programs - how easy to read?

The text file is saved in the folder where the Scratch application lives - at least it does on a Mac I guess it is the same for Windows.

Offline

 

#7 2007-05-28 15:40:56

mohlar
Scratcher
Registered: 2007-05-24
Posts: 100+

Re: Long programs - how easy to read?

Mmmm - that's what I assumed, but I've tried 3 or 4 now and can't find anything.
Has anyone else tried this on a PC? In my case, Scratch is on my 2nd hard drive (D) whereas C: is my main drive. I wonder if I need to move the whole folder there?

Offline

 

#8 2007-05-28 16:59:11

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

Re: Long programs - how easy to read?

I tried the "write project summary" and "write multiple project summaries" on my Mac, and nothing appeared anywhere.  I looked over all the likely directories and did searches with the finder, to no avail.

I think that the "write project summary" option is not working in the release version.
Has anyone outside the Scratch Team gotten it to do anything?

Offline

 

#9 2007-05-28 17:10:33

Duncan
Scratcher
Registered: 2007-05-15
Posts: 47

Re: Long programs - how easy to read?

My own Projects (Scratch 1.1) saved within the Projects folder within the Scratch folder produce a file called ProjectName-summary.txt in the Scratch folder.  It does not seem to work with the sample projects that come with Scratch.

Offline

 

#10 2007-05-28 18:03:49

mohlar
Scratcher
Registered: 2007-05-24
Posts: 100+

Re: Long programs - how easy to read?

And I've tried this method with other people's programs and my own. Nothing appears anywhere - not a file nor a new folder. Anyone in the Scratch team tested this recently?

Offline

 

#11 2007-05-28 23:00:26

natalie
Scratch Team
Registered: 2007-03-07
Posts: 100+

Re: Long programs - how easy to read?

Thanks for the thoughtful discussion. I also just tried write project summary and don't see the output on my Mac. I'll ask others here about the current status of that feature.

Offline

 

#12 2007-05-29 03:01:06

mohlar
Scratcher
Registered: 2007-05-24
Posts: 100+

Re: Long programs - how easy to read?

This is what I love about Scratch and this forum - no sooner do you ask something than there's a good chance someone will leap in with a suggestion. AND the fact that members of the development team obviously keep an eye on what's being discussed makes this a VERY lively and positive project.

Offline

 

#13 2007-05-29 04:02:30

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Long programs - how easy to read?

Somewthing that would help would be a good old fashioned REM statement - a block (in a contrasting colour) that you can type text into but that has no effect on the running of the program.

Would be useful in debugging, but even more useful when sharing code.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#14 2007-05-29 10:42:40

tammy
Scratcher
Registered: 2007-03-07
Posts: 57

Re: Long programs - how easy to read?

Hi all,

I just tried this on my PC, and it seems to work.  It automatically creates a .txt file in C:\Program Files\Scratch (this is where the Scratch folder is located on my computer).

As Duncan pointed out, the name of the .txt file is <name of project>-summary.txt, so it might help searching for that file on your computer to see exactly where the project summary is located.

I also tried it with a few of the sample projects, and that seems to work as well.

Please let us know if you are still having problems and which versions of Scratch you are using (it only works in version 1.0.2 and higher).

Thanks again for the detailed reports!
-Tammy

Offline

 

#15 2007-05-29 11:44:31

mohlar
Scratcher
Registered: 2007-05-24
Posts: 100+

Re: Long programs - how easy to read?

Using Scratch 1.1
Just copied my entire Scratch file onto my C: drive; put it into Program files and tried again by using shift/extras/write project summary.

Nothing has appeared.

I've also used *.txt as the basis for a search of both hard drives and - you guessed it - nothing.

I must be doing something wrong.  Is this working for everyone else? I can feel a Homer Simpson Durrrrgh coming on.

Offline

 

#16 2007-05-29 12:47:32

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

Re: Long programs - how easy to read?

On Mac OS X (10.3.9) running Scratch VM 3.8.14b7y (which says Scratch 1.1 on the window title), I get no effect from "write project summary".  I did searches to look for the file and there is nothing on the hard disk that might be it.

Offline

 

#17 2007-05-29 12:59:14

mohlar
Scratcher
Registered: 2007-05-24
Posts: 100+

Re: Long programs - how easy to read?

kevin_karplus wrote:

I did searches to look for the file and there is nothing on the hard disk that might be it.

Ditto on my PC.
There must be a reason for this apparent variability of success - but I've no idea what it is.

Offline

 

#18 2007-05-29 17:30:40

tammy
Scratcher
Registered: 2007-03-07
Posts: 57

Re: Long programs - how easy to read?

Thanks all.  We will look into this.  It seems like a bug in Scratch..

Offline

 

#19 2007-05-29 23:51:56

johnm
Scratcher
Registered: 2007-03-08
Posts: 100+

Re: Long programs - how easy to read?

Hi, all.

The "write project summary" is not documented and it is difficult to find (using shift to get that option) because it's not intended for most a Scratch users. We use it sometimes to look at the code for projects and it's fine for others to use it as well; if they manage to find out about it they are probably experienced enough to understand what it does.

Two possible explanations for the problems:
  a. be sure to release the shift key before you make the menu selection
  b. make sure the Scratch folder is writable by you when you do this

Happy hacking!

  -- John

Offline

 

#20 2007-05-30 00:36:14

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

Re: Long programs - how easy to read?

The folder is writable, and I released shift as specified.
There was still nothing written.

Offline

 

#21 2007-05-30 11:09:38

DrJim
Scratcher
Registered: 2007-05-26
Posts: 100+

Re: Long programs - how easy to read?

Just printed out the program for "Endless Road" by Red Neptune (great program, by the way) and, like him, had no problem getting the listing.  The program appeared in the same directory as I had installed Scratch and was quite readable (I'm on a PC using XP).

I did note the listing does include formatting - it looks much better in WordPad, for example, so I suspect it may actually be an .rtf file or something similar.  Can't see why this would cause the problem - but don't see anything else either.

Offline

 

#22 2007-05-31 12:47:44

mohlar
Scratcher
Registered: 2007-05-24
Posts: 100+

Re: Long programs - how easy to read?

johnm wrote:

Two possible explanations for the problems:
  a. be sure to release the shift key before you make the menu selection
  b. make sure the Scratch folder is writable by you when you do this.

OK - THAT's the answer. Just being instructed to hold down shift and press Extras isn't quite enough. Johnm's point (a) is the key.

So it's .....

Press Shift and also choose Extras with the shift key still being held down.
The drop down menu appears with the option to 'Write project summary'.
Release the shift key.
The dropdown menu stays visible.
Click on 'Write summary project'.
Two things now happen -  The text listing is saved as a file in your main 'Scratch folder)
                            and -  The text listing is held in memory and can be pasted into 
                                      any wordprocessor that you prefer.


I'll start a new thread in this forum just for this solution so members don't have to trawl through the whole dialogue.

Offline

 

#23 2007-05-31 12:59:51

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

Re: Long programs - how easy to read?

Actually, there is still a bug.  My Mac OS X version still doesn't write the file.
It is true that the copy buffer gets the text, which I had not been aware of, so there is a very ugly workaround for this bug.

Offline

 

Board footer