Kalah: error in game.State

Disclaimer: Dieser Thread wurde aus dem alten Forum importiert. Daher werden eventuell nicht alle Formatierungen richtig angezeigt. Der ursprüngliche Thread beginnt im zweiten Post dieses Threads.

Kalah: error in game.State
i think i found an error in the Kalah framework.
In the constructor in game.State gi needs to be set before res to avoid a null pointer exception.
public State(int[] p1Houses, int[] p2Houses, int p1Score, int p2Score,
boolean p1ToMove, int houses, int seeds) {
this.p1Houses = p1Houses;
this.p2Houses = p2Houses;
this.p1Score = p1Score;
this.p2Score = p2Score;
this.p1ToMove = p1ToMove;
//before it was first res=… then gi=… → null pointer exception
this.gi = new GameInfo(houses, seeds);
this.res = Result.get(p1Score, p2Score, gi);
}


I have no idea where that is, but it looks like java (i.e. not scala) code and not the Converter class, so I’m not sure that it’s even part of the framework…

can you point me to a file?


KalahGUI\src\game\State


ah, that I am not responsible for. The GUI is provided by a student to help you in debugging and evaluating the moves of your agent, but it’s completely optional and not part of the framework. But I’ll gladly forward it to Luca, so he can fix it (if necessary) :wink: