Ad
  • Custom User Avatar

    Great solution, and so beautiful and powerful F# after 8 years of using C#.

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    Hm... I grasped (wrong guess, according to your comment) from the details page, that we should put 0 under the pointer.

    The last part of the explanation of , operator: "If the end-of-file has been reached, outputs a zero to the bit under the pointer."

  • Custom User Avatar

    You can avoid creating a list (an extra O(N) operation) by doing { 0 .. n-1 } instead of [ 0 .. n-1 ].

  • Custom User Avatar

    Well, the count of instructions executed isn't tested AFAIK, so practically it doesn't really matter.

    Besides, there are things that matter more ;-) Like, what should be done if the input stream is exhausted and a , is attempted? It's undefined even in the original BF, and implementations choose all kinds of possible results (always -1, always 0 or not writing anything at all). I'd expect people argue about this more than that one aesthetic distinction ;-)

  • Custom User Avatar

    This will be O(N^2) and can overflow the stack. There's a better solution that's O(N) and cannot overflow the stack; it involves creating an inner loop function that takes an accumulated-result parameter. (If you look at the other solutions to this problem, any that define an inner function with a parameter named acc have probably implemented this solution).

  • Custom User Avatar

    True enough that it's functionally identical in this case; it's the third test in the series where the count of instructions executed actually matters to the result.

    But it still bothers me that the test description is incorrect, and that 1-kyu and 2-dan people are casually dismissing an incorrect description. Correct test instructions matter, even if the results would be identical.

    Difference in philosophy, I guess.

  • Custom User Avatar

    No, it's not. It's functionally identical no matter you jump across the ] or pass it.

    Please don't raise issues on things that literally does not affect anything. It's a suggestion.

  • Custom User Avatar

    The issue reported by DSchwettmann 11 months ago should NOT have been marked as "resolved", as the description:

    1. Is still unclear (it implies that [ should jump TO the corresponding ], when in fact it should jump PAST it), AND
    2. Is wrong! The official Boolfuck site describes [ as "If the value under the pointer is zero, jumps forward, just past the matching ] character" (Emphasis mine).

    The description needs to be revised to give the correct instructions for the [ character. The number of people who have successfully completed this kata is irrelevant to this issue, since the description does not match the actual behavior and is therefore, quite simply, wrong.

  • Custom User Avatar

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

  • Custom User Avatar

    You must write your code in one line!

  • Custom User Avatar

    NO not really it's a very simple solution in F# very simple!

  • Custom User Avatar

    OK, maybe I am wrong thinking a bit of search doesn't harm. Anyway since two days the "Setup solution" had been modified with "open System", just aafter my previous post.

  • Custom User Avatar

    You're overly defensive over everything about your katas, g964.

    There are times to be defensive (e.g people claiming issues when their code is wrong). This is not one of them.

    You can literally just change 1 character and resolve the potential confusion. Why not do it? It's not contributing to anything, and now you're just saying "but this is part of the 'difficulty'". It doesn't hold water at all.

  • Loading more items...