fn erase_all(&mut self) {
        self.add_command(Command::PenLift);
        self.add_command(Command::Move(0, IBB_HEIGHT * 10));
        self.add_command(Command::EnableEraser);
        let mut y = IBB_HEIGHT;
        let y_step = 10;
        loop {
            // Loop until we're at the bottom
            if y <= 0 {
                break;
            }

            // Move to right and step down
            self.add_command(Command::Move(IBB_WIDTH * 10, y * 10));
            if y > y_step {
                y -= y_step;
            } else {
                y = 0;
            }

            // Move back to left and step down
            self.add_command(Command::Move(IBB_WIDTH * 10, y * 10));
            self.add_command(Command::Move(0, y * 10));
            if y > y_step {
                y -= y_step;
            } else {
                y = 0;
            }
            self.add_command(Command::Move(0, y * 10));
        }
        self.add_command(Command::PenLift);
        self.add_command(Command::Move(0, 0));
    }
/// Erase the entire board.
/// Note that this does not contain the `StartDrawing` and `Stop Drawing`
/// commands!
Erase the entire board.
Note that this does not contain the `StartDrawing` and `Stop Drawing`
commands!
Erase the entire board . Note that this does not contain the ` StartDrawing ` and ` Stop Drawing ` commands!
fn erase_all(&mut self) {
        self.add_command(Command::PenLift);
        self.add_command(Command::Move(0, IBB_HEIGHT * 10));
        self.add_command(Command::EnableEraser);
        let mut y = IBB_HEIGHT;
        let y_step = 10;
        loop {
            // Loop until we're at the bottom
            if y <= 0 {
                break;
            }
            // Move to right and step down
            self.add_command(Command::Move(IBB_WIDTH * 10, y * 10));
            if y > y_step {
                y -= y_step;
            } else {
                y = 0;
            }
            // Move back to left and step down
            self.add_command(Command::Move(IBB_WIDTH * 10, y * 10));
            self.add_command(Command::Move(0, y * 10));
            if y > y_step {
                y -= y_step;
            } else {
                y = 0;
            }
            self.add_command(Command::Move(0, y * 10));
        }
        self.add_command(Command::PenLift);
        self.add_command(Command::Move(0, 0));
    }
fn erase_all ( & mut self ) { self . add_command ( Command :: PenLift ) ; self . add_command ( Command :: Move ( 0 , IBB_HEIGHT * 10 ) ) ; self . add_command ( Command :: EnableEraser ) ; let mut y = IBB_HEIGHT ; let y_step = 10 ; loop { // Loop until we're at the bottom if y <= 0 { break ; } // Move to right and step down self . add_command ( Command :: Move ( IBB_WIDTH * 10 , y * 10 ) ) ; if y > y_step { y -= y_step ; } else { y = 0 ; } // Move back to left and step down self . add_command ( Command :: Move ( IBB_WIDTH * 10 , y * 10 ) ) ; self . add_command ( Command :: Move ( 0 , y * 10 ) ) ; if y > y_step { y -= y_step ; } else { y = 0 ; } self . add_command ( Command :: Move ( 0 , y * 10 ) ) ; } self . add_command ( Command :: PenLift ) ; self . add_command ( Command :: Move ( 0 , 0 ) ) ; }
Erase the entire board.
Erase the entire board .
&mut self
&mut self