fn complete_groups_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();
            let mut complete = 0;
            let mut cell_state = 0;
            for j in 0..width {
                match self.grid[i][j].cell_state {
                    Status::Marked => {
                        if cell_state == 0 {
                            cell_state = 1;
                        }
                    }
                    Status::Empty => {
                        if cell_state == 1 {
                            complete += 1;
                        }
                        cell_state = 0;
                    }
                    Status::Unknown => cell_state = 2,
                }
            }
            if complete == len {
                for n in 0..width {
                    if matches!(self.grid[i][n].cell_state, Status::Unknown) {
                        progress = true;
                        self.grid[i][n].cell_state = Status::Empty;
                    }
                }
            }
        }
        progress
    }
//Mark the remaining cells in the row/cell if all the keys in the set have been determined
Mark the remaining cells in the row/cell if all the keys in the set have been determined
Mark the remaining cells in the row / cell if all the keys in the set have been determined
fn complete_groups_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();
            let mut complete = 0;
            let mut cell_state = 0;
            for j in 0..width {
                match self.grid[i][j].cell_state {
                    Status::Marked => {
                        if cell_state == 0 {
                            cell_state = 1;
                        }
                    }
                    Status::Empty => {
                        if cell_state == 1 {
                            complete += 1;
                        }
                        cell_state = 0;
                    }
                    Status::Unknown => cell_state = 2,
                }
            }
            if complete == len {
                for n in 0..width {
                    if matches!(self.grid[i][n].cell_state, Status::Unknown) {
                        progress = true;
                        self.grid[i][n].cell_state = Status::Empty;
                    }
                }
            }
        }
        progress
    }
fn complete_groups_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 ( ) ; let mut complete = 0 ; let mut cell_state = 0 ; for j in 0 .. width { match self . grid [ i ] [ j ] . cell_state { Status :: Marked => { if cell_state == 0 { cell_state = 1 ; } } Status :: Empty => { if cell_state == 1 { complete += 1 ; } cell_state = 0 ; } Status :: Unknown => cell_state = 2 , } } if complete == len { for n in 0 .. width { if matches ! ( self grid [ i ] [ n ] cell_state Status Unknown ) { progress = true ; self . grid [ i ] [ n ] . cell_state = Status :: Empty ; } } } } progress }
Mark the remaining cells in the row/cell if all the keys in the set have been determined
Mark the remaining cells in the row / cell if all the keys in the set have been determined
&mut self
&mut self