Ad
  • Custom User Avatar
  • Custom User Avatar

    Pretty frustrating that you basically have to to know that a certain function exists in order to do this...

  • Custom User Avatar

    Neither the description nor the example are very helpful for someone like myself who isn't well versed in graph theory.

    By the definition given, where a cycle is a permutation with two elements swapped, then the example would have way more than 3

    1. (start) [0, 2, 1, 5, 3, 4]
    2. [2, 0, 1, 5, 3, 4]
    3. [1, 2, 0, 5, 3, 4]
    4. [5, 2, 1, 0, 3, 4]
    5. [3, 2, 1, 5, 0, 4]
    6. [4, 2, 1, 5, 3, 0]

    That's 5 permutations right there with only two elements "trading places with one another".

  • Custom User Avatar

    Ahh, yea, my bad. Haskell

  • Custom User Avatar

    I don't understand what

    Falsified (after 2 tests and 4 shrinks):
      NonNegative {getNonNegative = 0.1}
    

    means, so I can't fix my code :(

  • Custom User Avatar

    I was eventually able to get it, but I think a link to a reference around monads would be helpful. I'm trying to understand them better myself, but unfortunately it's a lot of stuff like this where it's more or less "do monads" with no helpful instruction as to how to learn the concept. If I had any good ones I'd share, but still looking... Maybe they're Just Nothing ;)

    Addtionally, it took me way to long to figure out that the greaterThan function was inverse of how I first thought about it, could update the description with an example: greaterThan 5 -- True, the number you need to guess is greater than 5