Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Great solution, and so beautiful and powerful F# after 8 years of using C#.
Fixed.
This comment is hidden because it contains spoiler information about the solution
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."You can avoid creating a list (an extra O(N) operation) by doing
{ 0 .. n-1 }
instead of[ 0 .. n-1 ]
.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
, always0
or not writing anything at all). I'd expect people argue about this more than that one aesthetic distinction ;-)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 namedacc
have probably implemented this solution).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.
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.
The issue reported by DSchwettmann 11 months ago should NOT have been marked as "resolved", as the description:
[
should jump TO the corresponding]
, when in fact it should jump PAST it), AND[
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.This comment is hidden because it contains spoiler information about the solution
You must write your code in one line!
NO not really it's a very simple solution in F# very simple!
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.
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...