Абадон Громов
Оракул
(69672)
1 год назад
int l = level;
double posx, posy, si1;
String strix;
int l1;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
posx = cx+i*si-si;
posy = cy+j*si-si;
strix = toString(i)+toString(j);
if ((Math.abs((i-1))+Math.abs((j-1))) > 0) {
if (l == 1) {
counter = counter+1;
model.component("comp1").geom("geom1").create("sq"+strix+"C"+toString(counter), "Square");
with(model.component("comp1").geom("geom1").feature("sq"+strix+"C"+toString(counter)));
set("base", "center");
set("size", new double[]{si});
set("pos", new double[]{posx, posy});
endwith();
model.component("comp1").geom("geom1").feature("sq"+strix+"C"+toString(counter)).label("Square"+strix+"C"+toString(counter));
} else {
l1 = l-1;
si1 = si/3;
carpet(l1, posx, posy, si1);
}
}
}
}
(Вк https://vk.com/losay )
Тест 1: https://www.schooltests.ru/09_peryshkin/17_pryam-e_i_krivol-e_dv-e.pdf
Тест 2: https://www.schooltests.ru/09_peryshkin/12__3_zakon_nutona.pdf