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.Position;
/**
* The main class for the chess GUI.
* @author petero
*/
/** The main class for the chess GUI. */
public class AppletGUI extends javax.swing.JApplet implements GUIInterface {
private static final long serialVersionUID = 7357610346389734323L;
ChessBoardPainter cbp;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -21,11 +21,7 @@ package chess;
import java.io.IOException;
import java.io.InputStream;
/**
* Position evaluation routines.
*
* @author petero
*/
/** Position evaluation routines. */
public class Evaluate {
static final int pV = 92 + Parameters.instance().getIntPar("pV");
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.Locale;
/**
*
* @author petero
*/
public class Game {
protected List<Move> moveList = null;
protected List<UndoInfo> uiInfoList = null;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -20,10 +20,7 @@ package chess;
import java.util.List;
/**
* Interface for human/computer players.
* @author petero
*/
/** Interface for human/computer players. */
public interface 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
* for three-fold repetition draw detection, and is better stored
* in a separate hash table.
* @author petero
*/
public class Position {
public int[] squares;

View File

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

View File

@ -20,10 +20,6 @@ package chess;
import java.util.Locale;
/**
*
* @author petero
*/
public class TextIO {
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.List;
/**
*
* @author petero
*/
public class TranspositionTable {
static final public class TTEntry {
long key; // Zobrist hash key

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,10 +24,6 @@ import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author petero
*/
public class 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.Pair;
/**
* Implements an opening book.
* @author petero
*/
/** Implements an opening book. */
public final class DroidBook {
static final class BookEntry {
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.tb.Probe;
/**
* A computer algorithm player.
* @author petero
*/
/** A computer algorithm player. */
public class DroidComputerPlayer {
private UCIEngine uciEngine = null;
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.UCIEngineBase;
/**
* UCI interface to cuckoochess engine.
* @author petero
*/
/** UCI interface to cuckoochess engine. */
public class CuckooChessEngine extends UCIEngineBase {
// Data set by the "position" command.

View File

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

View File

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

View File

@ -18,10 +18,7 @@
package org.petero.droidfish.gamelogic;
/**
* Exception class to represent parse errors in FEN or algebraic notation.
* @author petero
*/
/** Exception class to represent parse errors in FEN or algebraic notation. */
public class ChessParseError extends Exception {
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.GameTree.Node;
/**
* The glue between the chess engine and the GUI.
* @author petero
*/
/** The glue between the chess engine and the GUI. */
public class DroidChessController {
private DroidComputerPlayer computerPlayer = 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.gamelogic.GameTree.Node;
/**
*
* @author petero
*/
public class Game {
boolean pendingDrawOffer;
public GameTree tree;

View File

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

View File

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

View File

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

View File

@ -19,10 +19,7 @@
package org.petero.droidfish.gamelogic;
/**
* Constants for different piece types.
* @author petero
*/
/** Constants for different piece types. */
public class Piece {
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
* for three-fold repetition draw detection, and is better stored
* in a separate hash table.
* @author petero
*/
public class Position {
private int[] squares;

View File

@ -26,10 +26,7 @@ import org.petero.droidfish.PGNOptions;
import org.petero.droidfish.R;
/**
* Handle conversion of positions and moves to/from text format.
* @author petero
*/
/** Handle conversion of positions and moves to/from text format. */
public class TextIO {
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.
* Set by makeMove(). Used by unMakeMove().
* @author petero
*/
public class UndoInfo {
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.TextIO;
/**
*
* @author petero
*/
public class BookTest extends TestCase {
public BookTest() {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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