pub fn flipcell(&mut self) -> BinaryCell {
        // Retrieve the current cell from the position of the turmite
        let (x, y, cell) = self.position;

        // Check the cell state the flip it
        let newcell = match cell {
            BinaryCell::Active => BinaryCell::Passive,
            BinaryCell::Passive => BinaryCell::Active
        };

        // Update the turmite's position with the new cell state
        self.position = (x,y, newcell);
        // Return the new cell state
        return newcell
    }
/// A method that returns the flipped cell state
/// of the current cell the turmite is on.
A method that returns the flipped cell state
of the current cell the turmite is on.
A method that returns the flipped cell state of the current cell the turmite is on .
pub fn flipcell(&mut self) -> BinaryCell {
        // Retrieve the current cell from the position of the turmite
        let (x, y, cell) = self.position;
        // Check the cell state the flip it
        let newcell = match cell {
            BinaryCell::Active => BinaryCell::Passive,
            BinaryCell::Passive => BinaryCell::Active
        };
        // Update the turmite's position with the new cell state
        self.position = (x,y, newcell);
        // Return the new cell state
        return newcell
    }
pub fn flipcell ( & mut self ) -> BinaryCell { // Retrieve the current cell from the position of the turmite let ( x , y , cell ) = self . position ; // Check the cell state the flip it let newcell = match cell { BinaryCell :: Active => BinaryCell :: Passive , BinaryCell :: Passive => BinaryCell :: Active } ; // Update the turmite's position with the new cell state self . position = ( x , y , newcell ) ; // Return the new cell state return newcell }
A method that returns the flipped cell state
of the current cell the turmite is on.
A method that returns the flipped cell state of the current cell the turmite is on .
&mut self
&mut self