JS Schach

From Chessprogramming wiki
Jump to: navigation, search

Home * Engines * JS Schach

JS Schach, (Schachspiel)
a didactic open source chess program by Jürgen Schlottke, written in Turbo Pascal and published in 1993. Roland Chastain is hosting the original source code, along with his UCI adaptation Moustique based on JS Schach [1].


JS Schach features a 10x12 Board, and an interesting but suboptimal search routine.


JS Schach's Alpha-Beta approximation doesn't use negamax nor indirect recursion with distinct routines for alternating max- and min-player, but direct recursion with conditional statements for the maximizing and minimizing side. The routine isn't used inside an iterative deepening loop, but is called with a fixed depth of usually 3 plies plus captures until a maximum depth of 5. Since there is no explicit quiescence search, the horizon condition is delegated inside the move loop combined with a made move was capture condition.

Passing beta as parameter while alpha always starts with its extreme initial value, misses deep cutoffs - which is not a big deal for the intended depth, but a serious slowdown for deeper searches, as demonstrated by Rasmus Althoff [2]. Further the cutoff conditions are too weak. The following C-like pseudo code is based on JS Schach's function maxwertung [3], but has alpha and beta flipped for the more conventional semantic.

int bestEval (int beta, int depth, bool maxplayer) {
  int alpha = maxplayer ? -32000 : +32000;
  // generate moves ..
  while (move = getMove() )  {
    // copy-make move
    if ((depth >= requestedDepth && !move.isCapture() ) || depth >= maxDepth)
      score = eval(...);
      score = bestEval(alpha, depth+1, !maxplayer);
    if (maxplayer)  {
      if (score > alpha) 
        alpha = score;
      if (alpha > beta) // should be >=
    } else { // minplayer
      if (score < alpha) 
        alpha = score;
      if (alpha < beta) // should be <=
  return alpha;

with the initial call

bestEval (32000, 1, true);


The evaluation considers only the incremental updated material balance from the the maximizing player's point of view. For the minimizing side, the returned value is negated.

See also

Forum Posts

External Links


Up one level