template<typename TargetPR, typename ReplacementPR>
void GeneralFloodFill(int x, int y, TargetPR & targ, ReplacementPR & repl)
{
if(!targ(x,y))
return;
repl(x,y);
GeneralFloodFill(x-1,y,targ,repl);
GeneralFloodFill(x+1,y,targ,repl);
GeneralFloodFill(x,y-1,targ,repl);
GeneralFloodFill(x,y+1,targ,repl);
}