Exception in endTurn Method



my code throws a NullPointerException after executing System.out.println(); in the method endTurn in Game.java. Using remote debugger i checked and tried everything i know to find the error. Am i violating any rule? Might it be halite.exe? since exception breakpoints don’t catch it.



it seems the game might get commands from output of the bot. When trying to print log statements they come out in the middle of other actions and then it breaks. last years bot i don’t think worked that way, but we may need to set up logging in some other way.


i was able to log things like this.

private static void init(Game game, long rngSeed){
    logFile="map-" + rngSeed + ".log";

private static void log(String s){
    try {
        PrintWriter log = new PrintWriter(new FileOutputStream(new File(logFile),true));
    } catch (FileNotFoundException e) {

 private static void outputBoard(MapCell[][] map) {
    String rows = "";
    for (int i = 0; i < map.length; i++) {

        for (int j = 0; j < map[i].length; j++) {
            rows+=map[i][j].halite + "\t";


i just rewrote a couple things and cleaned up my code, so it’s gone for now. If it returns i’ll try this!


i’m kinda stupid there is also a log class in halite. can just use that will not show up in the terminal when running the game but will show up in the bots individual log.
Log.log("Successfully created bot! My Player ID is " + game.myId + ". Bot rng seed is " + rngSeed + ".");