I suggest recursive function call as follows.
DEF DSQ X,Y,L
VAR D=L/3
GFILL X,Y,X+L-1,Y+L-1,#GRAY
GFILL X+D,Y+D,X+D*2-1,Y+D*2-1,0
IF D<3 THEN @FEND
DSQ X,Y,D:DSQ X+D,Y,D:DSQ X+D*2,Y,D
DSQ X,Y+D,D:DSQ X+D*2,Y+D,D
DSQ X,Y+D*2,D:DSQ X+D,Y+D*2,D:DSQ X+D*2,Y+D*2,D
@FEND
END
ACLS
DSQ 80,0,243
3そうだね 未プレイ