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.
Fixed
This was... very interesting. Awesome challenge, had to change my approach twice due to performance. Coming from the 4x4 kata, this was slight unexpected. After an amount of time I don't care to admit I finally arrived at a reasonable F# solution and the feeling is very satisfying. Thanks for the oportunity!
A small issue in the F# version: the tests have their actual and expected values flipped - whatever the tests say is "Actual" is the expected value and vice versa. Also, the large test suite wraps the function result in an Option so the tests might say that they expect null/some x. This is not entirely expected and might get confusing in conjunction with the expecte/actual flip.
Thanks!
No worries, stuff happens. Now my code worked without issues, thanks for solving this so promptly :)
This comment is hidden because it contains spoiler information about the solution
You are right, there is a problem in randomtests: "they code only letters a-z, A-Z" so the string must not begin with a character outside a-z, A-Z (here, if it begins with "|" this character should not be coded and the prefix would be "||" hence the shift would not be known). I modified the randomtests. I hope it will work now for you! Unfortunately it seems that you are the first to try the F# translation:-(. Thanks for your post.
Either I'm missing something or there is something wrong with the F# tests. Most of the tests are passing fine, but:
For (encode "|5F60Au? KZi92? n" 2) the expected output is ["|d|5"; "H60C"; "w? M"; "Bk92"; "? p"]
How does that work? To build the prefix, I should take '|', lower-case is to '|' (no change) and then add 2. Since '|' is ASCII 124, that would give me ASCII 126, which is '~'. Instead, the expected result says the prefix is "|d". How did that 'd' get there?
Alright, never mind. Gave up, looked at the reference solution. Two issues:
Generally speaking, this was rather frustrating. The task is not difficult but there is a lot of space for uncertainty and the test suite is not sufficient to guide you to what part of the computation is problematic. The whole thing is further complicated by the floating-point math and small increments which mean it's difficult to visually check if the computation makes sense.
This comment is hidden because it contains spoiler information about the solution