Y*fldy+fly0; circle (cx...
Y*fldy+fly0; circle (cx, cy,3); schet[igrok]=schet[igrok]+1; filmas[fobl. x][fobl. y]=igrok; fishmas[fobl. x][fobl. y]=0; } } np++; }while ((np<4)&&(found!=1)); if(found==0) { if((obl[numel].x==nachx)&&(obl[numel].y==nachy)) nenash=1; numel--; } }while(nenash==0); return neta; } // ПОЛУЧЕНИЕ ОБЛАСТЕЙ (ЗАМКНУТЫХ КОНТУРОВ) void createfield() { int nachx, nachy, i,j, found, nenash, np, numel; float cx, cy; t_point fobl, pom, old; t_point obl[900]; int getobl[40][40]; for(i=0;i<=899;i++) {obl[i].x=0;obl[i].y=0;} nachx=masx; nachy=masy; numel=0; obl[numel]=point(nachx, nachy); nenash=0; for(i=0;i<=39;i++) for(j=0;j<=39;j++) getobl[i][j]=0; getobl[nachx][nachy]=1; do { found=0; np=0; do { fobl=point(obl[numel].x+fnapr[np].x, obl[numel].y+fnapr[np].y); if(fishmas[fobl. x][fobl. y]==igrok) if(getobl[fobl. x][fobl. y]!=1) if(fobl. x>=0) if (fobl. y>=0) if (fobl. x<=flmas) if(fobl. y<=flmas) // нашел точку { numel++; obl[numel]=point(fobl. x,fobl. y); getobl[fobl. x][fobl. y]=1; found=1; } if(fobl. x==nachx) if(fobl. y==nachy) if(obl[1].x!=obl[numel-1].x) if(obl[1].y!=obl[numel-1].y) // нашел область if(numel>2) { setcolor (colorof[igrok]);
Оставить комментарий