October 2024
Intermediate to advanced
272 pages
6h 54m
English
This example aims to show how you can use Starset, a set-based programming language, to solve a problem that seems utterly unrelated to sets: the eight queens problem.
The problem and its solution reportedly date back to 1848 when chess composer Max Bezzel published them. If you play chess or at least know the rules, the problem is about placing eight queens on an eight-by-eight chessboard such that no queen attacks any other queen. If you don’t play chess, the problem is about selecting eight locations in an eight-by-eight square grid such that no two chosen locations share the same row, column, or diagonal.

You can ...
Read now
Unlock full access