Ad
  • Custom User Avatar

    OK, got it. I was running into an unexpected "feature" of reduce that I was unaware of.

    Inelegantly solved. Thanks for your help.

  • Custom User Avatar

    I thought it would count as an issue as it was giving an error message rather than simply telling me that the code failed a test. I don't get this error message in the REPL on my own machine so it seems to be particular to the site. But I take your point!

    I doubt that the reduce function is the issue, given that it passes all the random tests, but I'll try and alternative solution so see if that works better. Out of interest, how many tests are there under the should work for some examples section? I see four passing tests, then an error message, then all the random tests passing. Is it failing on the fifth test maybe?

  • Custom User Avatar

    I'm trying to do this kata in F#. My code passes the sample tests and all the random tests but it gives the following cryptic error message when doing the first part of the automated tests:

    at Microsoft.FSharp.Collections.ListModule.Reduce[T] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] reduction, Microsoft.FSharp.Collections.FSharpList`1[T] list) [0x00033] in <58dd0ce1dff9fae1a7450383e10cdd58>:0 
      at FSI_0001.convertFracts (Microsoft.FSharp.Collections.FSharpList`1[T] ls) [0x0001e] in <720d59d74cd84494a7b9368e1d8c4c7c>:0 
      at FSI_0001+Tests.testing (Microsoft.FSharp.Collections.FSharpList`1[T] ls, Microsoft.FSharp.Collections.FSharpList`1[T] exp) [0x00001] in <720d59d74cd84494a7b9368e1d8c4c7c>:0 
      at FSI_0001+Tests+suite@35.Invoke (Microsoft.FSharp.Core.Unit _arg1) [0x0022b] in <720d59d74cd84494a7b9368e1d8c4c7c>:0 
      at Fuchu.Impl+evalTestList@260-1.Invoke (System.Tuple`2[T1,T2] tupledArg) [0x00028] in <56a815db36d21f70a7450383db15a856>:0
    

    I can't tell from this if there is a problem with my code (an edge case I've not considered) or if there's a problem with the tests themselves. Can someone please clarify this?

  • Custom User Avatar

    The tests for JavaScript are incomplete and are accepting incorrect submissions. For example, if we try to calculate decompose (9927447), the second-from-top submission returns the incorrect answer [ 1, 2, 3, 5, 6, 7, 88, 4455, 9927446 ], the third returns the correct answer [ 1, 3, 17, 87, 4455, 9927446 ], while the top answer causes a stack overflow!

    I only discovered this after my incorrect algorithm was accepted, but the R version failed the unit tests.

  • Custom User Avatar

    There's a problem with the sample tests for R. I got the following error with the second test:

    Test Failed
    abs(rolldice_sum_prob(8, 2) - 0.13888888889) is not less than 1e-12. Difference: 1.11e-13

    But the same code passed the final tests.

  • Custom User Avatar

    The tests don't match the specifications. Most of the accepted answers for JavaScript would fail if the tests actually tested for punctuation.

  • Custom User Avatar

    The tests for R are broken. The basic tests look for the function sum_mult(), but the main tests look for sum_mul().