fn definite_within_bounds_v(&mut self) -> bool {
        let height = self.v_keys.len();
        let width = self.h_keys.len();
        let mut progress = false;
        for i in 0..height {
            let len = self.v_keys[i].len();
            for j in 0..len {
                let def_upper = self.v_keys[i][j].lower_bound - self.v_keys[i][j].value;
                let def_lower = self.v_keys[i][j].upper_bound + self.v_keys[i][j].value;

                if def_lower >= def_upper {
                    for n in def_upper..def_lower {
                        if n >= width {
                            continue;
                        }
                        if matches!(self.grid[i][n].cell_state, Status::Unknown) {
                            self.grid[i][n].cell_state = Status::Marked;
                            progress = true;
                        }
                    }
                    if def_lower - def_upper == self.v_keys[i][j].value {
                        if def_lower < width - 1
                            && matches!(self.grid[i][def_lower].cell_state, Status::Unknown)
                        {
                            self.grid[i][def_lower].cell_state = Status::Empty;
                            progress = true;
                        }
                        if def_upper > 0
                            && matches!(self.grid[i][def_upper - 1].cell_state, Status::Unknown)
                        {
                            self.grid[i][def_upper - 1].cell_state = Status::Empty;
                            progress = true;
                        }
                    }
                }
            }
        }
        progress
    }
//Set cells to marked if a given bound has definite marked cells within it.
//If the bound indicates that the entire key has been marked, mark the bounds as empty.
Set cells to marked if a given bound has definite marked cells within it.
If the bound indicates that the entire key has been marked, mark the bounds as empty.
Set cells to marked if a given bound has definite marked cells within it . If the bound indicates that the entire key has been marked mark the bounds as empty .
fn definite_within_bounds_v(&mut self) -> bool {
        let height = self.v_keys.len();
        let width = self.h_keys.len();
        let mut progress = false;
        for i in 0..height {
            let len = self.v_keys[i].len();
            for j in 0..len {
                let def_upper = self.v_keys[i][j].lower_bound - self.v_keys[i][j].value;
                let def_lower = self.v_keys[i][j].upper_bound + self.v_keys[i][j].value;
                if def_lower >= def_upper {
                    for n in def_upper..def_lower {
                        if n >= width {
                            continue;
                        }
                        if matches!(self.grid[i][n].cell_state, Status::Unknown) {
                            self.grid[i][n].cell_state = Status::Marked;
                            progress = true;
                        }
                    }
                    if def_lower - def_upper == self.v_keys[i][j].value {
                        if def_lower < width - 1
                            && matches!(self.grid[i][def_lower].cell_state, Status::Unknown)
                        {
                            self.grid[i][def_lower].cell_state = Status::Empty;
                            progress = true;
                        }
                        if def_upper > 0
                            && matches!(self.grid[i][def_upper - 1].cell_state, Status::Unknown)
                        {
                            self.grid[i][def_upper - 1].cell_state = Status::Empty;
                            progress = true;
                        }
                    }
                }
            }
        }
        progress
    }
fn definite_within_bounds_v ( & mut self ) -> bool { let height = self . v_keys . len ( ) ; let width = self . h_keys . len ( ) ; let mut progress = false ; for i in 0 .. height { let len = self . v_keys [ i ] . len ( ) ; for j in 0 .. len { let def_upper = self . v_keys [ i ] [ j ] . lower_bound - self . v_keys [ i ] [ j ] . value ; let def_lower = self . v_keys [ i ] [ j ] . upper_bound + self . v_keys [ i ] [ j ] . value ; if def_lower >= def_upper { for n in def_upper .. def_lower { if n >= width { continue ; } if matches ! ( self grid [ i ] [ n ] cell_state Status Unknown ) { self . grid [ i ] [ n ] . cell_state = Status :: Marked ; progress = true ; } } if def_lower - def_upper == self . v_keys [ i ] [ j ] . value { if def_lower < width - 1 && matches ! ( self grid [ i ] [ def_lower ] cell_state Status Unknown ) { self . grid [ i ] [ def_lower ] . cell_state = Status :: Empty ; progress = true ; } if def_upper > 0 && matches ! ( self grid [ i ] [ def_upper 1 ] cell_state Status Unknown ) { self . grid [ i ] [ def_upper - 1 ] . cell_state = Status :: Empty ; progress = true ; } } } } } progress }
Set cells to marked if a given bound has definite marked cells within it.
Set cells to marked if a given bound has definite marked cells within it .
&mut self
&mut self