Ad
  • Custom User Avatar

    There are no random tests.

  • Custom User Avatar

    Actual tests depends on user code to split the two parts into methods with specific names:

    src/test/java/BadHashTest.java:11: error: cannot find symbol
        assertEquals(32, crypto1.magicNum(""));
                                ^
      symbol:   method magicNum(String)
      location: variable crypto1 of type BadHash
    src/test/java/BadHashTest.java:16: error: cannot find symbol
        assertEquals(64, crypto1.magicNum("a"));
                                ^
      symbol:   method magicNum(String)
      location: variable crypto1 of type BadHash
    src/test/java/BadHashTest.java:21: error: cannot find symbol
        assertEquals(96, crypto1.magicNum(" "));
                                ^
      symbol:   method magicNum(String)
      location: variable crypto1 of type BadHash
    src/test/java/BadHashTest.java:26: error: cannot find symbol
        assertEquals(-848, crypto1.magicNum("Hi!"));
                                  ^
      symbol:   method magicNum(String)
      location: variable crypto1 of type BadHash
    src/test/java/BadHashTest.java:31: error: cannot find symbol
        assertEquals(-520, crypto1.magicNum("a "));
                                  ^
      symbol:   method magicNum(String)
      location: variable crypto1 of type BadHash
    src/test/java/BadHashTest.java:36: error: cannot find symbol
        assertEquals(32, crypto1.magicNum("  "));
                                ^
      symbol:   method magicNum(String)
      location: variable crypto1 of type BadHash
    src/test/java/BadHashTest.java:41: error: cannot find symbol
        assertEquals(344, crypto1.magicNum(" Yo, What's Good! - "));
                                 ^
      symbol:   method magicNum(String)
      location: variable crypto1 of type BadHash
    src/test/java/BadHashTest.java:46: error: cannot find symbol
        assertEquals(56, crypto1.magicNum("2345afd"));
                                ^
      symbol:   method magicNum(String)
      location: variable crypto1 of type BadHash
    8 errors
    
  • Custom User Avatar

    This has to be one of the worst kata descriptions I've ever seen. Completely illegable.

  • Custom User Avatar

    Steps c and d are clearly the most difficult in the task ((NOT a) shift left by 2 bits)), I think the examples should give the expected value for c, not just for a and b.

    b := sum of every difference between the consecutive characters of the input : Does it mean "sum of difference of ascii values"?

  • Custom User Avatar

    if 126 <= sV < 127 then should be replaced with if 126 <= sV < 128 then

  • Custom User Avatar

    Consider changing the Description text to the following:

    """
    The password is sent through an electrical wire and has hardware support to decrypt and encrypt the code.

    You know that how the encryption works, but you need to figure out the xor value to decrypt the code. You have collected many of the encrypted passwords from a recycle bin and must now figure out the XOR value.

    The code, is encrypted in the following way: The code is subdivided into 8 bytes. The each byte is XORed with some value between 0 - 255. Then reverse order of the bytes; change the endianness. Finally, each bit will be sent through a NOT gate; 1's compliment.
    For example, if the code is 2. The table below shows the value being subdivided.
    """

    The line, "Then reverse order of the byte." initially lead me to believe that you wanted each byte mirrored instead of changing the endianness of the number.

  • Default User Avatar

    Hi,

    I don't understand this line:

    c := (a OR b) AND (NOT a then shift left by 2 bits)
    

    shouldn't it rather be?

    c := if (a OR b) AND (NOT a): then shift left by 2 bits
    

    and if so, what are you shifting? a? b? other?

    MMmmm... Or is it rather:

    c := (a OR b) AND (NOT (a shifted left by 2 bits))
    

    ?? (btw: signed or unsigned shift?)

  • Default User Avatar

    Just a bit more here...

    But I think you misunderstood the purpose of codewars. Currently, to do your kata(s) I would have to dig on my own outside of the website to try to understand what you're asking for. Considering that the first (and only for now) person that has completed this one ranked it as 8kyu and assuming that it's at least not so far away of the real rank, your kata "cannot work". Easy katas are normally about educational purpose, so clear goal, clear description, minimum to seek out of the description. Right now, this is fully the opposite.

    Your kata might be very interesting and have very well built tests, you'll have constantly grudging comments if you let it that way (by the way, if you're kata has a to low statisfaction rate (currently 0% !), it will never go out of beta. The problem is that if you modify it later, people that have down voted it won't see the modifications, so won't change their vote, so you're kata will never leave beta process).

    There's some work to do (on both katas!) ;)

  • Default User Avatar

    Well, that does not begin the better way: reading the description only, I have NO IDEA of what you're asking for. Might need some clarifications there...

    Let's see the example tests, now...