Ad
  • Custom User Avatar

    Should the type signature of def in Hints be SomeMonad SomeVariable -> Integer?

  • Custom User Avatar

    Oh sorry, I'm too naive(and yesterday I'm too tired to think about it).

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    The Greatest kata I have solved!

    Until this moment I can't believe these things in programming (types, classes, and so on) have so much to do with mathematics.

    Could someone tell me where (or how) to learn more about this?

  • Custom User Avatar

    Oh maybe I know how to do that. Thank you! :)

  • Custom User Avatar

    I know, but I don't know how to apply arguments to the block { having(5).fingers }. I can't understand why the block { having(5).fingers } accepts no arguments (instead of { |x| having(5).fingers.call(x) }).

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Is the C++ test wrong?

    It always exited prematurely with a SIGSEGV signal.

    When I run the sample test code on my computer, it seems that in the code(Sample Test, Line29)

    for (int i = 0; i < 4; ++i) if (memcmp (puzzle[i], expected[i], 4*sizeof (int))) return 0;
    

    I create int ans[4][4] and return it, gdb tells me that in equal, puzzle is (int **) 0x5555557913a0 <ans> but *puzzle is 0x300000001, **puzzle is Cannot access memory.

    It seems that something goes wrong with int**. Shouldn't it be (int(*)[4])? Or how can I create a array to make it?