pub fn clear_lines(&mut self, lines: &mut Vec<usize>) {
        let mut n = lines.pop().unwrap_or(self.height);
        let mut sy = self.height as i32 - 1;
        for y in (0..self.height).rev() {
            while sy == n as i32 {
                sy -= 1;
                n = lines.pop().unwrap_or(self.height);
            }
            self.copy_row(sy,y);
            sy -= 1;
        }
    }
//precondition: lines is a sorted vector of line indices.
lines is a sorted vector of line indices.
lines is a sorted vector of line indices .
pub fn clear_lines(&mut self, lines: &mut Vec<usize>) {
        let mut n = lines.pop().unwrap_or(self.height);
        let mut sy = self.height as i32 - 1;
        for y in (0..self.height).rev() {
            while sy == n as i32 {
                sy -= 1;
                n = lines.pop().unwrap_or(self.height);
            }
            self.copy_row(sy,y);
            sy -= 1;
        }
    }
pub fn clear_lines ( & mut self , lines : & mut Vec < usize > ) { let mut n = lines . pop ( ) . unwrap_or ( self . height ) ; let mut sy = self . height as i32 - 1 ; for y in ( 0 .. self . height ) . rev ( ) { while sy == n as i32 { sy -= 1 ; n = lines . pop ( ) . unwrap_or ( self . height ) ; } self . copy_row ( sy , y ) ; sy -= 1 ; } }
precondition: lines is a sorted vector of line indices.
precondition : lines is a sorted vector of line indices .
&mut self
lines
&mut Vec<usize>
&mut self
lines
&mut Vec<usize>