← Back to all activities한국어 →
♛ Eight Queens Problem

Place 8 queens
so that they cannot attack each other

In chess, a queen can move horizontally, vertically, or diagonally. Place 8 queens on an 8×8 chessboard so that no two queens can attack each other. Click a square to place a queen, and squares under attack will automatically be marked in red.

It helps to use the fact that each row can contain at most one queen. The goal is to place one queen in each column, for a total of 8 queens. There are 4,426,165,368 possible placements in total, but only 92 of them satisfy the conditions.
Click a square to place a queen
💡 The method used to solve this problem with a computer is called backtracking — you place queens one row at a time, and when you get stuck, you go back and try again.