http://en.wikipedia.org/wiki/Eight_queens_puzzle#Sample_program
Here the program for 8 - queen puzzle.
But it is not working.
Plz tell what is the problem.
Here I tried to run it:
Earlier there was no 'x' in wikipedia I added 'x' there...
Am I correct and still it is not working.
PS: I don't know pascal, so plz don't get me on this. :)
In Russian Wikipedia there is solution in Basic, in Ukrainian Wikipedia there are solutions in Python and Prolog. You can take them even if you don't know Russian or Ukrainian. Also you can check other wiki's languages and find solution in program language that you know.
But take into account, that recursive backtracking works only for small boards. For large board many people recommend use simulated annealing. But as for me - good implemented random search works faster (100-200ms for 200x200 in Java, simulated annealing with Caughy distribution takes 1-3s on the same machine but maybe I don't pick up best parameters).
P.S. In English Wikipedia in Pascal solution there is error in initializing array b.
P.P.S. And solution you have tried have one more error - there is no declaration of variable x.
But it is filled in this way:
Should be:
Use original sources - they are always better, in Niklaus Wirth's book there are no such errors. ;)