• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Anyone heard of N - Queens problem?

pookguy88

Golden Member
K, i need to do a Super N Queens problem in which not only can the queens not attack each other but we have to make it so that they can't attack each other even if they could move like knights do. Anyways, I'm trying to analyze a solution of the original N Queens problem that our Prof. posted to us that we can use. Here's a link:

N Queens Sample Solution

What I don't understand is the purpose of the two arrays, d1 and d2, that come after the row array. There's little comments that the author made beside each statement and I can figure out that these arrays have something to do with the diagonals on the chess board but I don't undertstand how they relate to that. Like the array for d1 is index=[2..2*N] and d2 index=[1..2*N-1]. Anyone wanna give it a shot? Also, this fricken program doesn't wanna compile for me as well. I put the (uses: wincrt😉 statement in cause I use a Windows compiler but it stops at the global var statements part. Thanx in advance for any help. Any clues on how to do the Super N Queens problem would be greatly appreciated.
 
wow ...
i've heard of the N-queens problem, and i'm glad i didn't have to take that proj (i was one semester before them 🙂)... don't know if it's considered lucky though, since until now i still can't figure out how to finish that problem 🙁

it looks like your prof's example is using pascal, and that's way over my head (i started with C, then C++, etc, and now they're basically gone from my head 😛 )

anyways, good luck with the program 🙂

-777-
 
Back
Top