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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Done, I think. I also tried to make it look a bit better.
I'm pretty sure I've swapped them around now.
I've changed it so that for the random cases, it randomly decides to either do no errors (20%), a message error (40%), or a parity error (40%), and have combined the larger and smaller tests into one batch.
I mostly am doing many tests because an answer which is almost correct might only fail in a small number of cases, and I wouldn't want slightly wrong answers to pass just because the case where they fail didn't come up in the testing.
I recently had to change how I did it to resolve one of the issues raised, so the examples now look like:
Test.assert_equals(correct(2,3,'11111010001'), '11111010001')
Test.assert_equals(correct(2,3,'11011010001'), '11111010001')
Test.assert_equals(correct(2,3,'11111011001'), '11111010001')
Test.assert_equals(correct(2,3,'11111010011'), '11111010001')
So it is '111110' + '10'(rows) + '001'(cols). laid out it looks like:
111 1
110 0
00 1
I think your looking at the previous versions of the examples, which made sense then because I was doing columns and rows the wrong way around.
You're right. I believe I've now swapped the M and N to be correct, but it required many changes so I may have done it wrong :/
I've added another batch of random tests that only modify the parity bits. Does that work?
That's some outstandingly terrible code there! Well done.