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

#1 2012-07-13 17:46:18

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Scratch crashed my computer!!!

I was making a factorial script, like this:

when gf clicked
ask [something] and wait
set [input v] to (answer)
set [data v] to (answer)
repeat until << (data) = [0] > or < (data) < [1] >>
     set [data v] to ((data)*((data)-(1)))
     change [data v] by [-1]
And that's my script.  Input and another variable, Output, were showing.  Data was not.  I tried to look at Data and it make my computer crash.

Last edited by Firedrake969 (2012-07-13 17:47:56)


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#2 2012-07-13 17:51:30

GreenCloud
New Scratcher
Registered: 2012-07-12
Posts: 46

Re: Scratch crashed my computer!!!

Did you set a effect or something like that to data?

Offline

 

#3 2012-07-13 17:52:00

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Scratch crashed my computer!!!

An effect?  Like what?


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#4 2012-07-13 17:55:31

GreenCloud
New Scratcher
Registered: 2012-07-12
Posts: 46

Re: Scratch crashed my computer!!!

like turn [] degrees, change x by [], change size by [], set [ v] effect to [], etc.

Offline

 

#5 2012-07-13 17:56:35

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Scratch crashed my computer!!!

No... I had no movement blocks.  That one script was my only script.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#6 2012-07-13 18:05:56

GreenCloud
New Scratcher
Registered: 2012-07-12
Posts: 46

Re: Scratch crashed my computer!!!

Hm...
Were you running it when the crash happened...

Offline

 

#7 2012-07-13 18:06:48

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Scratch crashed my computer!!!

Sometimes computers crash for other reasons so we can't even be sure it was caused by Scratch.

But I think that maybe the "data" variable was set to an incredibly large number and showing it used up all of Scratch's memory.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#8 2012-07-13 18:09:15

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Scratch crashed my computer!!!

No.  I set the input as five.  5*4*3*2*1 is only 144.  Anyways, it once was at infinity when it was variable*variable.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#9 2012-07-13 18:11:15

GreenCloud
New Scratcher
Registered: 2012-07-12
Posts: 46

Re: Scratch crashed my computer!!!

Wes64 wrote:

Sometimes computers crash for other reasons so we can't even be sure it was caused by Scratch.

But I think that maybe the "data" variable was set to an incredibly large number and showing it used up all of Scratch's memory.

Um...
WAIT...

I recreated this script, and a colored wheel replaced the mouse pointer...

That means it's thinking, and not responding...

Offline

 

#10 2012-07-13 18:13:31

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Scratch crashed my computer!!!

Firedrake969 wrote:

No.  I set the input as five.  5*4*3*2*1 is only 144.  Anyways, it once was at infinity when it was variable*variable.

That isn't how your script works.
Data input is 5
5*4 = 20
Data is set to 20 and changed by -1.
19*18 = 342
Data is set to 342 and changed by -1.
342*341 = 116622
Data is set to 116622 and changed by -1.
116622*116621 = a lot

And the number keeps getting bigger and bigger, which drained your memory.

Last edited by Wes64 (2012-07-13 18:14:38)


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#11 2012-07-13 18:15:27

GreenCloud
New Scratcher
Registered: 2012-07-12
Posts: 46

Re: Scratch crashed my computer!!!

Wes64 wrote:

Firedrake969 wrote:

No.  I set the input as five.  5*4*3*2*1 is only 144.  Anyways, it once was at infinity when it was variable*variable.

That isn't how your script works.
Data input is 5
5*4 = 20
Data is set to 20 and changed by -1.
19*18 = 342
Data is set to 342 and changed by -1.
342*341 = 116622
Data is set to 116622 and changed by -1.
116622*116621 = a lot

And the number keeps getting bigger and bigger, which drained your memory.

Until it reaches infinity, of course...

Offline

 

#12 2012-07-13 18:40:29

Molybdenum
Scratcher
Registered: 2012-06-17
Posts: 1000+

Re: Scratch crashed my computer!!!

GreenCloud wrote:

Wes64 wrote:

Firedrake969 wrote:

No.  I set the input as five.  5*4*3*2*1 is only 144.  Anyways, it once was at infinity when it was variable*variable.

That isn't how your script works.
Data input is 5
5*4 = 20
Data is set to 20 and changed by -1.
19*18 = 342
Data is set to 342 and changed by -1.
342*341 = 116622
Data is set to 116622 and changed by -1.
116622*116621 = a lot

And the number keeps getting bigger and bigger, which drained your memory.

Until it reaches infinity, of course...

And then makes scratch close: http://wiki.scratch.mit.edu/wiki/Making_Scratch_Close
Anyway, factorials are more suited for bignums, like this.

PS. 5*4*3*2*1 is 120, not 144.


"The Enrichment Center is required to remind you that you will be baked, and then there will be cake."
(|Balls and Platforms: Stay on!|) (|NaOS-H: An operating system... Or is it?|)

Offline

 

#13 2012-07-13 19:14:56

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Scratch crashed my computer!!!

Molybdenum wrote:

GreenCloud wrote:

Wes64 wrote:


That isn't how your script works.
Data input is 5
5*4 = 20
Data is set to 20 and changed by -1.
19*18 = 342
Data is set to 342 and changed by -1.
342*341 = 116622
Data is set to 116622 and changed by -1.
116622*116621 = a lot

And the number keeps getting bigger and bigger, which drained your memory.

Until it reaches infinity, of course...

And then makes scratch close: http://wiki.scratch.mit.edu/wiki/Making_Scratch_Close
Anyway, factorials are more suited for bignums, like this.

PS. 5*4*3*2*1 is 120, not 144.

Oops.  My mistake.  Anyways, my computer HAS gone to infinity before.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#14 2012-07-14 11:48:01

3sal2
Scratcher
Registered: 2012-03-22
Posts: 100+

Re: Scratch crashed my computer!!!

Script bug. Move to Help With Scripts.


http://scratch.mit.edu/static/projects/3sal2/3120946_sm.png In 2012, scientists at the LHC discovered the Higgs boson, which explains the source of the masses of the W+, W-, and Z bosons, as well as fermions.

Offline

 

#15 2012-07-14 19:19:37

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Scratch crashed my computer!!!

Ok.  Anyways, what happened?


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#16 2012-07-14 19:21:44

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Scratch crashed my computer!!!

3sal2 wrote:

Script bug. Move to Help With Scripts.

Yeah, its a BUG. This is a forum for BUGS and glitches. Trust me, its in the right place.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#17 2012-07-14 19:23:20

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Scratch crashed my computer!!!

Firedrake969 wrote:

Ok.  Anyways, what happened?

The malfunctioning script caused scratch to force-quit.

Scratch Wiki wrote:

This script will fill Squeak's memory, and will force it to close. Squeak automatically crashes when a variable reaches a very high amount as it doesn't have the memory to maintain it. Since Scratch runs within the Squeak environment, Scratch closes when the Squeak environment closes. If a high RAM has been allotted to Scratch, it may just say "Infinity", and not close.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#18 2012-07-14 19:28:38

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Scratch crashed my computer!!!

Wes64 wrote:

Firedrake969 wrote:

Ok.  Anyways, what happened?

The malfunctioning script caused scratch to force-quit.

Scratch Wiki wrote:

This script will fill Squeak's memory, and will force it to close. Squeak automatically crashes when a variable reaches a very high amount as it doesn't have the memory to maintain it. Since Scratch runs within the Squeak environment, Scratch closes when the Squeak environment closes. If a high RAM has been allotted to Scratch, it may just say "Infinity", and not close.

I wrote that part about the "Infinity".   tongue   Anyways, it normally goes to infinity...


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#19 2012-07-14 19:33:12

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Scratch crashed my computer!!!

Maybe something else -- some other program -- was using a lot of memory so squeak had less to work with.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#20 2012-07-14 19:38:11

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Scratch crashed my computer!!!

I wasn't using anything but Scratch...


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#21 2012-07-14 19:40:32

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Scratch crashed my computer!!!

Oh well, just dont ramp a variable up to infinity in the future and you should be fine.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#22 2012-07-14 19:41:02

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Scratch crashed my computer!!!

I'll try again and see if it crashes.

Edit:  It did, but i was running 3 tabs in chrome and a tab in IE.

Last edited by Firedrake969 (2012-07-14 19:42:55)


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#23 2012-07-15 11:43:14

jackrulez
Scratcher
Registered: 2009-08-01
Posts: 1000+

Re: Scratch crashed my computer!!!

*low whistle*

You, sir, have created the doomsday script.


Yawn, another boring text signature. I should really make something better.

Offline

 

#24 2012-07-16 14:56:17

3sal2
Scratcher
Registered: 2012-03-22
Posts: 100+

Re: Scratch crashed my computer!!!

Wes64 wrote:

3sal2 wrote:

Script bug. Move to Help With Scripts.

Yeah, its a BUG. This is a forum for BUGS and glitches. Trust me, its in the right place.

No it isn't (It's about a scripting problem).


http://scratch.mit.edu/static/projects/3sal2/3120946_sm.png In 2012, scientists at the LHC discovered the Higgs boson, which explains the source of the masses of the W+, W-, and Z bosons, as well as fermions.

Offline

 

#25 2012-07-16 15:14:39

3sal2
Scratcher
Registered: 2012-03-22
Posts: 100+

Re: Scratch crashed my computer!!!

The correct script is:

when gf clicked
set [n! v] to [1]
ask [Number?] and wait
set (n) to (answer)
if <(n) > [0]>
set [m v] to [1]
repeat ((n) - (1))
change [m v] by (1)
set [n! v] to ((n!) * (m))
end
else
if <(n) < [0]>
set [m v] to [-1]
repeat (([abs v] of (n)) - (1))
change [m v] by (-1)
set [n! v] to ((n!) * (m))
end
end
end
say (join [The answer is ] (n!)) for ((length of (join [The answer is ] (n!)))/ (10)) secs
You just built your script wrong.

Last edited by 3sal2 (2012-07-16 15:25:06)


http://scratch.mit.edu/static/projects/3sal2/3120946_sm.png In 2012, scientists at the LHC discovered the Higgs boson, which explains the source of the masses of the W+, W-, and Z bosons, as well as fermions.

Offline

 

Board footer