fengzhangli / blockly

Automatically exported from code.google.com/p/blockly
0 stars 0 forks source link

The turtle stops before all code was executed #135

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. In turtle graphics app: make a many-times-repeated loop, as in 
http://blockly-demo.appspot.com/static/apps/turtle/en.html#jqz7gr - the turtle 
will stop before the end of the code. It looks like there is a maximum of code 
steps at about 100000.

What is the expected output? What do you see instead?
The code is not executed till the end. I put "hide turtle" as the last command, 
so I can be sure that the last command was not executed.

What browser are you using?
It happens both in Chromium 24.0.1310.0 (164555) and Firefox 19.0.2

Please provide any additional information below.
I was trying to render the Mandelbrot set - so I needed this large amount of 
code steps.  BTW this is my attempt of Mandelbrot set: 
http://blockly-demo.appspot.com/static/apps/turtle/en.html#v5vxj4

Original issue reported on code.google.com by perc...@gmail.com on 30 Mar 2013 at 8:51

GoogleCodeExporter commented 8 years ago
My guess is that the program is being incorrectly categorized as being in an 
infinite loop and halted.

It should be simple enough to write a routine that detects whether a given 
program ever halts.

Original comment by sper...@google.com on 31 Mar 2013 at 6:49

GoogleCodeExporter commented 8 years ago
> BTW this is my attempt of Mandelbrot set:

Oh. My. God.

> My guess is that the program is being incorrectly categorized as being in an 
infinite loop and halted.

Correct.  The current limit of 100,000 needs to be increased by a factor of 
ten.  I've done an unreviewed quick push that gives us a million iterations.

> It should be simple enough to write a routine that detects whether a given 
program ever halts.

Mr Turing would like to have a word with you.  :)

Original comment by neil.fra...@gmail.com on 31 Mar 2013 at 7:12

GoogleCodeExporter commented 8 years ago
Committed in r725.

Original comment by neil.fra...@gmail.com on 31 Mar 2013 at 8:37

GoogleCodeExporter commented 8 years ago
Thank you very much for this fix! My Mandlebrot is complete now :-)

However, I would vote for some message informing the user, that the turtle was 
exhausted after a million of steps and needed to stop. Otherwise he could spend 
some time with pointless debugging of his code... (like me).

(The complete, polished Mandelbrot! 
http://blockly-demo.appspot.com/static/apps/turtle/en.html#pvjv3f)

Original comment by perc...@gmail.com on 31 Mar 2013 at 10:49

GoogleCodeExporter commented 8 years ago
For reference, your (epic) Mandelbrot program has been moved here:
https://blockly-games.appspot.com/turtle?level=10#c8wh76
The new Blockly Games executes much faster.  It also has no execution limit at 
all, meaning programs will execute indefinitely.

We will be shutting down the old apps/turtle application shortly, now that 
Blockly Games is up and running.

Original comment by neil.fra...@gmail.com on 10 Nov 2014 at 7:49