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

#926 2010-07-02 17:54:46

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

markyparky56 wrote:

fullmoon wrote:

markyparky56 wrote:

But not the weirdest one, but the name I can not utter on the scratch forums.

Actually, I think the one you are referring to might have some competition: LOLCODE.

No, I mean this one I had to shorten the url. Warning, the name may be offensive to some people, I apologise, but you have been warned.

I know which one you meant, I just wanted to point out another one. Check out the Esoteric Programming Languages article on Wikipedia...


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#927 2010-07-02 18:18:25

soupoftomato
Scratcher
Registered: 2009-07-18
Posts: 1000+

Re: BYOB 3 - Discussion Thread

markyparky56 wrote:

fullmoon wrote:

markyparky56 wrote:

But not the weirdest one, but the name I can not utter on the scratch forums.

Actually, I think the one you are referring to might have some competition: LOLCODE.

No, I mean this one I had to shorten the url. Warning, the name may be offensive to some people, I apologise, but you have been warned.

I clicked that link and now it's saved to the main computers Mozilla history. How do I erase?


I'm glad to think that the community will always be kind and helpful, the language will always be a fun and easy way to be introduced into programming, the motto will always be: Imagine, Program, Share - Nomolos

Offline

 

#928 2010-07-02 18:31:37

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

markyparky56 wrote:

But not the weirdest one

It would be weird to try to use that language for practical programming, but it's essentially the order code of the classic Turing machine, which Alan Turing invented to reason about computer programs.  For that purpose you want a language that's really simple, not a language that's really expressive, so your language isn't weird at all in that context.  Turing, for example, used that language to prove the Halting Theorem, which says that it's impossible to write a computer program that takes another computer program as input and determines, in finite time, whether that other program will halt (as opposed to infinitely looping) for a given input.  (You can detect loops in specific cases, but you can't write a loop detector that works for all possible programs.)

To bring this discussion slightly on topic: a contemporary of Turing, the mathematician Alonzo Church, invented at about the same time a language with a similar purpose--reasoning about programs--that turned out also to be very expressive (usable for practical programming): the lambda calculus!  (A/k/a THE BLOCK.)


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#929 2010-07-02 18:34:19

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

soupoftomato wrote:

I clicked that link and now it's saved to the main computers Mozilla history. How do I erase?

Tools>Clear Private History

or

Preferences>Advanced>Network>Clear Now
Preferences>Privacy>Clear Now


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#930 2010-07-02 18:38:52

soupoftomato
Scratcher
Registered: 2009-07-18
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

soupoftomato wrote:

I clicked that link and now it's saved to the main computers Mozilla history. How do I erase?

Tools>Clear Private History

or

Preferences>Advanced>Network>Clear Now
Preferences>Privacy>Clear Now

Thanks, but it was Tools>Clear Recent History


I'm glad to think that the community will always be kind and helpful, the language will always be a fun and easy way to be introduced into programming, the motto will always be: Imagine, Program, Share - Nomolos

Offline

 

#931 2010-07-02 18:50:40

soupoftomato
Scratcher
Registered: 2009-07-18
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Whenever I have tried to download updates, it gives me an Adobe Folder, that I can't open.  hmm

I've been stuck with 2.99.00 since release.


I'm glad to think that the community will always be kind and helpful, the language will always be a fun and easy way to be introduced into programming, the motto will always be: Imagine, Program, Share - Nomolos

Offline

 

#932 2010-07-02 19:08:21

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

soupoftomato wrote:

Whenever I have tried to download updates, it gives me an Adobe Folder, that I can't open.  hmm

That's strange.  Sounds like you have a bad association with some file extension.  What file can't it open, BYOB.image, or something else?

If BYOB.image, try right-clicking on it, choose "Open with" or "Send to" depending on OS, then choose BYOB.exe if you have it, or Scratch.exe in a pinch.  Or just drag BYOB.image onto one of those.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#933 2010-07-03 14:14:37

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

nXIII wrote:

I'll help! (You probably noticed my (very incomplete so far) thread)

Thanks!  I did notice it when you first started, when it was really incomplete, but I see you've made a lot of progress since then.  I'll read it seriously over the weekend.

No! Don't do that! I'm away over the weekend, (right now) so I can't work on it....


nXIII

Offline

 

#934 2010-07-03 14:19:44

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

Re: BYOB 3 - Discussion Thread

nXIII wrote:

bharvey wrote:

nXIII wrote:

I'll help! (You probably noticed my (very incomplete so far) thread)

Thanks!  I did notice it when you first started, when it was really incomplete, but I see you've made a lot of progress since then.  I'll read it seriously over the weekend.

No! Don't do that! I'm away over the weekend, (right now) so I can't work on it....

Now IS the weekend though... unless your already gone.


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

 

#935 2010-07-03 14:21:18

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

markyparky56 wrote:

nXIII wrote:

bharvey wrote:


Thanks!  I did notice it when you first started, when it was really incomplete, but I see you've made a lot of progress since then.  I'll read it seriously over the weekend.

No! Don't do that! I'm away over the weekend, (right now) so I can't work on it....

Now IS the weekend though... unless your already gone.

Hence "right now". I am away right now.

Jens wrote:

Great ideas, guys.

So, anybody care to work on Elements tools (nXIII, nudge nudge..?!), they're really incomplete. It's mostly GUI work, building morphic windows and dialog boxes etc. We need a better class browser and redo all the other tools (method browsers, inspectors and especially the debugger) to work with elements. It's actually not that hard as it sounds, but I'm severely lacking time, because Brian keeps me busy  smile

The way to save Elements (Smalltalk) code with a BYOB project then would be to just attach a changeset to it. A Smalltalk changeset is just some text that can be filed in again. Elements can already render any Smalltalk code into graphical blocks, so that part is already done.

When I get back...


nXIII

Offline

 

#936 2010-07-03 15:49:06

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Jens wrote:

It's mostly GUI work, building morphic windows and dialog boxes etc.

nXIII wrote:

When I get back...

If you're really going to work on this (as opposed to linked lists  sad  ), I think the issues are pedagogic as well as strictly GUI.  For example, the Smalltalk code behind a (primitive) block is in at least two different places: ScriptableScratchMorph>blockSpecs>blockSpecs and wherever the actual work is done (maybe three places if there is a Scratch-specific method that calls underlying Smalltalk stuff).  I think all of the relevant code should appear at once, in a single (paned) window, when you choose "edit Elements."

And somewhere there should be a "new primitive block" button that opens a BYOB-Make-a-block-like dialog in which you enter the block spec, not as text, but in pieces, actually almost identical to the Make-a-block dialog, so you choose a menu and you choose a shape etc.  And when you click OK on that dialog, that's when you get the Elements window, already positioned correctly for you to add the code that implements the method.  Maybe the initial dialog has two text fields, one for the surface appearance and one for the Smalltalk method name.  And instead of all-sprites vs this-sprite your choices are just-sprites, just-stage, or both.

And when you're browsing classes, you should get tooltips that explain from Scratch's point of view (i.e. not Smalltalk's) what this class is all about, to make it easier to find what you're looking for.  (Just recently I had occasion to look for where the Mac-specific file type and creator fields are set for projects and sprites, and I found it really hard.)

So you see, I think this is a little more work than Jens seems to think.  smile

PS Have a good vacation.  smile


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#937 2010-07-03 15:56:45

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Jens wrote:

It's mostly GUI work, building morphic windows and dialog boxes etc.

nXIII wrote:

When I get back...

If you're really going to work on this (as opposed to linked lists  sad  ), I think the issues are pedagogic as well as strictly GUI.  For example, the Smalltalk code behind a (primitive) block is in at least two different places: ScriptableScratchMorph>blockSpecs>blockSpecs and wherever the actual work is done (maybe three places if there is a Scratch-specific method that calls underlying Smalltalk stuff).  I think all of the relevant code should appear at once, in a single (paned) window, when you choose "edit Elements."

And somewhere there should be a "new primitive block" button that opens a BYOB-Make-a-block-like dialog in which you enter the block spec, not as text, but in pieces, actually almost identical to the Make-a-block dialog, so you choose a menu and you choose a shape etc.  And when you click OK on that dialog, that's when you get the Elements window, already positioned correctly for you to add the code that implements the method.  Maybe the initial dialog has two text fields, one for the surface appearance and one for the Smalltalk method name.  And instead of all-sprites vs this-sprite your choices are just-sprites, just-stage, or both.

And when you're browsing classes, you should get tooltips that explain from Scratch's point of view (i.e. not Smalltalk's) what this class is all about, to make it easier to find what you're looking for.  (Just recently I had occasion to look for where the Mac-specific file type and creator fields are set for projects and sprites, and I found it really hard.)

So you see, I think this is a little more work than Jens seems to think.  smile

PS Have a good vacation.  smile

Wow... thats a very confusing comment, but then Im totaly lost with Squeak!


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

 

#938 2010-07-03 20:31:24

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

markyparky56 wrote:

Wow... thats a very confusing comment

Basically what I'm saying is that a lot of the lore that you find in various people's how-to-mod tutorial threads ought to be visually apparent in Elements.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#939 2010-07-04 04:43:41

jstout
Scratcher
Registered: 2007-05-04
Posts: 39

Re: BYOB 3 - Discussion Thread

JSO wrote:

bharvey wrote:

Not a joke.  At various times in the past I've formed the intention of learning Smalltalk but always found the textbooks and/or the Squeak UI offputting.

Sad to say but it's the same for me  sad
Smalltalk is just so different from other programming languages...

I remember someone saying that Smalltalk needed about 6 months' work before you got the Aha! moment. I've come to the conclusion that you need a real project to really get up to speed since I've learnt more about using Smalltalk/Squeak in the last week or so since I've started adding to BYOB a Files category. I find Elements a little difficult to use since I'm a little prone to RSI when I use the mouse, so the normal Smalltalk/Squeak text based interface is much more productive for me.

After using it intensively I'd forgotten, in that old saying about ALGOL-60, just how much of an improvement Smalltalk was on most of its successors.

I'm doing a 2 minute nano-presentation to the UK's Computer At School's July conference in Birmingham at the end of next week on extending BYOB/Scratch, entirely in BYOB, using projects as live presentation slides, demonstrating the System Browser, showing a BYOB unless <predicate>, and then doing the same thing as a built in method. So I'll be using the system that I'm updating to do the presentation and the development, text editing, debugging (hopefully not needed), source code management, ... wish me luck! It's part of my push to use BYOB all the way up from using it with my 3 year old grandson to demonstrating functional programming with my 6th form (year 13 in the UK) students, then sideways into Smalltalk/Squeak to demonstrate OOP, then ...

There just isn't anything that I know of that gives me the same immediacy and single system approach (Oberon from Niklaus Wirth and Jürg Gutknecht at ETH is perhaps the closest: not surprisingly since I gather they were inspired to develop it by working at Xerox Parc).

John

Offline

 

#940 2010-07-04 09:02:03

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: BYOB 3 - Discussion Thread

jstout wrote:

JSO wrote:

bharvey wrote:

Not a joke.  At various times in the past I've formed the intention of learning Smalltalk but always found the textbooks and/or the Squeak UI offputting.

Sad to say but it's the same for me  sad
Smalltalk is just so different from other programming languages...

I remember someone saying that Smalltalk needed about 6 months' work before you got the Aha! moment. I've come to the conclusion that you need a real project to really get up to speed since I've learnt more about using Smalltalk/Squeak in the last week or so since I've started adding to BYOB a Files category. I find Elements a little difficult to use since I'm a little prone to RSI when I use the mouse, so the normal Smalltalk/Squeak text based interface is much more productive for me.

After using it intensively I'd forgotten, in that old saying about ALGOL-60, just how much of an improvement Smalltalk was on most of its successors.

I'm doing a 2 minute nano-presentation to the UK's Computer At School's July conference in Birmingham at the end of next week on extending BYOB/Scratch, entirely in BYOB, using projects as live presentation slides, demonstrating the System Browser, showing a BYOB unless <predicate>, and then doing the same thing as a built in method. So I'll be using the system that I'm updating to do the presentation and the development, text editing, debugging (hopefully not needed), source code management, ... wish me luck! It's part of my push to use BYOB all the way up from using it with my 3 year old grandson to demonstrating functional programming with my 6th form (year 13 in the UK) students, then sideways into Smalltalk/Squeak to demonstrate OOP, then ...

There just isn't anything that I know of that gives me the same immediacy and single system approach (Oberon from Niklaus Wirth and Jürg Gutknecht at ETH is perhaps the closest: not surprisingly since I gather they were inspired to develop it by working at Xerox Parc).

John

Use hacked BYOB, downloadable on the Slash site.

Offline

 

#941 2010-07-04 11:55:24

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

Re: BYOB 3 - Discussion Thread

Billybob-Mario wrote:

jstout wrote:

JSO wrote:


Sad to say but it's the same for me  sad
Smalltalk is just so different from other programming languages...

I remember someone saying that Smalltalk needed about 6 months' work before you got the Aha! moment. I've come to the conclusion that you need a real project to really get up to speed since I've learnt more about using Smalltalk/Squeak in the last week or so since I've started adding to BYOB a Files category. I find Elements a little difficult to use since I'm a little prone to RSI when I use the mouse, so the normal Smalltalk/Squeak text based interface is much more productive for me.

After using it intensively I'd forgotten, in that old saying about ALGOL-60, just how much of an improvement Smalltalk was on most of its successors.

I'm doing a 2 minute nano-presentation to the UK's Computer At School's July conference in Birmingham at the end of next week on extending BYOB/Scratch, entirely in BYOB, using projects as live presentation slides, demonstrating the System Browser, showing a BYOB unless <predicate>, and then doing the same thing as a built in method. So I'll be using the system that I'm updating to do the presentation and the development, text editing, debugging (hopefully not needed), source code management, ... wish me luck! It's part of my push to use BYOB all the way up from using it with my 3 year old grandson to demonstrating functional programming with my 6th form (year 13 in the UK) students, then sideways into Smalltalk/Squeak to demonstrate OOP, then ...

There just isn't anything that I know of that gives me the same immediacy and single system approach (Oberon from Niklaus Wirth and Jürg Gutknecht at ETH is perhaps the closest: not surprisingly since I gather they were inspired to develop it by working at Xerox Parc).

John

Use hacked BYOB, downloadable on the Slash site.

Why would he need to? As he just said, hes been adding to BYOB already, so he doesn't need a hacked version.


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

 

#942 2010-07-04 11:59:58

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

jstout wrote:

I remember someone saying that Smalltalk needed about 6 months' work before you got the Aha! moment. I've come to the conclusion that you need a real project to really get up to speed since I've learnt more about using Smalltalk/Squeak in the last week or so since I've started adding to BYOB a Files category.

My problem is not the "aha moment"; I've heard Alan Kay and Dan Ingalls talk about the big ideas enough times (live at PARC, originally, and for the past 20-odd years on video, because I play them for my SICP students) to feel comfortable with those.

But there's a skill set I don't have, of finding where in the maze of code something actually happens.  The other day I was looking for the Share menu (I'm making the BYOB standalone-app feature work on the Mac as well as on Windows) but couldn't find it after a day of looking, until I happened to see another Scratch forum thread in which someone asked and nXIII answered how to change the Scratch logo to something else, and that steered me to Scratch-UI-Panes>ScratchFrameMorph>compiler.  But I didn't get there by searching for "menu" or "share" and would have had to fall back on asking Jens if I hadn't found that serendipitous hint from n.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#943 2010-07-04 12:06:04

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

markyparky56 wrote:

Billybob-Mario wrote:

Use hacked BYOB, downloadable on the Slash site.

Why would he need to? As he just said, hes been adding to BYOB already, so he doesn't need a hacked version.

And, as Jens keeps saying, you can open the source in the current BYOB distribution with a one-line shell script/batch file, which he's posted repeatedly, and which (for forum-reading-impaired people) will be included in the beta release any day now (just a few packaging details flying back and forth by email).

We're all proud of you, Billybob, but it's time for you to stop posting that every time anyone talks about editing the implementation of BYOB!  smile


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#944 2010-07-04 12:43:50

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

I (almost) finished the Elements Inspector. I don't like the bottom pane, though, because it has to have a palette in it, which leaves too little room for coding. Should I just not include a palette and have the user drag in blocks from somewhere else?

EDIT: @Jens, I'm also having trouble with multiline UpdatingStringMorphs - they don't exist... do you mind if I add support for multiline strings?

Last edited by nXIII (2010-07-04 12:47:44)


nXIII

Offline

 

#945 2010-07-04 14:01:27

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

nXIII wrote:

I (almost) finished the Elements Inspector. I don't like the bottom pane, though, because it has to have a palette in it, which leaves too little room for coding. Should I just not include a palette and have the user drag in blocks from somewhere else?

Umm, sorry, I'm a little lost -- is there something I'm supposed to look at to see this palette problem?  Different from the Elements window we know and love?


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#946 2010-07-04 14:49:17

jstout
Scratcher
Registered: 2007-05-04
Posts: 39

Re: BYOB 3 - Discussion Thread

bharvey wrote:

jstout wrote:

I remember someone saying that Smalltalk needed about 6 months' work before you got the Aha! moment. I've come to the conclusion that you need a real project to really get up to speed since I've learnt more about using Smalltalk/Squeak in the last week or so since I've started adding to BYOB a Files category.

My problem is not the "aha moment"; I've heard Alan Kay and Dan Ingalls talk about the big ideas enough times (live at PARC, originally, and for the past 20-odd years on video, because I play them for my SICP students) to feel comfortable with those.

But there's a skill set I don't have, of finding where in the maze of code something actually happens.  The other day I was looking for the Share menu (I'm making the BYOB standalone-app feature work on the Mac as well as on Windows) but couldn't find it after a day of looking, until I happened to see another Scratch forum thread in which someone asked and nXIII answered how to change the Scratch logo to something else, and that steered me to Scratch-UI-Panes>ScratchFrameMorph>compiler.  But I didn't get there by searching for "menu" or "share" and would have had to fall back on asking Jens if I hadn't found that serendipitous hint from n.

I was reduced a couple of times to searching through the source code for a string I knew that would be in there (not available in Elements but in the Squeak/Smalltalk), but after a pretty intensive week or so I reckon that I've got to know the main categories, and I find that isolates where I should be looking.

So, to take your example in Elements Scratch then Scratch-UI-Panes class category for anything to do with the user interface, ScratchFrameMorph for the 'overall' UI, menu/button actions method category and then shareMenu: which shows the selector #makeExe as the one associated with the compiler. Then in Squeak/Smalltalk I just did a Smalltalk browseAllImplementorsOf: #makeExe.

I find the extra facilities in Squeak/Smalltalk outweigh the drag and drop Elements system, not just because of my RSI. The specialist browsers help as well.

John

Offline

 

#947 2010-07-04 17:53:28

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

jstout wrote:

Scratch then Scratch-UI-Panes class category for anything to do with the user interface,
John

How did you know it was Scratch-UI-Panes and not Scratch-UI-Dialogs, Scratch-UI-Watchers (okay, I guess that was unlikely), or Scratch-UI-Support?  I kept looking for a global search feature that would let me search for "compile" but at best I found the Smalltalk compiler rather than the (misnamed) BYOB app compiler.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#948 2010-07-04 19:16:08

jstout
Scratcher
Registered: 2007-05-04
Posts: 39

Re: BYOB 3 - Discussion Thread

bharvey wrote:

jstout wrote:

Scratch then Scratch-UI-Panes class category for anything to do with the user interface,
John

How did you know it was Scratch-UI-Panes and not Scratch-UI-Dialogs, Scratch-UI-Watchers (okay, I guess that was unlikely), or Scratch-UI-Support?  I kept looking for a global search feature that would let me search for "compile" but at best I found the Smalltalk compiler rather than the (misnamed) BYOB app compiler.

It's a bit difficult to remember my thought process but I think I just looked at the classes in each of the categories and decided that Dialogs looked like dialogs, e.g., NewVariableDialog, Support looked a little too low-level, and Watchers, I assumed from the name and the classes, were to do with variables.

As I say, in Squeak/Smalltalk off the more... option on the main screen menu there's a

Were you using Elements or Squeak/Smalltalk?

I've kept a Workspace open with the hints to remind me of what I've learnt (another thing you don't get with Elements), here's what's in it:

"
ScratchViewerMorph is the category pane and blocks viewer
Methods:
    rebuildCategorySelectors
"
(ScratchFrameMorph allInstances at: 1)  startup "This is the one to do to recreate the category and block panes"

"
ScratchFrameMorph is the Scratch screen
Methods:
    createBasicFrames
    startup

ScratchSkin at: #pen gives you the form for the category (or in fact anything) (class variable for ScratchFrameViewer?)
"
ScratchSkin at: #files put: (ScratchSkin at: #pen)

"World is a PasteUpMorph"

ScratchFrameMorph writeAllSkins    "writes out all the current skins to GIF format in current directory"

ScratchFrameMorph readSkinFrom: (FileDirectory default directoryNamed: 'ScratchSkin')
"reads them back in"

ScratchFrameMorph updateSkinFrom: (FileDirectory default directoryNamed: 'ScratchSkin')

"ScriptableScratchMorph has block specs"

"Also has blockColorFor: Made HSV for file ops yellowish: h: 58 s: 0.80 v: 1.00"
"Added category file ops"

ScratchListMorph exportList/importList are useful


Some of things are just there because I tried them and they worked and they don't seem to cause any major problems.

I could browse, put self halt. anywhere that I thought was relevant to a problem and try it. If I brought up a debugger window then I could trace through the execution, find out where it had come from and so on. I could try stuff in Workspaces and I knew that if I ruined something then I just needn't save the image and I'd still have a working system.

John

Offline

 

#949 2010-07-04 19:38:16

jstout
Scratcher
Registered: 2007-05-04
Posts: 39

Re: BYOB 3 - Discussion Thread

I know this one is a bit contentious but could I make a plea for the cloning blocks to be linked in? From the code I can see that the work is done, and they let you do some marvellous stuff.

I've done a Monte-Carlo estimate of PI: create a circle of radius 150, centred at (0,0) then create 10,000 clones of a dot sprite, when created each one moves to a random position within a square of side 300 centred at the origin, see if it's inside the circle, and if so change count by 1. The final count / 10,000 (OK, it's slow) is an estimate of pi/4.

A gas simulation: create 500 clones of a 'molecule' and start them wandering around. Collisions with the walls of the container cause 'pressure' and the molecules can bounce off themselves.

Most fun: for any sprite, define an explode block that clones the original a number of times, then the original hides itself. On creation each clone shrinks to 1/8 of its original size, then sends itself off a random direction (with gravity), getting smaller, and eventually vanishing and you've got an explosion.

I linked in cloneMe to cloneAndSend:, then implemented [clone me], clone me  [] times] on the basis of the code already there in ScratchSpriteMorph, category clone ops (all to do with creation and now termination of the current sprite's clones), and ScratchStageMorph, category clones (all to do with terminating clones). I added a [delete my clones] block to the former and a [deleteAllClonesOf: aScratchSpriteMorph] to the latter.

John

Offline

 

#950 2010-07-04 19:50:56

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

jstout wrote:

I know this one is a bit contentious but could I make a plea for the cloning blocks to be linked in?

I think this is one of those "wait for 3.1" things.  We don't want to introduce new bugs at this point, and I'm sure there'd be some.  smile   But we definitely want cloning.

Thanks for the Squeak hints.  (I'm using the Squeak browser, not Elements.)


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

Board footer