Version 0.8.0

=============
Just before creating the external config file
This commit is contained in:
2006-07-04 01:45:39 +00:00
parent 8a641a6e1e
commit a0ee66638d
7 changed files with 241 additions and 28 deletions

View File

@ -37,12 +37,12 @@ public class SuicideChess {
/**
* The name to be displayed
*/
public static final String NAME = "djib's SuShi v0.7.9";
public static final String NAME = "djib's SuShi v0.8.0";
/**
* Displays informations in the console.
*/
private static boolean asciiGame = false;
private static boolean asciiGame = true;
/**
* Should the game be played in acsii
@ -153,7 +153,6 @@ public class SuicideChess {
System.out.println("Welcome to SuicideChess "+SuicideChess.NAME+"!\n");
System.out.println("Type 'asciiplay' to be able to play in a terminal.");
System.out.println("If you want a graphical interface, you can use XBoard, WinBoard or any compatible program.");
System.out.println();
@ -165,6 +164,10 @@ public class SuicideChess {
Board bitboard = new Board();
addPlayedPosition(bitboard);
bitboard.display();
System.out.println();
displayPlayer(bitboard);
boolean computerPlaying = true; //the computer does not play in foce mode.
boolean playing = true;
@ -182,6 +185,7 @@ public class SuicideChess {
} else if ((whatMove.length()>=12)&&(whatMove.substring(8,12).equals("load"))) {
SuicideProblems.suicideProblemsLoad(whatMove.substring(13));
} else {
openingPhase=false;
try {
int problemNb = Integer.parseInt(whatMove.substring(8));
bitboard=new Board(SuicideProblems.getProblemNumber(problemNb));
@ -204,6 +208,11 @@ public class SuicideChess {
switch (xBoardCommand) {
case XBoardProtocol.XBOARD:
asciiGame=false;
break;
case XBoardProtocol.ACCEPTED:
break;
case XBoardProtocol.VARIANT_SUICIDE:
break;
case XBoardProtocol.PROTOVER:
XBoardProtocol.initialise();
@ -238,7 +247,6 @@ public class SuicideChess {
System.out.println("Hint: "+ComputerPlayer.doRandomMove(bitboard));
break;
case XBoardProtocol.FORCE:
openingPhase=false; //don't know what will happen next
computerPlaying = false;
break;
case XBoardProtocol.PING:
@ -273,6 +281,17 @@ public class SuicideChess {
System.out.println("Not a valid depth: "+ whatMove.substring(3));
}
break;
case XBoardProtocol.BOOK:
//display book moves
boolean temp = postThinkingOutput;
postThinkingOutput=true;
try {
OpeningBook.getMove(bitboard);
} catch (NoOpeningMovesLeft e) {
openingPhase = false;
}
postThinkingOutput=temp;
break;
case XBoardProtocol.UNKNOWN:
if (acceptedUsermove) {
System.out.println("Error (unknown command): "+whatMove);
@ -365,6 +384,7 @@ public class SuicideChess {
if(openingPhase) {
try {
computerMove = OpeningBook.getMove(bitboard);
OpeningBook.played(computerMove);
} catch (NoOpeningMovesLeft e) {
openingPhase = false;
computerMove = ComputerPlayer.doAlphaBetaMove(bitboard);