the random tests in C# were producing strings that did not conform to the specification: the matrix could have different characters (besides '*') in the same column. My guess is that nobody noticed it until now because most solvers looped from top row to bottom row and exited as soon as a non-'*' was found.
I fixed the C# RNG, and I also added nicer assertion messages that display the input. Your code passes the random tests now. It still fails the edge cases test (empty arrays / empty strings), but that should be an easy fix.
at the end of your for loop, what value does j have ? is it the correct index to nul terminate ? also, notice the warnings:
memset(assembled, '\0', sizeof(assembled));
~~~~~~~~~^~~~~~~~~/*solution.c:9:34:warning: 'memset' call operates on objects of type 'char' while the size is based on a different type 'char *' [-Wsizeof-pointer-memaccess]note: did you mean to provide an explicit length?*/
Thank you very much. I have found a nice Linq solution with SingleOrDefault()
the random tests in C# were producing strings that did not conform to the specification: the matrix could have different characters (besides
'*'
) in the same column. My guess is that nobody noticed it until now because most solvers looped from top row to bottom row and exited as soon as a non-'*'
was found.I fixed the C# RNG, and I also added nicer assertion messages that display the input. Your code passes the random tests now. It still fails the edge cases test (empty arrays / empty strings), but that should be an easy fix.
(csharp)I can't find out why the result for this input:
should be:
notice: some strings start with '+' und some strings start with '8' and some with '*'
Can someone help me please?
When kata authoring is done right, you have a unique problem. Neither the internet nor an AI will know what to do with your kata.
This comment is hidden because it contains spoiler information about the solution
why?
at the end of your
for
loop, what value doesj
have ? is it the correct index to nul terminate ? also, notice the warnings:😂😂😅
(c#): IMHO the example test has still the typo:
Assert.AreEqual("abcde", Kata.Assemble(new string[] {"abcde","abcde","abcbe"}));
c# tests give growing input? every next test is previous+newtest. last test already has 200 lines (all previous lines together)
[Y
yY
ysY
ysY
y*[*
[Y
yY
ysY
ysY
y*[*
PdqTq
PdqTq
dqTq
PqTq
Pdq**
[Y
yY
ysY
ysY
y*[*
PdqTq
PdqTq
dqTq
PqTq
Pdq**
9Mccp
9McWTcp
MWJTcp
9MWJ*p
9McJTp
[Y
yY
ysY
ysY
y*[*
PdqTq
PdqTq
dqTq
PqTq
Pdq**
9Mccp
9McWTcp
MWJTcp
9MWJ*p
9McJTp
2XNs
*2X's
DX'*s
D2X's
D2'Ns
etc.
Approved
Approved
Approved
Can't to approve due to a conflict in the description.
Forks with the correct description for COBOL and Go.
Approved
Loading more items...