Advertisement
Guest User

Untitled

a guest
Feb 5th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. Function floodfill(x,y,old_color,new_color:Integer; map : Map_gen) : Integer;
  2.  
  3. var
  4. x2,y2:Integer;
  5.  
  6. begin
  7. if map[x,y] <> old_color then Exit();
  8.  
  9. map[x,y] := new_color;
  10. for x2 := -1 to 1 do
  11. begin
  12. for y2 := -1 to 1 do
  13. begin
  14. floodfill(x + x2,y + y2,old_color,new_color,map)
  15. end;
  16. end;
  17. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement