pascalabcnet/InstallerSamples/Algorithms/QueensNonRecursive.pas
Mikhalkovich Stanislav 5bd51e4c96 QueensNonRecursive.pas
2025-06-15 16:23:45 +03:00

6 lines
227 B
ObjectPascal
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Нерекурсивное решение задачи о расстановке 8 ферзей
## (1..8).Permutations
.Where(v->v.Numerate.Combinations(2)
.All(\(\(a,b),\(c,d)) -> abs(a-c)<>abs(b-d)))
.PrintLines