Originally Posted by
Adak
Here's what I suggest:
1) The thread part of this is a small amount of code, and how it should be implemented (as far as an algorithm), is explained in your post:
Place the first queen, and then find the rest (if possible) with the child thread.
I'm no expert on threads and processes, but that doesn't seem like a big big deal, because it's just a few lines of code, and many examples and discussions of it, on the net.
My point being, that you should concentrate on getting the rest of the program coded up and working, first.
Then add the threading part.
2) With #1 in mind, you have to know that this code you posted can't work in C, as it is. It's impossible. If you can code up an 8 queens program yourself, do that. If not, see what you can find, that IS C code, and you have some chance of understanding.
Sometimes you can take a program in another language, and "translate it" into C pretty easily. But not the posted program. It's deeply integrated into the language (PL/1, Oberon, or whatever it is), and can't be "translated".
Also, it's from a book by a world famous author - you certainly can't turn it in and say "here's my program". They might even expel you for such an obvious act of plagiarism.
Your thoughts?