Which engines are open source, with easy to read and extend code, and reasonably strong?

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

evert823
Posts: 38
Joined: Thu Oct 29, 2020 9:32 am
Full name: Evert Jan Karman

Re: Which engines are open source, with easy to read and extend code, and reasonably strong?

Post by evert823 »

hgm wrote: Fri Oct 25, 2024 1:41 pm It is difficult to give good advice without knowing your goals.
It's because of my surprise that I don't see engines for 3D anywhere.
I imagine that whenever I find this

Code: Select all

for x from 1 to 8
   for y from 1 to 8
I would replace it with

Code: Select all

for x from 1 to 8
   for y from 1 to 8
      for z from 1 to 8
and we're done. (That would be perhaps too simplistic.)
User avatar
hgm
Posts: 28390
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Which engines are open source, with easy to read and extend code, and reasonably strong?

Post by hgm »

Indeed, that would be easy enough. But most engines use 1-dimensional arrays for speed (if they use a mailbox representation), so you would still have to define a mapping of x,y,z to an array index.

Even 2d programs like the Interactive Diagram can mimic 3d or 4b space boards, though. On chessvariants.com I have seen several of those. The point is that representation on a computer display is inherently 2d. So such variants are typically displayed as a table of 2d boards, each such 2d board representing a layer of the larger space. Moves in the 3rd or 4th dimension then simply jump between boards, which can be mimicked by giving the piece a large leap, and putting the layer boards far enough from each other such that the in-layer moves cannot cross the separation band.

But in a typed language like Cor C++ engines for orthodox Chess often assume that the square numbers fit in a single byte, and move descriptors in a pair of bytes. So you would still have to make many changes because the 3d space has too many cells.