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.
'Its alr approved some time ago'
done: https://www.codewars.com/kumite/5d4a8296dbaa2400266a39c4?sel=5da142b9a82c1e0012169e0a
I fixed the merge issue within my fork, but the tests are timing out. Looks like you need to fork mine and try to optimize this some more.
Welp, thanks for the suggestion, though.
Bugger. I suspect, comparing the elm wiki page with the ruby one that the packages are currently limited to
elm/core
andelm-explorations/test
. If so, that's pretty limiting. Without it, I suppose one could manually copypaste the whole Regex module in to the preloaded section, but that seems clumsy. Summary: I don't know.I tried your solution, but the compiler threw an error saying they couldn't import the Regex module. How do we install it? Can we fiddle around with the elm.json?
I haven't really looked at the Regex library that much, but this solution seems a lot neater than mine haha. I do feel like the markers should continue to be a
List Char
, though.This could also be solved arguably more neatly via a Regex e.g.
One other thought is that the markers input could be a
List String
rather than aList Char
. I don't know what Elm best practice is here. I suppose there is some benefit to forcing the list to be single characters rather than allow a multi-character through.Sorry, no random tests.
Now they just expect a constant...
To get this working I needed a
shuffle
which isn't natively provided by theRandom
library. I've pulled in the relevant functions fromelm-community/random-extra
andowanturist/elm-union-find
packages. Bit annoying though.That's a fair point. I'm still learning the Elm test framework so I'll have a think about how to go about this.
The fuzzed tests aren't really random when the answer always is the first number.
This comment is hidden because it contains spoiler information about the solution
Elm translation for review.