fn check_line(&self, value: u8, indexes: [Position; 3]) -> (usize, usize, Position) {
        let mut val_num = 0;
        let mut empty_num = 0;
        let mut empty_pos = Position(0, 0);
        for &Position(x, y) in &indexes {
            let v = self.get(x, y);
            if v == value {
                val_num += 1;
            } else if v == CELL_EMPTY {
                empty_num += 1;
                empty_pos = Position(x, y);
            }
        }
        (val_num, empty_num, empty_pos)
    }
// Check line for values and return
// (number of values, number of empty cells, empty cell position).
// Empty cell position makes sense for 1 empty cell in line only.
Check line for values and return
(number of values, number of empty cells, empty cell position).
Empty cell position makes sense for 1 empty cell in line only.
Check line for values and return ( number of values number of empty cells empty cell position ) . Empty cell position makes sense for 1 empty cell in line only .
fn check_line(&self, value: u8, indexes: [Position; 3]) -> (usize, usize, Position) {
        let mut val_num = 0;
        let mut empty_num = 0;
        let mut empty_pos = Position(0, 0);
        for &Position(x, y) in &indexes {
            let v = self.get(x, y);
            if v == value {
                val_num += 1;
            } else if v == CELL_EMPTY {
                empty_num += 1;
                empty_pos = Position(x, y);
            }
        }
        (val_num, empty_num, empty_pos)
    }
fn check_line ( & self , value : u8 , indexes : [ Position ; 3 ] ) -> ( usize , usize , Position ) { let mut val_num = 0 ; let mut empty_num = 0 ; let mut empty_pos = Position ( 0 , 0 ) ; for & Position ( x , y ) in & indexes { let v = self . get ( x , y ) ; if v == value { val_num += 1 ; } else if v == CELL_EMPTY { empty_num += 1 ; empty_pos = Position ( x , y ) ; } } ( val_num , empty_num , empty_pos ) }
Check line for values and return
(number of values, number of empty cells, empty cell position).
Check line for values and return ( number of values number of empty cells empty cell position ) .
&self
value
u8
indexes
[Position; 3]
&self
value
u8
indexes
[Position; 3]