Queens A famous problem in the game of chess concerns the placement of queens on a board. The queen is a game piece that can move in a horizontal, vertical, or diagonal direction arbitrarily far. We say that a queen threatens a tile if it is on the tile or can move to it.
Figure shows an example.
The solid disk represents a queen in the second column and sixth row. The solid lines radiating from the disk go through all those tiles that are threatened by the queen. In computing, we generalize the problem of course and ask whether we can place n queens on some board of arbitrary size m by m . Even a cursory glance at the problem suggests that we need a data representation of boards and some basic functions on boards before we can even think of designing a program that solves the problem. Let's start with some basic data and function definitions.