Download [factorial] for Pd. Source included with Mac binary:
[factorial] for Pd
Cool object. This is a late response but I was checking out your code and wound up making a bunch of changes to it to address 3 bugs I found:
- 1 - [n! ] doesn't instantiate on its own. it needs a prior instantiation of [factorial] to load. Normally to fix that, what you'd do is make a copy of the binary and rename it to n!.pd_darwin, but there still needs to be a setup function with the object's name in it, or a function that's just called "setup", which you should probably try to avoid just because it's not very self-documenting.
- 2 - It doesn't successfully find the help file. Pd automatically adds "-help" or "-help.pd" on its own. It also automatically creates a help file reference. The sethelpsymbol function is pretty much only good for when you have multiple objects of different classes that need to refer to a common help file.
- 3 - It freezes and sometimes crashes pd if it's fed a really big number, because it'll start looping endlessly..
Thanks for the feedback. In reverse order:
- Yes, big numbers will be tough to handle. You could cap, if you want.
- Good catch. Yes, I'm aware.
- This is the expected behavior with class_addcreator as I understand. Copying a binary seems like a clunky fix to me.
hi, there's a factorial function also in [expr], is there any difference with this?