Discuss Scratch

Deerleg
Scratcher
1000+ posts

Add 'factorial' to list of formulas

I would like ‘factorial’ to be added to the list of formulas.
It could look like this:
factorialof9
(That was supposed to be green.)

Last edited by Deerleg (March 21, 2014 01:17:17)

jontmy00
Scratcher
500+ posts

Add 'factorial' to list of formulas

Deerleg wrote:

I would like ‘factorial’ to be added to the list of formulas.
It could look like this:
factorialof9category=operators
(That was supposed to be green.)
Support, and fixed!
Firedrake969
Scratcher
1000+ posts

Add 'factorial' to list of formulas

Support, but how would it respond to negatives?
workaround:

definefactorialnumifnum>0setreturnto1setitonumrepeatnumsetreturntoi*returnchangeiby-1

Or something of the sort, haven't tested, but it should work relatively well.

Last edited by Firedrake969 (March 26, 2014 22:43:55)

ProdigyZeta7
Scratcher
1000+ posts

Add 'factorial' to list of formulas

Support. But like firedrake said, it wouldn't work with negatives or decimals, and it has a relatively easy workaround.
savaka
Scratcher
1000+ posts

Add 'factorial' to list of formulas

Support!
DadOfMrLog
Scratcher
1000+ posts

Add 'factorial' to list of formulas

If you want to know how to generalise factorials to non-integer values (and negatives, and even complex), read up about the gamma function.

I guess a factorial operator would be nice for convenience, but I think it's a simple enough workaround that it's actually a good place for someone to start learning how to script such things. (Also there are other operators I think would be much more useful to have first, primarily for efficiency concerns - in particular “letters M to N of STRING”)…

Last edited by DadOfMrLog (March 22, 2014 14:56:14)

davidkt
Scratcher
1000+ posts

Add 'factorial' to list of formulas

Support!
veryyoungguy
Scratcher
62 posts

Add 'factorial' to list of formulas

supportsupportsupportsupportsupportsupportsupportsupportsupportsupportsupportsupportsupport
ExtremeLogic
Scratcher
500+ posts

Add 'factorial' to list of formulas

Support. And in the help section on the right (in the project editor), there should be something that explains what (a?) factorial is (for younger Scratchers), in case they don't know what it is (no one really cares to know this stuff when they're young).
Deerleg
Scratcher
1000+ posts

Add 'factorial' to list of formulas

ExtremeLogic wrote:

Support. And in the help section on the right (in the project editor), there should be something that explains what (a?) factorial is (for younger Scratchers), in case they don't know what it is (no one really cares to know this stuff when they're young).
Then there should be one for everything else.
Deerleg
Scratcher
1000+ posts

Add 'factorial' to list of formulas

bump
drmcw
Scratcher
1000+ posts

Add 'factorial' to list of formulas

Deerleg wrote:

I would like ‘factorial’ to be added to the list of formulas.
Could you explain why?
dracae
Scratcher
1000+ posts

Add 'factorial' to list of formulas

No support.

First of all, it's not even that hard to implement this function my your self.
There are already many projects (and even a reply here) that show workarounds.

Second of all, this isn't very useful. I can't see how this could be used in art, or games, or animations. Who really needs this block?

Hopefully I don't sound TOO harsh :P, but again, I don't support.
Deerleg
Scratcher
1000+ posts

Add 'factorial' to list of formulas

drmcw wrote:

Deerleg wrote:

I would like ‘factorial’ to be added to the list of formulas.
Could you explain why?
I need it for my calculator.
Firedrake969
Scratcher
1000+ posts

Add 'factorial' to list of formulas

Changed my mind. No support, since there's an easy workaround like said.

Last edited by Firedrake969 (March 26, 2014 22:43:38)

AonymousGuy
Scratcher
1000+ posts

Add 'factorial' to list of formulas

Deerleg wrote:

I need it for my calculator.
*Sigh*

What else would it be used for? If it's only for a calculator project, then that's kinda project-specific…
TheLogFather
Scratcher
1000+ posts

Add 'factorial' to list of formulas

Firedrake969 wrote:

Support, but how would it respond to negatives?
workaround…

Firedrake969 wrote:

No support, since there's an easy workaround like said.
How very… quantum.

Last edited by TheLogFather (March 26, 2014 22:38:11)

Firedrake969
Scratcher
1000+ posts

Add 'factorial' to list of formulas

TheLogFather wrote:

Firedrake969 wrote:

Support, but how would it respond to negatives?
workaround…

Firedrake969 wrote:

No support, since there's an easy workaround like said.
How very… quantum.
Oops. I changed my mind…. I should put that
drmcw
Scratcher
1000+ posts

Add 'factorial' to list of formulas

Deerleg wrote:

drmcw wrote:

Deerleg wrote:

I would like ‘factorial’ to be added to the list of formulas.
Could you explain why?
I need it for my calculator.
The reason I asked and others have picked up is that factorial is easy to write but with limited uses. The typical uses being probability and being able to boast that my calculator can calculate 70! but yours only does 69! kind of bragging.
derpmeup
Scratcher
1000+ posts

Add 'factorial' to list of formulas

Deerleg wrote:

I would like ‘factorial’ to be added to the list of formulas.
It could look like this:
factorialof9
(That was supposed to be green.)

Support! Even though you can make it with a custom block, it's easier to just have it there for you.

Powered by DjangoBB