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.
I've made a fork that checks that the solution class isn't a subclass of
fractions.Fraction
.I've made a fork that updates the description to more accurately describe the task for Python and Haskell.
This comment is hidden because it contains spoiler information about the solution
Merged
The addition of 2
Fraction
instance should yield aFraction
instance, not its string representation. That one we will have to leave it tostr
/repr
to do the job.python new test framework is required. updated in this fork
The task is not defined. In Python and Haskell, one is asked to do very different things, actually one cannot rely on the description, but must guess hazardously from the initial code and sample tests.
Concretely, for example in Haskell, the initial code includes a definition for signum, abs and negate functions (what should they be?). There's no need to define them to pass the tests, but we get warnings from GHC's tests:
What's the point?
This comment is hidden because it contains spoiler information about the solution
True. I had wasted a lot of time thinking what went wrong until I saw your comment. By convention, the minus sign is never placed in the denominator in a reduced fraction. I think this should be an issue rather than a suggestion.
Kotlin translation added. Please review.
https://www.codewars.com/kumite/6107bfd7bcc1ea0032702f92
I used the magic method repr and get lots of errors like '37/40 should equal 37/40'. Can somebody give my hint as to what is going on here?
you must be kidding!!!!!! mine's big too:(
You should make them keep the negative number of a negative fraction in the numerator. I did that and got confused when it wouldn't work on my attempts. I did the solution in haskell, and in that version of the problem there was no mention on where the negative sign should be placed or if it should be placed in a specific location at all.
Done.
Not enforced.
Loading more items...