- Created a new ComPlayer. It targets a particular score, and does it pretty well. It does this by counting the number of empty spaces and the number of empty spaces that can potentially be created by removing tiles then either playing to block or playing to extend the game.
- Created DumpResults.java, which simply outputs all scores in a player model so that they can be graphed.
This commit is contained in:
35
test/model/DumpResults.java
Normal file
35
test/model/DumpResults.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package model;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
|
||||
import model.playerModel.GameLog;
|
||||
import model.playerModel.PlayerModel;
|
||||
|
||||
public class DumpResults {
|
||||
public static void main(String[] args) {
|
||||
FileInputStream fin = null;
|
||||
ObjectInputStream oin = null;
|
||||
|
||||
try {
|
||||
fin = new FileInputStream(PlayerModel.getPlayerPath("marshall"));
|
||||
|
||||
oin = new ObjectInputStream(fin);
|
||||
PlayerModel pm = (PlayerModel) oin.readObject();
|
||||
oin.close();
|
||||
|
||||
for (GameLog gl : pm.getScores()) {
|
||||
System.out.println(gl.getScore());
|
||||
}
|
||||
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user