Jump to content

N-queens minimum and knights and bishops: Difference between revisions

m
(→‎{{header|Wren}}: Improvements in line with Go example.)
Line 1,619:
=={{header|Wren}}==
{{libheader|Wren-fmt}}
This was oringinallyoriginally based on the Java code [https://www.geeksforgeeks.org/minimum-queens-required-to-cover-all-the-squares-of-a-chess-board/ here] which uses a backtracking algorithm and which I extended to deal with bishops and knights as well as queens when translating to Wren. I then used the more efficient way for checking the diagonals described [https://www.geeksforgeeks.org/n-queen-problem-using-branch-and-bound/ here] and have now incorporated the improvements made to the Go version.
 
Although far quicker than it was originally (it now gets to 7 knights in less than a minute), it struggles after that and needs north of 26 minutes to get to 10.
9,485

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.