[ create a new paste ] login | about

Link: http://codepad.org/ihWCZkIH    [ raw code | output | fork ]

C++, pasted on Feb 7:
1
2
3
4
5
6
7
8
9
10
11
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);
}


Output:
1
2
In function `_start':
undefined reference to `main'


Create a new paste based on this one


Comments: