Version 0.8.9

=============
Added external config file -> the resulting program seems a lot faster !!!
Added help.
This commit is contained in:
2006-07-04 11:55:00 +00:00
parent a0ee66638d
commit f67d82d129
5 changed files with 319 additions and 204 deletions

View File

@ -37,7 +37,7 @@ public class SuicideChess {
/**
* The name to be displayed
*/
public static final String NAME = "djib's SuShi v0.8.0";
public static final String NAME = "djib's SuShi v0.8.9";
/**
* Displays informations in the console.
@ -153,11 +153,13 @@ public class SuicideChess {
System.out.println("Welcome to SuicideChess "+SuicideChess.NAME+"!\n");
System.out.println("Type 'help' for a quick help.");
System.out.println("If you want a graphical interface, you can use XBoard, WinBoard or any compatible program.");
System.out.println();
OpeningBook.load();
SuicideProblems.load();
ConfigFile.load();
System.out.println();
BufferedReader moveInput = new BufferedReader(new InputStreamReader(System.in));
@ -176,8 +178,32 @@ public class SuicideChess {
try {
String whatMove= moveInput.readLine();
boolean playedALegalMove = false;
if (whatMove.startsWith("problem")) { //special case for problems
if (whatMove.startsWith("help")) {
System.out.println("==================== Quick help ====================\nEnter moves in SAN notation : e2e3, e7e8r, ...\n");
System.out.println("new\t\t\tcreates a new game");
System.out.println("quit\t\t\tquits the game");
System.out.println("go\t\t\twill let the computer play the current player");
System.out.println("hint\t\t\treturns a legal move for current position");
System.out.println("undo\t\t\tundoes a half move (one side)");
System.out.println("remove\t\t\tundoes a full move");
System.out.println("force\t\t\tthe computer will check moves but not play");
System.out.println();
System.out.println("setboard FEN\t\tsets the board according to the FEN position");
System.out.println("sd N\t\t\tsets the search depth to n");
System.out.println("bk\t\t\tdisplays available openbook moves for current position");
System.out.println("post\t\t\tdisplays thinking output");
System.out.println("nopost\t\t\tdo not display thinking output");
System.out.println();
System.out.println("problem\t\t\tdisplays the number of available problems");
System.out.println("problem auto\t\tlets the computer play automatically on each problem");
System.out.println("problem N\t\tloads problem number N");
System.out.println("problem load FILENAME\tloads the problem file FILENAME");
System.out.println("config\t\t\t displays current configuration");
System.out.println("config FILENAME\t\tloads a configuration from FILENAME");
System.out.println();
}else if (whatMove.startsWith("problem")) { //special case for problems
if(whatMove.length()==7) {
System.out.println("There are "+SuicideProblems.numberOfProblems()+" problems.");
} else if (whatMove.substring(8).equals("auto")) {
@ -195,6 +221,12 @@ public class SuicideChess {
System.out.println("Not a valid number: "+ whatMove.substring(8));
}
}
} else if (whatMove.startsWith("config")) { //special case for loading other configuration files
if(whatMove.length()==6) {
ConfigFile.display();
} else if ((whatMove.length()>6)) {
ConfigFile.loadFile(whatMove.substring(7));
}
} else if (whatMove.startsWith("asciiplay")) {
asciiGame=true;
bitboard.display();