(self, args)
LINE: Draw a patterned line or box.
LINE: Draw a patterned line or box.
LINE : Draw a patterned line or box .
def line_(self, args):
        """LINE: Draw a patterned line or box."""
        if self._mode.is_text_mode:
            raise error.BASICError(error.IFC)
        step0 = next(args)
        x0, y0 = (
            None if arg is None else values.to_single(arg).to_value()
            for _, arg in zip(range(2), args)
        )
        step1 = next(args)
        x1, y1 = (values.to_single(_arg).to_value() for _arg in islice(args, 2))
        coord0 = x0, y0, step0
        coord1 = x1, y1, step1
        attr_index = next(args)
        if attr_index:
            attr_index = values.to_int(attr_index)
            error.range_check(0, 255, attr_index)
        shape, pattern = args
        if attr_index is None:
            attr_index = -1
        if pattern is None:
            pattern = 0xffff
        else:
            pattern = values.to_int(pattern)
        if coord0 != (None, None, None):
            x0, y0 = self._get_window_physical(*coord0)
        else:
            x0, y0 = self._last_point
        x1, y1 = self._get_window_physical(*coord1)
        attr = self._get_attr_index(attr_index)
        if not shape:
            self._draw_line(x0, y0, x1, y1, attr, pattern)
        elif shape == b'B':
            self._draw_box(x0, y0, x1, y1, attr, pattern)
        elif shape == b'BF':
            self._draw_box_filled(x0, y0, x1, y1, attr)
        self._last_point = x1, y1
        self._last_attr = attr
def line_ ( self , args ) : if self . _mode . is_text_mode : raise error . BASICError ( error . IFC ) step0 = next ( args ) x0 , y0 = ( None if arg is None else values . to_single ( arg ) . to_value ( ) for _ , arg in zip ( range ( 2 ) , args ) ) step1 = next ( args ) x1 , y1 = ( values . to_single ( _arg ) . to_value ( ) for _arg in islice ( args , 2 ) ) coord0 = x0 , y0 , step0 coord1 = x1 , y1 , step1 attr_index = next ( args ) if attr_index : attr_index = values . to_int ( attr_index ) error . range_check ( 0 , 255 , attr_index ) shape , pattern = args if attr_index is None : attr_index = - 1 if pattern is None : pattern = 0xffff else : pattern = values . to_int ( pattern ) if coord0 != ( None , None , None ) : x0 , y0 = self . _get_window_physical ( * coord0 ) else : x0 , y0 = self . _last_point x1 , y1 = self . _get_window_physical ( * coord1 ) attr = self . _get_attr_index ( attr_index ) if not shape : self . _draw_line ( x0 , y0 , x1 , y1 , attr , pattern ) elif shape == b'B' : self . _draw_box ( x0 , y0 , x1 , y1 , attr , pattern ) elif shape == b'BF' : self . _draw_box_filled ( x0 , y0 , x1 , y1 , attr ) self . _last_point = x1 , y1 self . _last_attr = attr