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.
Bit width used by the tests are entirely within the range of a
long
, so there is nothing stopping one from using along
to represent everything.Speaking of which, 80% of the kata is covered via
java.util.BitSet
. This kata could use more novelty.The description does not mention (or rather, the kata author does not know) how
capacity
should be changed under various operations.It's never described either what to do if two
Bit
s are of different length. Initial code contains some validation, but never on this part.Initial code contains a partially written solution of dubious code quality. Please put only the stub as initial code.
There are no random tests.
Could you please tell what kill and live methods should do? It's not clear to me.
Your solution is a good one, when I do this in Kata only according to their own ideas to deal with the problem. The realization way of thinking about their own, you do not use a string I don't want to see to achieve, but a more thorough understanding of the kata.
I don't throw the numbers around to make it easier to make additions because binary numbers can be added to the addition of my solution.
I am a Chinese, my English is not good, most of the need to use translation software to communicate, if there is inappropriate, please understand, thank you
Thanks. It does work now using my own code for
moveright
. My solution is not optimized for performance and personally I think that this kata is a bit too broad and some of the wording (e.g.live
andkill
) could be better and some is unfortunately also misleading, e.g. I'd name the classBits
(orBitSet
as the class already provided in the Java Runtime) and howmoveright
works is a bit odd as it effectively only addsn
zeroes at the left. Nevertheless, I'm also new here at CodeWars and I appreciate the effort you put into this kata. It is a nice one but imho needs to be polished a bit. :-)Edit: I hope that someone else will also complete this kata and give also feedback. And please don't get it wrong, but I will rate it as "Somewhat" satisfied and will change it to "Very" when it has been improved a bit, hopefully also based on additional feedback from other users.
Thank you very much for your advice. It is indeed a bug. I've fixed this problem, and I hope you like this Kata, although it seems to be a bit bad
Please check your
moveright
implementation and yourmoveright
tests. The following test produces0010101011
instead of0010101010
with your code which is really odd:I have not been able to complete this Kata using a (presumably) correct
moveright
implementation so I guess that your test expects wrong output here.