Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • Profile-pic

    Ok. Thanks. That worked

  • Profile-pic

    Got it finally, I cast to unsigned char instead of char like ZajkoUsko recommended.

  • Profile-pic

    This solved it for me! Thank you so much!

  • Profile-pic

    Some languages have signed bytes and some don't, a negative byte is just a byte with a value from 128 to 255 when unsigned. Add 2^8 to it and use it as an integer if your language doesn't have unsigned bytes.

  • Profile-pic

    So far I am passing 127 tests and failing 1: Random zero strings binary input. Can someone give me some examples of input in this category I might be failing on? I can't see any of the test cases.

  • Profile-pic

    This might be a dumb question because I don't see anyone else asking it, but I am printing out the byte array that gets passed to toAscii85 and it contains a bunch of negative numbers. How are we supposed to deal with these? I've seen mention of bitwise operations pushing the numbers over to negative but this is before I've even done anything to them and they're negative.

  • Profile-pic

    Damn, How could I have missed that one... :o

    Corrected. Thanks for reporting and sorry for the inconvenience.

  • Profile-pic

    That was it. The code given by the Kata has the wrong return type. Can someone change it to Set instead of PieceConfig[] to eliminate confusion?

  • Profile-pic

    I am having trouble getting my responses recognized. I am getting the error:

    Pawn threatens king expected:<[piece: pawn, owner: 1, x: 5, y: 6]> but was:<[LPieceConfig;@530feab0>
    

    For some reason it is taking my PieceConfig array that I am returning and using that as a comparison instead of taking the individual items themselves and checking those. Sure enough when I do:

    for(int i = 0; i < threatenArr.length; i++){
        System.out.println(threatenArr[i].toString());
    }
    System.out.println(threatenArr);
    

    in my kata I get

    piece: pawn, owner: 1, x: 5, y: 6
    [LPieceConfig;@530feab0
    

    The first line is from outputting the toString() of the item in the array, while the second one, which is what my error is reading, is what happens when I try to print out the array object.

    Is there something I'm doing wrong here? Do I need to change the return type of my isCheck method? The prompt says I need to return a Set, but the prefilled code has a PieceConfig[] as the return type for isCheck.

  • Profile-pic

    I can pass 5/6. I only fail at randomTest:

    arrays first differed at element [0][0]; expected: but was:

    i tried to hardcode a at [0][0] but it raises:
    arrays first differed at element [0][0]; expected: but was:

    I do believe there is a problem in the test. I was trying to solve this using a backtracking for funsies. I will try other techniques and fill in the results.

  • Profile-pic
  • Profile-pic

    thank you, now passing 4/6 :)

  • Profile-pic

    This is confusing in this problem but the starting point is in cartesian coordinates where 0,0 is the lower left corner; you are likely staring in the wrong place -- your output doesn't even put a 1 at (2,2) cartesian.

  • Profile-pic

    Re-run in my ide and the input is only read from as I can print the input, run fill with the input, print input, and input is not changed

  • Profile-pic

    Final note: Do not mutate any of the inputs!

    ?

  • Loading more items...