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
		for row := 1 to 8 do 
			if not neighbor.canAttack(row, column) then
				return true
	until not
	return false
Intro OOP, Chapter 5, Slide 9