(self, args)
PAINT: Fill an area defined by a border attribute with a tiled pattern.
PAINT: Fill an area defined by a border attribute with a tiled pattern.
PAINT : Fill an area defined by a border attribute with a tiled pattern .
def paint_(self, args):
        """PAINT: Fill an area defined by a border attribute with a tiled pattern."""
        if self._mode.is_text_mode:
            raise error.BASICError(error.IFC)
        step = next(args)
        x, y = (values.to_single(_arg).to_value() for _arg in islice(args, 2))
        coord = x, y, step
        fill_attr_index, pattern = -1, None
        cval = next(args)
        if isinstance(cval, values.String):
            # pattern given; copy
            pattern = cval.to_str()
            # empty pattern "" is illegal function call
            error.throw_if(not pattern)
            # default for border, if pattern is specified as string: foreground attr
        elif cval is not None:
            fill_attr_index = values.to_int(cval)
            error.range_check(0, 255, fill_attr_index)
        border_index = next(args)
        if border_index is not None:
            border_index = values.to_int(border_index)
            error.range_check(0, 255, border_index)
        bg_pattern = next(args)
        if bg_pattern is not None:
            bg_pattern = values.pass_string(bg_pattern, err=error.IFC).to_str()
        list(args)
        # if paint *colour* specified, border default = paint colour
        # if paint *attribute* specified, border default = current foreground
        if border_index is None:
            border_index = fill_attr_index
        fill_attr = self._get_attr_index(fill_attr_index)
        border_attr = self._get_attr_index(border_index)
        self._flood_fill(coord, fill_attr, pattern, border_attr, bg_pattern)
def paint_ ( self , args ) : if self . _mode . is_text_mode : raise error . BASICError ( error . IFC ) step = next ( args ) x , y = ( values . to_single ( _arg ) . to_value ( ) for _arg in islice ( args , 2 ) ) coord = x , y , step fill_attr_index , pattern = - 1 , None cval = next ( args ) if isinstance ( cval , values . String ) : # pattern given; copy pattern = cval . to_str ( ) # empty pattern "" is illegal function call error . throw_if ( not pattern ) # default for border, if pattern is specified as string: foreground attr elif cval is not None : fill_attr_index = values . to_int ( cval ) error . range_check ( 0 , 255 , fill_attr_index ) border_index = next ( args ) if border_index is not None : border_index = values . to_int ( border_index ) error . range_check ( 0 , 255 , border_index ) bg_pattern = next ( args ) if bg_pattern is not None : bg_pattern = values . pass_string ( bg_pattern , err = error . IFC ) . to_str ( ) list ( args ) # if paint *colour* specified, border default = paint colour # if paint *attribute* specified, border default = current foreground if border_index is None : border_index = fill_attr_index fill_attr = self . _get_attr_index ( fill_attr_index ) border_attr = self . _get_attr_index ( border_index ) self . _flood_fill ( coord , fill_attr , pattern , border_attr , bg_pattern )