Ad
  • Default User Avatar

    Language is Java BTW. I'm having some trouble with the random tests and I can't see what I'm doing wrong. The smallest test I've seen that I fail has no rollbacks and is just simple moves. It can be recreated with

    Go g = new Go(5, 7);
    String[] moves = new String[] { "4B", "3E", "3C", "1E", "4F", "2G", "3D", "2E", "4A", "3B", "4G", "1A", "3E",
    			"2A", "2B", "3B", "3B", "1F", "1E", "2A", "3D", "3E", "4D", "1A", "4A", "3A", "1A", "1C", "3F", "4F",
    			"1A", "3D", "3F", "3B", "4A", "1C", "2C", "1B", "3F", "2B", "2C", "1A", "1D", "2A", "1B", "4E", "1A",
    			"2G", "3A", "2A", "4D", "2A", "1B", "1E", "3B", "1D", "1E", "1E" };
    for (String s : moves) {
    	try {
    		g.move(s);
    	} catch (IllegalArgumentException e) {
    	}
    }
    

    What I end up with is

      A B C D E F G 
    5 . . . . . . . 
    4 x x . o o x x 
    3 x o x x o x . 
    2 x o . . o . o 
    1 x x o o o x . 
    

    and while I can't see what it should be, I'm getting the error

    arrays first differed at element [1][4]; expected:<x> but was:<o>
    

    element[1][4] is "4E" which is only set once and, according to my program, it is set by white. Can anyone that has completed this tell me what this move set should result in? I can complete every other test and most of the time I can complete 30+ random tests, but no matter how many times I try I can't complete this thing.

  • Default User Avatar

    Nevermind. the "..." wasn't to indicate varargs.

  • Default User Avatar

    Can someone help me with this higher order function thing in Java? As far as I know varargs has to be the last parameter in a function but in this example it isnt. Does this somehow change if you use a higher order function?

  • Default User Avatar

    Thanks for this B4B. I was struggling to get through the Javascript version.

  • Default User Avatar

    Thanks for the reply. Yeah I figured it out a little later. Kata was a lot of fun.

  • Default User Avatar

    I have a question about the addChaining method. The description says As for the add method, this chain is not considered as a new branch of the molecule. If this is the case what is the chain? You give the example of -C-C-C-Mg-Br. I'm imagining that bonded to a C at a 90 degree angle. How is this any different from any other branch in the molecule? If it isn't a branch, what makes it not a branch and what makes a branch a branch?

  • Default User Avatar

    I have a question about the addChaining method. The description says As for the add method, this chain is not considered as a new branch of the molecule. If this is the case what is the chain? You give the example of -C-C-C-Mg-Br. I'm imagining that bonded to a C at a 90 degree angle. How is this any different from any other branch in the molecule? If it isn't a branch, what makes it not a branch and what makes a branch a branch?

  • Default User Avatar

    java translation added

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Are we supposed to check all documents for expiration or only required ones?

    I keep running into issues like denying due to expired stuff but I was supposed to deny due to banned nation. In those situations its always documents that aren't required, but are expired. Logically if i'm checking documents at a border I'm going to check everything for conformance, even if it's not a required document, right?

    EDIT: Actually it looks like this is completely inconsistent. If I check only required documents I fail because I'm not checking non-required documents. If I check all documents I fail because (I assume) it thinks I should only be checking non-required documents.

  • Default User Avatar

    can you shorten the array names for java? I'm all for descriptive variable names but "max_values_of_planets_with_retrograde_orbits" and "max_values_of_planets_with_prograge_orbits" are ridiculously long. Maybe call the "progrades" and "retrogrades"?

  • Default User Avatar

    Quick suggestion, I did the java version and noticed you use List but don't import it to begin with, leaving it to the programmer to do this. I know it's small but it should be easy enough to change.

  • Default User Avatar

    You were right. I had swapped the order to see if it would fix a different error I was having but it ended up being something else and I forgot to switch it back. Thanks for your help

  • Default User Avatar
  • Default User Avatar

    @Farekkusu

    I realize this but if this is true then the random case is not consistent. Can you see any error in my "if order doesn't matter" version of how that particular case should go?

    Not sure if it means much but I am able to pass every case except for this random one

  • Loading more items...