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

#26 2012-07-16 15:23:54

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

Re: Scratch crashed my computer!!!

3sal2 wrote:

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).

A scripting problem which caused his computer to crash.


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

Offline

 

#27 2012-07-16 15:31:28

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

Re: Scratch crashed my computer!!!

3sal2 wrote:

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.

2 things.
1. That doesn't work for n>170 due to size limits. (see here for an infinite one)
2. Even though you "mirrored" the function for negatives, there actually is an extension of factorials to negatives (and decimals). See
http://mathworld.wolfram.com/GammaFunction.html


"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

 

#28 2012-07-16 16:24:52

thebriculator
Scratcher
Registered: 2011-07-11
Posts: 500+

Re: Scratch crashed my computer!!!

Once I was experimenting with FPS, using a script similar to

forever
reset timer
set [fps v] to ((1)/(timer))
end
and my whole computer crashed.
I though it was scratch, but it turned out my laptop overheated.
maybe that's the same with you.


.     http://tiny.cc/2cwgpw    http://tiny.cc/viwgpw    http://tiny.cc/iwwgpw

Offline

 

Board footer