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.
Approved
Prolog translation
Well, it is BF, so not a surprise there, lol
Cool. How did you get the multiplication parts working? I'm kinda stuck with oddTimesOdd and oddTimesEven.
But professor, my induction is correct! It compiled in Haskell!
Uhh, hard
My code c++ passed all tests.
But I am gtting error from random test: Caught std::exception, what(): std::bad_alloc
What is that mean?
done.
Needs update to
GHC 9.2.x
Needs update to
GHC 9.2.x
Very instructive Kata! Thanks!!
It is necessary to add to the condition that the Euclidean distance must be rounded down before comparing with the radius, otherwise this was not initially described in any way.
I was fortunate that I have some experience proving things in Agda; it definitely helped me here.
For those who were struggling on getting Haskell to type check, I was able to get predictable results once I realized that any expression of (NextOdd m) or (NextEven m) was S^2 of some m, and that I also knew the parity of m by definition. Then I could just unfold the expressions in terms of n or m using the exact definitions for Mult and Add on paper for the cases I was considering, keeping in mind the nesting. Because it is trivial to determine the parity of all the terms in the expression, once I had the "shape" of the unfolded expressions on paper, it was just a matter of using the lemmas we already proved to recompose the expression in the form of the lemma analogs we defined for arithmetic, working from the innermost nested expression outward. Hope that made some sense. This was a fun kata, and bumped my score by 2 kyu.
Would have been even kinda easy if I knew Haskell on any acceptable level. Most struggles were to make types work out and complie : |
Loading more items...