I had working code (testing with my own scripts) until I copied my function into kixgolf_udf. I failed all the tests.

After checking the ini, it turns out you are passing permutation as a comma-delimited string. In the examples on page one it shows "35214" as a string. So I had written my code to accept a flat string for permutation.

In practice, I think this would be cleaner... "35214" instead of "3,5,2,1,4"

So needless to say I have a little rewriting to do. \:\)