Ad
  • Custom User Avatar

    Bit width used by the tests are entirely within the range of a long, so there is nothing stopping one from using a long to represent everything.

    Speaking of which, 80% of the kata is covered via java.util.BitSet. This kata could use more novelty.

  • Custom User Avatar

    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 Bits are of different length. Initial code contains some validation, but never on this part.

  • Custom User Avatar

    Initial code contains a partially written solution of dubious code quality. Please put only the stub as initial code.

  • Custom User Avatar

    There are no random tests.

  • Custom User Avatar

    Could you please tell what kill and live methods should do? It's not clear to me.

  • Default User Avatar

    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

  • Default User Avatar

    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 and kill) could be better and some is unfortunately also misleading, e.g. I'd name the class Bits (or BitSet as the class already provided in the Java Runtime) and how moveright works is a bit odd as it effectively only adds n 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.

  • Default User Avatar

    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

  • Default User Avatar

    Please check your moveright implementation and your moveright tests. The following test produces 0010101011 instead of 0010101010 with your code which is really odd:

    	Bit a = new Bit(8);
    	a.live(0);
    	a.live(2);
    	a.live(4);
    	a.live(6);
    	a = Bit.moveright(a, 2);
    	System.out.println(a);
    

    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.