10 REM *************** 20 REM Filling program 30 REM *************** 40 REM NC100/200 Version 1 50 REM Downloaded from Tim's NC Users' Site 60 REM http://www.ncus.org.uk 70 REM startx%,starty% are the co-ordinates of the shape to be filled. 80 DIM listx%(500),listy%(500) 90 DEF PROCfillfrom(startx%,starty%) 100 FORI=1 TO 500:listx%(I)=0:listy%(I)=0:NEXT 110 first%=1:last%=0 120 background%=POINT(startx%,starty%) 130 PROCfill(startx%,starty%) 140 REPEAT 150 PROCunlist 160 PROCfill(x%,y%+1) 170 PROCfill(x%,y%-1) 180 PROCfill(x%+1,y%) 190 PROCfill(x%-1,y%) 200 UNTILfirst%=(last%+1) MOD 500 210 ENDPROC 220 DEF PROCfill(x%,y%) 230 IF POINT(x%,y%)<>background% ENDPROC 240 IF background%=0 PLOT69,x%,y% ELSE PLOT71,x%,y% 250 PROClist(x%,y%) 260 ENDPROC 270 DEF PROClist(x%,y%) 280 last%=(last%+1) MOD 500 290 listx%(last%)=x% 300 listy%(last%)=y% 310 ENDPROC 320 DEF PROCunlist 330 x%=listx%(first%) 340 y%=listy%(first%) 350 first%=(first%+1) MOD 500 360 ENDPROC