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.
Offline
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)) secsYou 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
Offline
Once I was experimenting with FPS, using a script similar to
forever reset timer set [fps v] to ((1)/(timer)) endand my whole computer crashed.
Offline