Ad
  • Custom User Avatar

    I suddenly feel like a monkey with a typewriter

  • Custom User Avatar

    [Javascript]

    Implementing Maybe.do is much easier once you have the details!

    m is a list of arguments- m[0] is the Maybe Monad and m[1...] are functions of signature value -> value.

  • Custom User Avatar

    Last two C# tests are broken. Three spaces must be turned into a single space in the output, but the whitespaces in the input string and the expected result are not consistent.
    Here's what you get for the two tests- I've used * to denote a space.
    The rest of the tests pass, and some use whitespace so it isn't a corner case.
    input string: ..*
    Expected: "EE"
    But was: "EE"

    input string: ...---...-.-.---.....--.-..-..-.-.-.--....-.---.---...-.----..-.---..---.--....---...-..-.-......-...---..-.---..-----.*.-.-.-**
    Expected: "SOS! THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG."
    But was: "**SOS! THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG." (only the first two spaces were incorrect)

  • Custom User Avatar

    For the F# version, I was annoyed by the two aspects:

    1. That the tests rely on a "addShape" function that is not mentioned in the challenge or defined by the test code.
    2. That, by relying on the above method to construct a list by mutable tail concactenation, it is not possible to write performant, idiomatic F# (ie. build the list and then optionally call List.rev)

    The order of the input list shouldn't matter at all to the test, and yet it clearly does in this case.