Still the first one with mouse "draw":
function floodfill (x,y,bgr,bgg,bgb,penr,peng,penb)
if (screenred (x,y) == bgr) and (screengreen (x,y) == bgg) and (screenblue (x,y) == bgb) then
colour (penr,peng,penb)
dot (x,y)
floodfill (x+1,y,bgr,bgg,bgb,penr,peng,penb)
floodfill (x-1,y,bgr,bgg,bgb,penr,peng,penb)
floodfill (x,y+1,bgr,bgg,bgb,penr,peng,penb)
floodfill (x,y-1,bgr,bgg,bgb,penr,peng,penb)
end
end
screen (800,600,0,"FloodFill")
backcolour (200,200,200)
cls()
colour (0,0,100)
for i=1,20 do
circle (int(rnd()*800)+1,int(rnd()*600)+1,int (rnd()*150))
end
sync()
repeat
key=getkey()
mx =mousex()
my=mousey()
if mouseb()==1 then
floodfill (mx,my,200,200,200,250,250,0)
end
sync()
until key == 27
closewindow()