Your trusted source for computer chess information!


SecondChess is a didactical chess engine written in C by Emilio Díaz and based on FirstChess code of Pham Hong Nguyen, addressed to programmers who want to learn how a chess engine works.

Main Features

  • One single C code file heavily commented, around 2000 lines
  • Licensed under GPL: source available at
  • Board representation: one 64 int array for pieces and one 64 int array for colors
  • Rules Implemented: castle, en passant and promotion
  • Robust move generator: al positions tested so far have been matched by secondchess
  • perft function implemented
  • Selectable search depth
  • Simple evaluation: material + piece square tables
  • Simple Alpha-Beta search + Quiescent
  • Basic Xboard support


  • No three moves repetition
  • No 50 moves rule
  • After every two squares pawn move an en passant square is created, most of the times unnecessarily
  • No time management



Personal Tools