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

#1 2008-08-29 15:20:27

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

Iteration Control Block

In this post, johnm explains that Scratch runs at about 30 iterations/second (30 frames/second for you Actionscript buffs) to let the user see how the program works. This means that programs like Cathair's Full Raytracer are painfully slow simply because Scratch is a teaching language by design. What I propose isn't really a radical change to the way Scratch works, just one loop block that would let more advanced users create programs like 3D rendering engines and list sorting methods if lists are included in 1.3.
http://i302.photobucket.com/albums/nn100/fullmoon32/speedBlock.gif
Blocks placed inside a "do at speed" loop would simply execute without the intentional pauses mentioned by johnm in the afformentioned post. This would avoid the "build-a-block" concept entirely, and could even benefit new Scratch users by giving them experience with the power of traditional programming languages. It's too late to add this to 1.3, and probably even 1.4, but I believe it would benefit Scratch greatly. Any suggestions?

Last edited by fullmoon (2008-08-29 15:21:11)


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

Offline

 

#2 2008-08-30 10:58:03

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

Re: Iteration Control Block

Hehe, fullmoon, I have actually created a "warp" block, which is a c-shaped block that runs its nested blocks at full throttle, like a single block. It's a little test-case to find out how custom-blocks built in Scratch could be executed. I'm just now in the process of finalizing some demos for it (e.g. a custom built if-on-edge-bounce block), then I might share the code...


Jens Mönig

Offline

 

#3 2008-08-30 11:37:42

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

Re: Iteration Control Block

Jens wrote:

Hehe, fullmoon, I have actually created a "warp" block, which is a c-shaped block that runs its nested blocks at full throttle, like a single block. It's a little test-case to find out how custom-blocks built in Scratch could be executed. I'm just now in the process of finalizing some demos for it (e.g. a custom built if-on-edge-bounce block), then I might share the code...

Please, share it! Please!


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

Offline

 

#4 2008-09-07 09:45:07

Spenfen
Scratcher
Registered: 2008-07-24
Posts: 37

Re: Iteration Control Block

Jens wrote:

Hehe, fullmoon, I have actually created a "warp" block, which is a c-shaped block that runs its nested blocks at full throttle, like a single block. It's a little test-case to find out how custom-blocks built in Scratch could be executed. I'm just now in the process of finalizing some demos for it (e.g. a custom built if-on-edge-bounce block), then I might share the code...

Please, oh please post the code! PLEASE PLEASE PLEASE!


The statement I am making right now is untrue. He he he he he...

Offline

 

#5 2008-09-21 13:33:25

Spenfen
Scratcher
Registered: 2008-07-24
Posts: 37

Re: Iteration Control Block

Please, Oh Please, Share The Code!


The statement I am making right now is untrue. He he he he he...

Offline

 

#6 2008-09-21 13:35:37

Spenfen
Scratcher
Registered: 2008-07-24
Posts: 37

Re: Iteration Control Block

Is it this type of block?
[blocks]http://scratch.mit.edu/forums/viewtopic.php?pid=70155#req_messagehttp://scratch.mit.edu/forums/viewtopic.php?pid=70155#req_message[/blocks]


The statement I am making right now is untrue. He he he he he...

Offline

 

#7 2008-09-21 13:37:26

Spenfen
Scratcher
Registered: 2008-07-24
Posts: 37

Re: Iteration Control Block

Sorry. i meant this:
[blocks]<end><forever>[/blocks]


The statement I am making right now is untrue. He he he he he...

Offline

 

#8 2008-09-28 10:57:16

Spenfen
Scratcher
Registered: 2008-07-24
Posts: 37

Re: Iteration Control Block

[blocks] <wait(0)secs> [/blocks] please


The statement I am making right now is untrue. He he he he he...

Offline

 

#9 2008-10-01 08:22:07

Spenfen
Scratcher
Registered: 2008-07-24
Posts: 37

Re: Iteration Control Block

Jens wrote:

Hehe, fullmoon, I have actually created a "warp" block, which is a c-shaped block that runs its nested blocks at full throttle, like a single block. It's a little test-case to find out how custom-blocks built in Scratch could be executed. I'm just now in the process of finalizing some demos for it (e.g. a custom built if-on-edge-bounce block), then I might share the code...

AAAAHH!!!! OH, PLEASE! PLE-HE-HEASE!


The statement I am making right now is untrue. He he he he he...

Offline

 

#10 2008-10-01 19:20:54

relyt12101
Scratcher
Registered: 2007-05-19
Posts: 500+

Re: Iteration Control Block

This may be one of the best block suggestions I have ever seen!

@Jens - That would be great! If it is in any usable condition then please share it.


http://img392.imageshack.us/img392/2860/pspbanneregg089deiy0.png

Offline

 

#11 2008-10-03 18:09:19

Spenfen
Scratcher
Registered: 2008-07-24
Posts: 37

Re: Iteration Control Block

Wait no! I meant this! [blocks]
<forever>
<end>
[/blocks]


The statement I am making right now is untrue. He he he he he...

Offline

 

#12 2008-10-03 18:10:45

Spenfen
Scratcher
Registered: 2008-07-24
Posts: 37

Re: Iteration Control Block

[blocks] <wait(0)millisecs> [/blocks] please!


The statement I am making right now is untrue. He he he he he...

Offline

 

#13 2008-10-22 20:27:16

Spenfen
Scratcher
Registered: 2008-07-24
Posts: 37

Re: Iteration Control Block

it seems like jens will never have wrote:

THE CODE TO THE WARP BLOCK!!!!!


The statement I am making right now is untrue. He he he he he...

Offline

 

#14 2008-10-22 21:37:14

shockwave
Scratcher
Registered: 2007-12-29
Posts: 64

Re: Iteration Control Block

Spenfen wrote:

Sorry. i meant this:
[blocks]<end><forever>[/blocks]

i'm afraid it is not. it would be nice, but confusing to work with.


=^..^= meow. Come look at Fact blaster or else.
http://scratch.mit.edu/projects/shockwave/2005372 • Also, my latest "educational" game, Cola Crisis:http://scratch.mit.edu/projects/shockwave/1702364

Offline

 

#15 2008-10-23 02:03:41

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

Re: Iteration Control Block

Hi Spenfen,

the "warp" feature has been incorporated in my "build your own block" (BYOB) prototype, only it's called "atomic" there instead of "warp". When you build your own block and set the "atomic" control to "on" your custom block is executed at the speed of a single block, including all internal loops. There are, however, two exceptions to this rule in the prototype: (1) a plain "forever" loop can never be atomic (but a "forever if" can), (2) timed blocks, such as waits, can also not be "warped" (because that wouldn't really make sense).

Please feel free to try that prototype (and its "atomic" feature)! I'd be interested to know if this is what you're looking for.


Jens Mönig

Offline

 

#16 2008-11-14 10:43:58

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Iteration Control Block

This problem is simple to fix the Scratch Team already has a fix to this! I will tell it to you lucky person(people) who  are reading this right now, first make this face  big_smile , second open Scratch, third move your mouse over the "extras" button but DO NOT CLICK YET!!!, fourth hold the "shift" button WHILE you press "extras", fifth click "set single stepping", finally/sixth set the script  speed to what you need! (Teehee! that rhymed!)


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#17 2008-11-14 14:06:07

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Iteration Control Block

henley wrote:

This problem is simple to fix the Scratch Team already has a fix to this! I will tell it to you lucky person(people) who  are reading this right now, first make this face  big_smile , second open Scratch, third move your mouse over the "extras" button but DO NOT CLICK YET!!!, fourth hold the "shift" button WHILE you press "extras", fifth click "set single stepping", finally/sixth set the script  speed to what you need! (Teehee! that rhymed!)

its only sped up, not at instant speed like its needed

Offline

 

#18 2008-11-14 19:25:09

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Iteration Control Block

yambanshee wrote:

henley wrote:

This problem is simple to fix the Scratch Team already has a fix to this! I will tell it to you lucky person(people) who  are reading this right now, first make this face  big_smile , second open Scratch, third move your mouse over the "extras" button but DO NOT CLICK YET!!!, fourth hold the "shift" button WHILE you press "extras", fifth click "set single stepping", finally/sixth set the script  speed to what you need! (Teehee! that rhymed!)

its only sped up, not at instant speed like its needed

Thats offline only.Its not permanant.

Offline

 

#19 2008-11-16 16:54:20

bhz
Scratcher
Registered: 2008-07-06
Posts: 100+

Re: Iteration Control Block

yambanshee wrote:

henley wrote:

This problem is simple to fix the Scratch Team already has a fix to this! I will tell it to you lucky person(people) who  are reading this right now, first make this face  big_smile , second open Scratch, third move your mouse over the "extras" button but DO NOT CLICK YET!!!, fourth hold the "shift" button WHILE you press "extras", fifth click "set single stepping", finally/sixth set the script  speed to what you need! (Teehee! that rhymed!)

its only sped up, not at instant speed like its needed

if it was instant, blocks like <move( - )steps> will make it move at a speed where the sprite will be invisible because of its amazing speed.

Offline

 

#20 2008-11-17 07:39:36

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Iteration Control Block

bhz wrote:

yambanshee wrote:

henley wrote:

This problem is simple to fix the Scratch Team already has a fix to this! I will tell it to you lucky person(people) who  are reading this right now, first make this face  big_smile , second open Scratch, third move your mouse over the "extras" button but DO NOT CLICK YET!!!, fourth hold the "shift" button WHILE you press "extras", fifth click "set single stepping", finally/sixth set the script  speed to what you need! (Teehee! that rhymed!)

its only sped up, not at instant speed like its needed

if it was instant, blocks like <move( - )steps> will make it move at a speed where the sprite will be invisible because of its amazing speed.

exactly, and as Keroro645 said, its only offline.

Offline

 

#21 2008-12-14 09:12:45

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Iteration Control Block

wow you just did 3 quotes...................................................


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#22 2008-12-14 09:20:09

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Iteration Control Block

henley wrote:

wow you just did 3 quotes...................................................

ive seen way more...

henley wrote:

yambanshee wrote:

yambanshee wrote:


Back to the subject, I still feel that mabye they want to add a Blocks Per Second feuter. This will make it possible to dramaticly increase preformance, but avoid confusion.

Last edited by yambanshee (2008-12-14 09:20:54)

Offline

 

#23 2008-12-14 09:22:31

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Iteration Control Block

are you on? you did that just one minute ago...... srry 2 minutes ago...... AWESOME!  big_smile   smile  YAY!


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#24 2008-12-14 09:24:14

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Iteration Control Block

yambanshee wrote:

henley wrote:

wow you just did 3 quotes...................................................

ive seen way more...

henley wrote:

yambanshee wrote:

Back to the subject, I still feel that mabye they want to add a Blocks Per Second feuter. This will make it possible to dramaticly increase preformance, but avoid confusion.

nice quotes .........................  big_smile


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

Board footer