Not logged in. · Lost password · Register

Pau14
Member since Jan 2018
6 posts
Subject: 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);
    }
Jazzpirate
Member since Oct 2016
803 posts
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?
Pau14
Member since Jan 2018
6 posts
KalahGUI\src\game\State
Jazzpirate
Member since Oct 2016
803 posts
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) ;)
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Datenschutz | Kontakt
Powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2011 by Yves Goergen