1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
void split (int x, int y ,int x1 ,int y1 ,int [][]tableau)
{
if (x1 <= x || y1 <= y )
{
println( "c'est la fin "+x+" "+y+" " +x1+" "+y1);
}
else if ( homogene (x,y,x1,y1,tableau))
{
println( "garder cette zone");
}
else
{
split(x, y,(int) Math.floor( (x1-x)/2 ),(int) Math.floor( (y1-y)/2 ),tableau);
split(x,(int) Math.floor( (y1-y)/2 ),(int) Math.floor( (x1-x)/2 ),y1,tableau);
split((int) Math.floor( (x1-x)/2 ), y,x1,(int) Math.floor( (y1-y)/2 ),tableau);
split( (int) Math.floor( (x1-x)/2 ), (int) Math.floor( (y1-y),x1,y1,tableau);
}
} |