Introduction to OOP: Chapter 5: A Case Study : Eight Queens [next] [previous] [audio] [real] [text]

Finding First Solution

Finding first solution, in pseudo-code:

function first : boolean;
	if not neighbor.first
		then return false
	repeat
		for row := 1 to 8 do 
			if not neighbor.canAttack(row, column) then
				return true
	until not neighbor.next
	return false
end
Intro OOP, Chapter 5, Slide 9