Removed useless comments.

This commit is contained in:
Peter Osterlund 2016-12-25 13:20:14 +01:00
parent 82d2daa29d
commit 1808bbb10c
61 changed files with 26 additions and 233 deletions

View File

@ -28,10 +28,7 @@ import chess.ComputerPlayer;
import chess.Move; import chess.Move;
import chess.Position; import chess.Position;
/** /** The main class for the chess GUI. */
* The main class for the chess GUI.
* @author petero
*/
public class AppletGUI extends javax.swing.JApplet implements GUIInterface { public class AppletGUI extends javax.swing.JApplet implements GUIInterface {
private static final long serialVersionUID = 7357610346389734323L; private static final long serialVersionUID = 7357610346389734323L;
ChessBoardPainter cbp; ChessBoardPainter cbp;

View File

@ -35,10 +35,7 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import javax.swing.JLabel; import javax.swing.JLabel;
/** /** Draws a graphical chess board. Also handles user interaction. */
* Draws a graphical chess board. Also handles user interaction.
* @author petero
*/
public class ChessBoardPainter extends JLabel { public class ChessBoardPainter extends JLabel {
private static final long serialVersionUID = -1319250011487017825L; private static final long serialVersionUID = -1319250011487017825L;
private Position pos; private Position pos;

View File

@ -25,10 +25,6 @@ import chess.HumanPlayer;
import chess.Player; import chess.Player;
import chess.TreeLogger; import chess.TreeLogger;
/**
*
* @author petero
*/
public class Main { public class Main {
/** /**

View File

@ -41,10 +41,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
/** /** Control the search thread. */
* Control the search thread.
* @author petero
*/
public class EngineControl { public class EngineControl {
PrintStream os; PrintStream os;

View File

@ -22,10 +22,7 @@ import chess.Move;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /** Store search parameters (times, increments, max depth, etc). */
* Store search parameters (times, increments, max depth, etc).
* @author petero
*/
public class SearchParams { public class SearchParams {
List<Move> searchMoves; // If non-empty, search only these moves List<Move> searchMoves; // If non-empty, search only these moves
int wTime; // White remaining time, ms int wTime; // White remaining time, ms

View File

@ -30,10 +30,7 @@ import java.io.InputStreamReader;
import java.io.PrintStream; import java.io.PrintStream;
import java.util.ArrayList; import java.util.ArrayList;
/** /** Handle the UCI protocol mode. */
* Handle the UCI protocol mode.
* @author petero
*/
public class UCIProtocol { public class UCIProtocol {
// Data set by the "position" command. // Data set by the "position" command.
Position pos; Position pos;

View File

@ -25,10 +25,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class UCIProtocolTest { public class UCIProtocolTest {
public UCIProtocolTest() { public UCIProtocolTest() {

View File

@ -32,10 +32,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random; import java.util.Random;
/** /** Implements an opening book. */
* Implements an opening book.
* @author petero
*/
public class Book { public class Book {
public static class BookEntry { public static class BookEntry {
Move move; Move move;

View File

@ -18,10 +18,7 @@
package chess; package chess;
/** /** Exception class to represent parse errors in FEN or algebraic notation. */
* Exception class to represent parse errors in FEN or algebraic notation.
* @author petero
*/
public class ChessParseError extends Exception { public class ChessParseError extends Exception {
private static final long serialVersionUID = -6051856171275301175L; private static final long serialVersionUID = -6051856171275301175L;
public ChessParseError() { public ChessParseError() {

View File

@ -22,10 +22,7 @@ import java.security.SecureRandom;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
/** /** A computer algorithm player. */
* A computer algorithm player.
* @author petero
*/
public class ComputerPlayer implements Player { public class ComputerPlayer implements Player {
public static final String engineName; public static final String engineName;

View File

@ -21,11 +21,7 @@ package chess;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
/** /** Position evaluation routines. */
* Position evaluation routines.
*
* @author petero
*/
public class Evaluate { public class Evaluate {
static final int pV = 92 + Parameters.instance().getIntPar("pV"); static final int pV = 92 + Parameters.instance().getIntPar("pV");
static final int nV = 385 + Parameters.instance().getIntPar("nV"); static final int nV = 385 + Parameters.instance().getIntPar("nV");

View File

@ -23,10 +23,6 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
/**
*
* @author petero
*/
public class Game { public class Game {
protected List<Move> moveList = null; protected List<Move> moveList = null;
protected List<UndoInfo> uiInfoList = null; protected List<UndoInfo> uiInfoList = null;

View File

@ -18,10 +18,7 @@
package chess; package chess;
/** /** Implements the relative history heuristic. */
* Implements the relative history heuristic.
* @author petero
*/
public final class History { public final class History {
private int countSuccess[][]; private int countSuccess[][];
private int countFail[][]; private int countFail[][];

View File

@ -24,10 +24,7 @@ import java.io.InputStreamReader;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
/** /** A player that reads input from the keyboard. */
* A player that reads input from the keyboard.
* @author petero
*/
public class HumanPlayer implements Player { public class HumanPlayer implements Player {
private String lastCmd = ""; private String lastCmd = "";
private BufferedReader in; private BufferedReader in;

View File

@ -18,10 +18,7 @@
package chess; package chess;
/** /** Implement a table of killer moves for the killer heuristic. */
* Implement a table of killer moves for the killer heuristic.
* @author petero
*/
public class KillerTable { public class KillerTable {
/** There is one KTEntry for each ply in the search tree. */ /** There is one KTEntry for each ply in the search tree. */
static final class KTEntry { static final class KTEntry {

View File

@ -20,10 +20,6 @@ package chess;
import java.util.Comparator; import java.util.Comparator;
/**
*
* @author petero
*/
public class Move { public class Move {
/** From square, 0-63. */ /** From square, 0-63. */
public int from; public int from;

View File

@ -20,10 +20,6 @@ package chess;
import java.util.List; import java.util.List;
/**
*
* @author petero
*/
public final class MoveGen { public final class MoveGen {
static final MoveGen instance; static final MoveGen instance;
static { static {

View File

@ -18,10 +18,7 @@
package chess; package chess;
/** /** Constants for different piece types. */
* Constants for different piece types.
* @author petero
*/
public class Piece { public class Piece {
public static final int EMPTY = 0; public static final int EMPTY = 0;

View File

@ -20,10 +20,7 @@ package chess;
import java.util.List; import java.util.List;
/** /** Interface for human/computer players. */
* Interface for human/computer players.
* @author petero
*/
public interface Player { public interface Player {
/** /**
* Get a command from a player. * Get a command from a player.

View File

@ -27,7 +27,6 @@ import java.security.NoSuchAlgorithmException;
* since the last capture or pawn move. That state is only needed * since the last capture or pawn move. That state is only needed
* for three-fold repetition draw detection, and is better stored * for three-fold repetition draw detection, and is better stored
* in a separate hash table. * in a separate hash table.
* @author petero
*/ */
public class Position { public class Position {
public int[] squares; public int[] squares;

View File

@ -24,10 +24,6 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Comparator; import java.util.Comparator;
/**
*
* @author petero
*/
public class Search { public class Search {
final static int plyScale = 8; // Fractional ply resolution final static int plyScale = 8; // Fractional ply resolution

View File

@ -20,10 +20,6 @@ package chess;
import java.util.Locale; import java.util.Locale;
/**
*
* @author petero
*/
public class TextIO { public class TextIO {
static public final String startPosFEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"; static public final String startPosFEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";

View File

@ -21,10 +21,6 @@ package chess;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/**
*
* @author petero
*/
public class TranspositionTable { public class TranspositionTable {
static final public class TTEntry { static final public class TTEntry {
long key; // Zobrist hash key long key; // Zobrist hash key

View File

@ -18,10 +18,7 @@
package chess; package chess;
/** /** A helper class that makes it possible to return two values from a function. */
* A small helper class that makes it possible to return two values from a function.
* @author petero
*/
public final class TwoReturnValues<T1, T2> { public final class TwoReturnValues<T1, T2> {
public final T1 first; public final T1 first;
public final T2 second; public final T2 second;

View File

@ -21,7 +21,6 @@ package chess;
/** /**
* Contains enough information to undo a previous move. * Contains enough information to undo a previous move.
* Set by makeMove(). Used by unMakeMove(). * Set by makeMove(). Used by unMakeMove().
* @author petero
*/ */
public class UndoInfo { public class UndoInfo {
int capturedPiece; int capturedPiece;

View File

@ -39,10 +39,7 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Scanner; import java.util.Scanner;
/** /** The glue between the chess engine and the GUI. */
* The glue between the chess engine and the GUI.
* @author petero
*/
public class ChessController { public class ChessController {
Player humanPlayer; Player humanPlayer;
ComputerPlayer computerPlayer; ComputerPlayer computerPlayer;

View File

@ -23,10 +23,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class BookTest { public class BookTest {
public BookTest() { public BookTest() {

View File

@ -24,10 +24,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class ComputerPlayerTest { public class ComputerPlayerTest {
public ComputerPlayerTest() { public ComputerPlayerTest() {

View File

@ -23,10 +23,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class EvaluateTest { public class EvaluateTest {
public EvaluateTest() { public EvaluateTest() {

View File

@ -23,10 +23,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class GameTest { public class GameTest {
public GameTest() { public GameTest() {

View File

@ -25,10 +25,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class HistoryTest { public class HistoryTest {
public HistoryTest() { public HistoryTest() {

View File

@ -23,10 +23,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class KillerTableTest { public class KillerTableTest {
public KillerTableTest() { public KillerTableTest() {

View File

@ -25,10 +25,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class MoveGenTest { public class MoveGenTest {
public MoveGenTest() { public MoveGenTest() {

View File

@ -25,10 +25,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class MoveTest { public class MoveTest {
public MoveTest() { public MoveTest() {

View File

@ -23,10 +23,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class PieceTest { public class PieceTest {
public PieceTest() { public PieceTest() {

View File

@ -27,10 +27,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class PositionTest { public class PositionTest {
public PositionTest() { public PositionTest() {

View File

@ -25,10 +25,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class SearchTest { public class SearchTest {
static final long[] nullHist = new long[200]; static final long[] nullHist = new long[200];
static TranspositionTable tt = new TranspositionTable(19); static TranspositionTable tt = new TranspositionTable(19);

View File

@ -25,10 +25,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class TextIOTest { public class TextIOTest {
public TextIOTest() { public TextIOTest() {

View File

@ -24,10 +24,6 @@ import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class TranspositionTableTest { public class TranspositionTableTest {
public TranspositionTableTest() { public TranspositionTableTest() {

View File

@ -33,10 +33,7 @@ import org.petero.droidfish.gamelogic.Position;
import org.petero.droidfish.gamelogic.TextIO; import org.petero.droidfish.gamelogic.TextIO;
import org.petero.droidfish.gamelogic.Pair; import org.petero.droidfish.gamelogic.Pair;
/** /** Implements an opening book. */
* Implements an opening book.
* @author petero
*/
public final class DroidBook { public final class DroidBook {
static final class BookEntry { static final class BookEntry {
Move move; Move move;

View File

@ -36,10 +36,7 @@ import org.petero.droidfish.gamelogic.UndoInfo;
import org.petero.droidfish.gamelogic.SearchListener.PvInfo; import org.petero.droidfish.gamelogic.SearchListener.PvInfo;
import org.petero.droidfish.tb.Probe; import org.petero.droidfish.tb.Probe;
/** /** A computer algorithm player. */
* A computer algorithm player.
* @author petero
*/
public class DroidComputerPlayer { public class DroidComputerPlayer {
private UCIEngine uciEngine = null; private UCIEngine uciEngine = null;
private final SearchListener listener; private final SearchListener listener;

View File

@ -32,10 +32,7 @@ import org.petero.droidfish.EngineOptions;
import org.petero.droidfish.engine.LocalPipe; import org.petero.droidfish.engine.LocalPipe;
import org.petero.droidfish.engine.UCIEngineBase; import org.petero.droidfish.engine.UCIEngineBase;
/** /** UCI interface to cuckoochess engine. */
* UCI interface to cuckoochess engine.
* @author petero
*/
public class CuckooChessEngine extends UCIEngineBase { public class CuckooChessEngine extends UCIEngineBase {
// Data set by the "position" command. // Data set by the "position" command.

View File

@ -38,10 +38,7 @@ import java.util.Random;
import org.petero.droidfish.engine.LocalPipe; import org.petero.droidfish.engine.LocalPipe;
/** /** Control the search thread. */
* Control the search thread.
* @author petero
*/
public class DroidEngineControl { public class DroidEngineControl {
LocalPipe os; LocalPipe os;

View File

@ -22,10 +22,7 @@ import chess.Move;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /** Store search parameters (times, increments, max depth, etc). */
* Store search parameters (times, increments, max depth, etc).
* @author petero
*/
public class SearchParams { public class SearchParams {
List<Move> searchMoves; // If non-empty, search only these moves List<Move> searchMoves; // If non-empty, search only these moves
int wTime; // White remaining time, ms int wTime; // White remaining time, ms

View File

@ -18,10 +18,7 @@
package org.petero.droidfish.gamelogic; package org.petero.droidfish.gamelogic;
/** /** Exception class to represent parse errors in FEN or algebraic notation. */
* Exception class to represent parse errors in FEN or algebraic notation.
* @author petero
*/
public class ChessParseError extends Exception { public class ChessParseError extends Exception {
private static final long serialVersionUID = -6051856171275301175L; private static final long serialVersionUID = -6051856171275301175L;

View File

@ -44,10 +44,7 @@ import org.petero.droidfish.engine.DroidComputerPlayer.SearchType;
import org.petero.droidfish.gamelogic.Game.GameState; import org.petero.droidfish.gamelogic.Game.GameState;
import org.petero.droidfish.gamelogic.GameTree.Node; import org.petero.droidfish.gamelogic.GameTree.Node;
/** /** The glue between the chess engine and the GUI. */
* The glue between the chess engine and the GUI.
* @author petero
*/
public class DroidChessController { public class DroidChessController {
private DroidComputerPlayer computerPlayer = null; private DroidComputerPlayer computerPlayer = null;
private PgnToken.PgnTokenReceiver gameTextListener = null; private PgnToken.PgnTokenReceiver gameTextListener = null;

View File

@ -27,10 +27,6 @@ import java.util.List;
import org.petero.droidfish.PGNOptions; import org.petero.droidfish.PGNOptions;
import org.petero.droidfish.gamelogic.GameTree.Node; import org.petero.droidfish.gamelogic.GameTree.Node;
/**
*
* @author petero
*/
public class Game { public class Game {
boolean pendingDrawOffer; boolean pendingDrawOffer;
public GameTree tree; public GameTree tree;

View File

@ -18,10 +18,6 @@
package org.petero.droidfish.gamelogic; package org.petero.droidfish.gamelogic;
/**
*
* @author petero
*/
public class Move { public class Move {
/** From square, 0-63. */ /** From square, 0-63. */
public int from; public int from;

View File

@ -21,10 +21,6 @@ package org.petero.droidfish.gamelogic;
import java.util.ArrayList; import java.util.ArrayList;
/**
*
* @author petero
*/
public class MoveGen { public class MoveGen {
public static MoveGen instance; public static MoveGen instance;
static { static {

View File

@ -18,10 +18,7 @@
package org.petero.droidfish.gamelogic; package org.petero.droidfish.gamelogic;
/** /** A helper class that makes it possible to return two values from a function. */
* A small helper class that makes it possible to return two values from a function.
* @author petero
*/
public final class Pair<T1, T2> { public final class Pair<T1, T2> {
public final T1 first; public final T1 first;
public final T2 second; public final T2 second;

View File

@ -19,10 +19,7 @@
package org.petero.droidfish.gamelogic; package org.petero.droidfish.gamelogic;
/** /** Constants for different piece types. */
* Constants for different piece types.
* @author petero
*/
public class Piece { public class Piece {
public static final int EMPTY = 0; public static final int EMPTY = 0;

View File

@ -27,7 +27,6 @@ import java.security.NoSuchAlgorithmException;
* since the last capture or pawn move. That state is only needed * since the last capture or pawn move. That state is only needed
* for three-fold repetition draw detection, and is better stored * for three-fold repetition draw detection, and is better stored
* in a separate hash table. * in a separate hash table.
* @author petero
*/ */
public class Position { public class Position {
private int[] squares; private int[] squares;

View File

@ -26,10 +26,7 @@ import org.petero.droidfish.PGNOptions;
import org.petero.droidfish.R; import org.petero.droidfish.R;
/** /** Handle conversion of positions and moves to/from text format. */
* Handle conversion of positions and moves to/from text format.
* @author petero
*/
public class TextIO { public class TextIO {
static public final String startPosFEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"; static public final String startPosFEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";

View File

@ -21,7 +21,6 @@ package org.petero.droidfish.gamelogic;
/** /**
* Contains enough information to undo a previous move. * Contains enough information to undo a previous move.
* Set by makeMove(). Used by unMakeMove(). * Set by makeMove(). Used by unMakeMove().
* @author petero
*/ */
public class UndoInfo { public class UndoInfo {
int capturedPiece; int capturedPiece;

View File

@ -30,10 +30,6 @@ import org.petero.droidfish.gamelogic.MoveGen;
import org.petero.droidfish.gamelogic.Position; import org.petero.droidfish.gamelogic.Position;
import org.petero.droidfish.gamelogic.TextIO; import org.petero.droidfish.gamelogic.TextIO;
/**
*
* @author petero
*/
public class BookTest extends TestCase { public class BookTest extends TestCase {
public BookTest() { public BookTest() {

View File

@ -23,10 +23,6 @@ import java.util.ArrayList;
import junit.framework.TestCase; import junit.framework.TestCase;
/**
*
* @author petero
*/
public class GameTest extends TestCase { public class GameTest extends TestCase {
public GameTest() { public GameTest() {

View File

@ -23,10 +23,6 @@ import java.util.List;
import junit.framework.TestCase; import junit.framework.TestCase;
/**
*
* @author petero
*/
public class MoveGenTest extends TestCase { public class MoveGenTest extends TestCase {
public MoveGenTest() { public MoveGenTest() {

View File

@ -20,10 +20,6 @@ package org.petero.droidfish.gamelogic;
import junit.framework.TestCase; import junit.framework.TestCase;
/**
*
* @author petero
*/
public class MoveTest extends TestCase { public class MoveTest extends TestCase {
public MoveTest() { public MoveTest() {

View File

@ -21,10 +21,6 @@ package org.petero.droidfish.gamelogic;
import junit.framework.TestCase; import junit.framework.TestCase;
/**
*
* @author petero
*/
public class PieceTest extends TestCase { public class PieceTest extends TestCase {
public PieceTest() { public PieceTest() {

View File

@ -23,10 +23,6 @@ import java.util.List;
import junit.framework.TestCase; import junit.framework.TestCase;
/**
*
* @author petero
*/
public class PositionTest extends TestCase { public class PositionTest extends TestCase {
public PositionTest() { public PositionTest() {

View File

@ -21,10 +21,6 @@ package org.petero.droidfish.gamelogic;
import junit.framework.TestCase; import junit.framework.TestCase;
/**
*
* @author petero
*/
public class TextIOTest extends TestCase { public class TextIOTest extends TestCase {
public TextIOTest() { public TextIOTest() {