#include #include #include #include char arr[100000]; void find(int x, int y, int w, int h) { char l = arr[x+y*w - 1]; char r = arr[x+y*w + 1]; char u = arr[x+(y-1)*w]; char d = arr[x+(y+1)*w]; /* printf("%s", arr); */ /* printf("find %d %d\n", x, y);*/ if(tolower(arr[x+y*w])!='x') arr[x+y*w]='a'; else arr[x+y*w]='x'; if( ( l =='X' || l=='*') && (x>0) ) find(x-1, y, w, h); if( ( r =='X' || r=='*') && (x+10) ) find(x, y-1, w, h); if( ( d == 'X' || d=='*') && (y+10) ) around++; if( (r=='z') && (x+10) ) around++; if( (d=='z') && (y+10) ) anz += cnt( x-1, y, w, h); if( ( r =='a' || r=='x') && (x+10) ) anz += cnt( x, y-1, w, h); if( ( d == 'a' || d=='x') && (y+10 && (pos<10)) { while(dice[pos]>0) { printf("%d",pos); dice[pos]--; found--; if(found>0) printf(" "); } pos++; } printf("\n\n"); prob++; } }