This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.
  • Index
  •  » Suggestions
  •  » Make forever, forever if and repeat faster by using conditional yields

#1 2008-08-26 19:33:30

deerel
Scratcher
Registered: 2008-08-23
Posts: 89

Make forever, forever if and repeat faster by using conditional yields

That is, replace unconditional yields you put in stack under blocks to be run and on top of rerun iteration block with conditional yields, which take place only when needed.
One robust solution is to have a flag "do conditional yields", set it to false at the beginning of each step for a process, and set it to true when any of mentioned iteration block is processed (that is, those 3 things are put in the stack). If the body runs to the end, the flag is true and yield takes place. If the body is yielded by any other means, in the subsequent step the flag will be false and new iteration will immediately take place.

Last edited by deerel (2008-08-26 19:34:12)

Offline

 

#2 2008-08-30 09:35:31

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

Re: Make forever, forever if and repeat faster by using conditional yields

There were some stack control blocks in an older version of Scratch, but I don't think the IMAGE files are avaliable.


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

Offline

 

#3 2008-08-30 10:52:55

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Make forever, forever if and repeat faster by using conditional yields

You can actually make Scratch run super-fast, by shift clicking on the extras menu, and selecting "turbo speed" under the set-single-stepping option. It's probably a lot faster than you can handle, though...


Jens Mönig

Offline

 

#4 2008-10-15 10:59:55

deerel
Scratcher
Registered: 2008-08-23
Posts: 89

Re: Make forever, forever if and repeat faster by using conditional yields

Jens wrote:

You can actually make Scratch run super-fast, by shift clicking on the extras menu, and selecting "turbo speed" under the set-single-stepping option. It's probably a lot faster than you can handle, though...

Jens, it's not about getting it superfast in development environment, it's about eliminating unneccessary infrastructure cost in real run... so that one can use broadcast and wait without considering "hm, if I use this, my project gets 2x slower..."

Last edited by deerel (2008-10-15 11:02:17)

Offline

 
  • Index
  •  » Suggestions
  •  » Make forever, forever if and repeat faster by using conditional yields

Board footer