https://rosettacode.org/wiki/Sierpinski_carpet#QB64'==================================================
Task
Produce a graphical or ASCII-art representation of a Sierpinski carpet of order N.
'==================================================
I produced the graphical option.
'labels
'carpets
Call carpet
(5, 20, 243, 0) Call carpet
(253, 20, 243, 1) Call carpet
(5, 293, 243, 2) Call carpet
(253, 293, 243, 3)
ix = x: iy = y: isize = size: iorder = order
Line (ix
, iy
)-(ix
+ isize
- 1, iy
+ isize
- 1), 1, BF
newX = ix + side
newY = iy + side
Line (newX
, newY
)-(newX
+ side
- 1, newY
+ side
- 1), 15, BF
iorder = iorder - 1
Call carpet
(newX
- side
, newY
- side
+ 1, side
, iorder
) Call carpet
(newX
, newY
- side
+ 1, side
, iorder
) Call carpet
(newX
+ side
, newY
- side
+ 1, side
, iorder
) Call carpet
(newX
+ side
, newY
, side
, iorder
) Call carpet
(newX
+ side
, newY
+ side
, side
, iorder
) Call carpet
(newX
, newY
+ side
, side
, iorder
) Call carpet
(newX
- side
, newY
+ side
, side
, iorder
) Call carpet
(newX
- side
, newY
, side
, iorder
)