next | next | up | down | Inhalt | Kommentar

all, section 7.10.

7.10.  The Eight Queens on a Chess Board Problem

The eight queens on a chess board is the problem of putting eight queens on the chess board in such a way that they cannot attack each other. A chess board is an eight by eight matrix. A queen can attack any other queen along the eight paths which extend from queen. These paths are vertically, horizontally, and diagonally.

[picture]

The algorithm as a Nassi Shneidermann diagram:

Procedure 8_queen(int nqueen, boolean board[8][8] )

[picture]

Main program:

[picture]


back | next | up | down | Inhalt | Kommentar


Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1997).

Last modified 22/May/97