I'd like to point out that dividing by 3 is not the correct way to convert RGB to grayscale, and maybe it's best if it accepts a 2d array of singular grey values instead.
This one sample test is not enough for users to figure out what to do. I'm passing the sample test, but fail on every random test. I find this recursive behavior explanation very fishy. It seems that depending on the order of recursion, other results can be provided. Or should we be able to reiterate existing pixels in case we can make new progress? This spec is very unclear to me.
JavaScript initial code is using bad style by extending the prototype enumerably with String.prototype. = .... Initial code should use Object.defineProperty(String.prototype, ...) instead.
It is hinted, but not explicitely stated, that string[idx] is a parenthesis. In other words, "a".findParenMatch(0) should not happen, because 'a' is not a parenthesis.
In JavaScript this indeed never happens, in Haskell it does happen and Nothing is expected.
This should be clarified; especially because in JavaScript, the function is bound to a prototype, which means it can be called on any string, with anyidx; and this is exactly the point of extending the prototype. In such a situation, functions are supposed to double check their arguments, and have a well-defined behavior in every case without relying on preconditions.
The random tests only generate tests up to 2 million. Either the description should be fixed or the tests should be updated (tho some solutions will get invalidated)
For input : [[5,"v"],[3,"r"],[11,"b"],[13,"i"],[8,"l"],[1,"m"],[13,"f"],[12,"p"],[1,"o"],[8,"h"],[10,"w"],[3,"i"],[13,"z"],[7,"s"],[13,"q"],[14,"r"],[6,"g"],[14,"k"],[13,"y"],[4,"b"],[15,"n"],[4,"d"],[13,"j"],[14,"t"],[9,"z"],[12,"q"],[1,"b"],[10,"m"],[15,"o"],[7,"d"],[13,"w"]]
But was:
"vvvvvrrrbbbbbbbbbbbiiiiiiiiiiiiillllllllmfffffffffffffppppppppppppohhhhhhhhwwwwwwwwwwiiizzzzzzzzzzzzzsssssssqqqqqqqqqqqqqrrrrrrrrrrrrrrggggggkkkkkkkkkkkkkkyyyyyyyyyyyyybbbbnnnnnnnnnnnnnnnddddjjjjjjjjjjjjjttttttttttttttzzzzzzzzzqqqqqqqqqqqqbmmmmmmmmmmooooooooooooooodddddddwwwwwwwwwwwww"
Are we supposed to have 8 7 9 1 in the expected output?
Is the expected output correct?
This comment is hidden because it contains spoiler information about the solution
I'd like to point out that dividing by 3 is not the correct way to convert RGB to grayscale, and maybe it's best if it accepts a 2d array of singular grey values instead.
Test output is currently absolutely disgusting because at least it was better than the unintelligible mess that was the old one.
Raising this issue so that people can yell at me if I don't fix it eventually.
The description states that the input should be an NxM array, but the random tests for Python can produce arrays with rows of differing lengths.
Very similar to this kata
You use nested "it" blocks in JS tests.
This one sample test is not enough for users to figure out what to do. I'm passing the sample test, but fail on every random test. I find this recursive behavior explanation very fishy. It seems that depending on the order of recursion, other results can be provided. Or should we be able to reiterate existing pixels in case we can make new progress? This spec is very unclear to me.
C Translation (author inactive).
C translation (author inactive)
Python translation: https://www.codewars.com/kumite/63f1296761aa3b0e4e749751?sel=63f1296761aa3b0e4e749751
JavaScript initial code is using bad style by extending the prototype enumerably with
String.prototype. = ...
. Initial code should useObject.defineProperty(String.prototype, ...)
instead.It is hinted, but not explicitely stated, that
string[idx]
is a parenthesis. In other words,"a".findParenMatch(0)
should not happen, because'a'
is not a parenthesis.In JavaScript this indeed never happens, in Haskell it does happen and
Nothing
is expected.This should be clarified; especially because in JavaScript, the function is bound to a prototype, which means it can be called on any string, with any
idx
; and this is exactly the point of extending the prototype. In such a situation, functions are supposed to double check their arguments, and have a well-defined behavior in every case without relying on preconditions.The random tests only generate tests up to 2 million. Either the description should be fixed or the tests should be updated (tho some solutions will get invalidated)
o not use rounding, use testing for approximate equality.
For String decompress java random tests,
Can anybody explain if the test are correct ?
For input : [[5,"v"],[3,"r"],[11,"b"],[13,"i"],[8,"l"],[1,"m"],[13,"f"],[12,"p"],[1,"o"],[8,"h"],[10,"w"],[3,"i"],[13,"z"],[7,"s"],[13,"q"],[14,"r"],[6,"g"],[14,"k"],[13,"y"],[4,"b"],[15,"n"],[4,"d"],[13,"j"],[14,"t"],[9,"z"],[12,"q"],[1,"b"],[10,"m"],[15,"o"],[7,"d"],[13,"w"]]
Expected Output : "7777777777777 vvvvv888887777777rrrbbbbbbbbbbbiiiiiiiiiiiiillllllllm999999999999fffffffffffffpppppppppppp,,,,,,,,,,,,111111111111111o3hhhhhhhhwwwwwwwwwwiiizzzzzzzzzzzzzsssssssqqqqqqqqqqqqqrrrrrrrrrrrrrr999999999999ggggggkkkkkkkkkkkkkk1110666yyyyyyyyyyyyybbbbnnnnnnnnnnnnnnnddddjjjjjjjjjjjjjttttttttttttttzzzzzzzzzqqqqqqqqqqqq bmmmmmmmmmm77777777oooooooooooooooddddddd6wwwwwwwwwwwww88888855555555555222000000000000000"
But was:
"vvvvvrrrbbbbbbbbbbbiiiiiiiiiiiiillllllllmfffffffffffffppppppppppppohhhhhhhhwwwwwwwwwwiiizzzzzzzzzzzzzsssssssqqqqqqqqqqqqqrrrrrrrrrrrrrrggggggkkkkkkkkkkkkkkyyyyyyyyyyyyybbbbnnnnnnnnnnnnnnnddddjjjjjjjjjjjjjttttttttttttttzzzzzzzzzqqqqqqqqqqqqbmmmmmmmmmmooooooooooooooodddddddwwwwwwwwwwwww"
Are we supposed to have 8 7 9 1 in the expected output?
Is the expected output correct?
Loading more items...