home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
PROGRAMS
/
LIST
/
HB15-PT1.ARK
/
FCHAR.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-10-21
|
2KB
|
47 lines
{ Copyright (C) 1986 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }
procedure FillChar ( lm, rm : integer ) ;
{ find and fill voids ala Game of Life algorithm }
var
x, xn, xx : integer ;
y, yn, yx : integer ;
nOff : integer ;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
function VoidTest ( x, y : integer ) : boolean ;
{ test for isolated character off }
begin
if not TestPad (x,y) then
nOff := nOff + 1 ;
VoidTest := nOff < 3
end ;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
begin
{ fill single and double voids }
xn := xScale * lm + 1 ;
xx := xScale * rm ;
for x := xn to xx do begin
yn := yStripen + 1 ;
yx := yStripex - 1 ;
for y := yn to yx do begin
if not TestPad (x,y) then begin
nOff := 0 ;
if VoidTest (x-1,y+1) then
if VoidTest (x ,y+1) then
if VoidTest (x+1,y+1) then
if VoidTest (x-1,y ) then
if VoidTest (x+1,y ) then
if VoidTest (x-1,y-1) then
if VoidTest (x ,y-1) then
if VoidTest (x+1,y-1) then
SetPad (x,y)
end
end
end
end ;
{ Copyright (C) 1986 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }