Home * Programming * Graphics Programming

Graphics Programming in computer chess is essentially about drawing chess positions or diagrams within a user interface to give users a visual feedback of the game state, while interacting with the program.

Pseudo Graphics

ASCII Diagrams

ASCII Diagrams on teleprinters were already used by early programs, such as The Bernstein Chess Program, and are still appropriate today for a rudimentary text oriented command line user interface, to display a position on a terminal with monospaced ASCII characters. One may further store the characters inside "human readable" ASCII files for logging- or debugging purposes. Several proposals to display an ASCII board were made in CCC [1] [2] . Ernst A. Heinz came up with the left one [3] , Reinhard Scharnagl proposed the right one with the remarks below [4] :
kqKQ -
  +------------------------+       +-*--b--c--d--*--f--g--*-+
8 |*R *N:*B *Q:*K *B:*N *R:|     8 |[r][n][b][q][k][b][n][r]|
7 |*P:*P *P:*P *P:*P *P:*P |     7 |[p][p][p][p][p][p][p][p]|
6 |   :::   :::   :::   :::|     6 |   :::   :::   :::   :::|
5 |:::   :::   :::   :::   |     5 |:::   :::   :::   :::   |
4 |   :::   :::   :::   :::|     4 |   :::   :::   :::   :::|
3 |:::   :::   :::   :::   |     3 |:::   :::   :::   :::   |
2 | P :P: P :P: P :P: P :P:|     2 |<P><P><P><P><P><P><P><P>|
1 |:R: N :B: Q :K: B :N: R |     1 |<R><N><B><Q><K><B><N><R>|
  +------------------------+     =>+-*--b--c--d--*--f--g--*-+
    a  b  c  d  e  f  g  h
a) with "*"  is shown, where castling potential resides (FRC specific)
b) with "=>" is shown, which side has to move


Some of the early home computers had semigraphics characters and sprites [5] for a more realistic board representation of chess programs.
MicroChess Screen on TRS-80, 1976 [6]

High Resolution Graphics

Next generation home- and personal computers already did support not only text mode and semigraphics, but graphic modes for resolutions supported by the computer monitor and its video controller. A system call was necessary to switch the video card into a mode, where each pixel was an element of an array mapped into the main memory, either bit-wise for black-and-white or nibble-, byte- or word-wise for sixteen, 256 or more colors or grayscale.

DOS Area

Programs running under MS-DOS on IBM PCs, initially using a color graphics adapter (CGA), and later Hercules graphics cards and video graphics array (VGA), needed to use a BIOS interrupt call, the INT 10H, to switch graphic modes accordantly to make all points addressable. Chess programs usually worked in fullscreen mode at that times on single tasking operating systems, the program run exclusively and could access whole the hardware and memory. A VGA resolution of 640x480 was quite sufficient for drawing an ergonomic chess board in 2D or even 3D.


With the advent of multitasking operating systems with memory protection between processes and a protection ring model, and their graphical user interfaces and window managers, direct access was no longer possible, and video hardware became abstract, accessible via API-calls of kernel- or graphic libraries or toolkits.


Psion for Atari ST [7]

See also


Forum Posts

External Links



Geometric primitives

Toolkits, Libraries and APIs



  1. ^ ASCII chess boards by Steffen Jakob, CCC, June 05, 2000
  2. ^ ASCII Board representation by Andreas Guettinger, CCC, December 08, 2003
  3. ^ Re: ASCII chess boards by Ernst A. Heinz, CCC, June 05, 2000
  4. ^ Re: ASCII Board representation by Reinhard Scharnagl, CCC, December 08, 2003
  5. ^ List of home computers by video hardware from Wikipedia
  6. ^ Microchess 1.5 running on a Radio Shack TRS-80 microcomputer, 1976, Courtesy of Peter Jennings, The Computer History Museum
  7. ^ Psion Chess screenshots from MobyGames
  8. ^ LaTeX from Wikipedia

What links here?

Up one Level