It's up to you what the specification should be, but the description needs to accurately explain why some functions are included and others aren't. Right now, it says that hypot isn't included because of its arbitrary positional arguments, but that's not the case.
Seconding the suggestion to remove the starter code, but if you do keep it, you should avoid the hash variable name as it overrides the built-in function of the same name in python.
Cool kata! Some suggestions for the description, mostly based on what tripped me up:
I've always heard of gray codes as a category of encodings, so I was confused by "The Gray Code" and "The Even Gray Code" referring to specific encodings. Especially the reference to "The bit switched at each step is the one that yields the smallest value not yet represented" which is not what I'm familiar with as the most common gray code.
I'd clarify the "The bits changed at each step should yield the smallest value not yet represented." Specifically that "smallest" is referring to a standard binary encoding.
The use of index is unclear, as it refers to the value we want to encode. I suppose it makes sense if we think of the encoding as a list, but there's no reason to do so.
Apparantly not at all... looks like this was from 3.0, I had just never noticed it. That just seemed to be the page with the most detail.
This comment is hidden because it contains spoiler information about the solution
The assertion messages should provide information about what was wrong (see the docs).
As dfhwze noted, this isn't likely to be approved, but it's good to know for another kata.
This comment is hidden because it contains spoiler information about the solution
I changed the
Show
instance in preloaded, let me know if that works better.Approved. This looks great! Thanks for your work on this.
Had me stuck for a good bit! Very fun!
It's up to you what the specification should be, but the description needs to accurately explain why some functions are included and others aren't. Right now, it says that
hypot
isn't included because of its arbitrary positional arguments, but that's not the case.Why exclude
hypot
but includelcm
andgcd
, both of which take an arbitrary number of arguments.More generally, what is the specification on which functions to skip?
This comment is hidden because it contains spoiler information about the solution
Seconding the suggestion to remove the starter code, but if you do keep it, you should avoid the
hash
variable name as it overrides the built-in function of the same name in python.Cool kata! Some suggestions for the description, mostly based on what tripped me up:
index
is unclear, as it refers to the value we want to encode. I suppose it makes sense if we think of the encoding as a list, but there's no reason to do so.This comment is hidden because it contains spoiler information about the solution
Looks good! I ran it a number of times and was at least ~60 tests shy of passing each time.
This comment is hidden because it contains spoiler information about the solution
Loading more items...