int dig(int x, int y) { if (!o[x][y]) windig(x, y); else dblclick(x, y); return 0; }
void dig(int x, int y) { if (!o[x][y]) windig(x, y); else dblclick(x, y); }
/* 双键 */ int dblclick(int x, int y) { int dx, dy; if(x<1|| x>30|| y<1|| y>16) return; if(!o[x][y]) return; if(num_mine_beside(x, y)!=num_mark_beside(x, y)) return; for(dx=x-1;dx<=x+1;dx++) for(dy=y-1;dy<=y+1;dy++) windig(dx, dy); }
/* 左键 */ int windig(int x, int y) { int dx, dy; if(x< 1|| x> 30|| y< 1|| y> 16) return; if(o[x][y]||m[x][y]) return; o[x][y]=1; winsh(x, y); if(a[x][y]) { show_mines(); gameover=1; return; } if(num_mine_beside(x, y)==0) { for(dx=x-1;dx<=x+1;dx++) for(dy=y-1;dy<=y+1;dy++) windig(dx, dy); } }