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.
Description should be language-agnostic
Haskell translation:
https://www.codewars.com/kumite/63b973cc44b23a0031ada9e0?sel=63b973cc44b23a0031ada9e0
This comment is hidden because it contains spoiler information about the solution
It doesn't mention the name of the conversion rates table in the description (Python).
Only found out via comments here that it is
CONVERSION_RATES
.How do you tell a number from binary code? Is there some kind of formula for this?
You still have 2 big exploits to fix:
https://www.codewars.com/kata/reviews/5b59a8753237d248d6003489/groups/5b59b7273237d2a42d0037d7
https://www.codewars.com/kata/reviews/5b59a8753237d248d6003489/groups/5b7c5add5d191a2b9f00009e
You're also not checking if user functions would make visible changes on the object after going through the function.
I'd say it's a really, really, really bad practice for this kata to have solutions that mutates the input mercilessly ;-)
You are also mixing up the property of the properties of the object, and the object itself.
A perfectly normal object can have all its properties frozen (
writable: false
). It's just a side effect that whenever you freeze/seal an object, it also applies to all the properties. WhenObject.isFrozen
and the like is called, it checks about the object itself, and not its properties, and yet by how your tests are written, doing the latter will pass your weak tests just fine.Since
freeze
>seal
>preventExtensions
strictly, your requirements are suggesting a different behaviour from the original functions inObject
. Naming them the same is really asking for confusion.You should really name it something like
isOnlyFrozen
or something.There is no way to determine properties can be updated in an object if it has no properties to begin with (i.e
{}
).If all objects are supposed to be non-empty it should be mentioned in the descriptions.
but
Declaring Java methods to return "implementations" like this is a bad idea because it unnecessarilly imposes a restriction on the way the solution can be implemented.
Similarly this kind of calling code in Test is is sucking the life out of any creativity...
===
Use interfaces for APIs. That's what they are for...
Or better yet