LTChess

From Chessprogramming wiki
Jump to: navigation, search

Home * Engines * LTChess

LTChess,
a didactic open source chess program by Laurie Tunnicliffe, written in Pascal. The development started in January 2012. LTChess may be compiled using either Turbo Pascal, Free Pascal or Virtual Pascal compilers [1]. LTChess uses a 0x88 board representation and applies alpha-beta with iterative deepening, NMP, LMR and transposition table. It features separate mutually recursive procedures for the main search and quiescence search for White and Black. Evaluation is done by piece square tables, with some positional features added in. Move ordering uses the PST, killer heuristic and history heuristic. The classic triangular array is used to return the PV. So far, LTChess has a simple text style user interface. LTChess 2, released in December 2016, changed to NegaMax, added piece-lists to 0x88, now using copy/make instead of make/unmake [2] .

Code Sample

ClearPVDisplay;
GoToXY(51, 13);
Write('I''m Thinking.......');

FillChar(PV, SizeOf(PV), 0);
FillChar(HistoryTable, SizeOf(HistoryTable), 0);
FillChar(KillerMoves, SizeOf(KillerMoves), 0);
InitTT;

MaxDepth := 3; {-- do a 4 ply search first to fill history table etc }
TimesUp := False;
PVscore := 0;

Time := StopWatch(Start);
WHILE (MaxDepth < FixedDepth) AND NOT TimesUp AND (Abs(PVscore) < 30000) DO
BEGIN
    Inc(MaxDepth); {-- search the next ply...iterative deepening }
    ShufflePV(MaxDepth); {-- so the PV is the correct order for the next ply }
    SearchingPV := True; {-- we will search the PV moves first }
    PVscore := AlphaBetaMinMax(MaxDepth); {-- call the search }
    Time := StopWatch(Now);
    WriteInfoToScreen;
END;
{-- now return the best move from the PV array }
TheMove := PV[MaxDepth, MaxDepth];

Forum Posts

External Links

References

Up one level