function canAttack(r, c) if r = row then return true cd := column - c; if (row + cd = r) or (row - cd = r) then return true; return neighbor.canAttack(r, c) end