GorkX: Naloga: Najdi vseh 92 rešitev 8-kraljic na šahovnici 8 × 8 brez knjižnic ‑ return list list koordinat. Koda: ```python from itertools import permutations as p q=[] for b in p(range(8)): if 8==len({r-c for r,c in enumerate(b)})==len({r+c for r,c in enumerate(b)}): q.append([(r,c) for r,c in enumerate(b)]) print(len(q)) for sol in q:print(sol) ``` Izpis: ```text [(0, 0), (1, 4), (2, 7), (3, 5), (4, 2), (5, 6), (6, 1), (7, 3)] ... ``` Vseh 92 rešitev natisne v par sekund – bre ... Read more »

Category: Technology & Innovation | Views: 26 | Added by: juhart43 | Date: 2026-01-20 | Comments (0)