?? determineminemarkisrightorwrong.java
字號:
public class DetermineMineMarkIsRightOrWrong
{
FindAroundMineMarkNumber 確定周圍雷標數目者=new FindAroundMineMarkNumber();
int 周圍雷標數=0;
int 周圍雷數=0;
public DetermineMineMarkIsRightOrWrong()
{
}
public boolean 判斷雷標記是否正確(int i,int j,Block block[][],int 行數, int 列數)
{
int 錯誤=0;
boolean correct=false;
周圍雷標數=確定周圍雷標數目者.獲取周圍雷標記的數目(i,j,block,行數,列數);
周圍雷數=block[i][j].獲取周圍的雷數();
for(int k=Math.max(i-1,1);k<=Math.min(i+1,行數);k++)
{ for(int t=Math.max(j-1,1);t<=Math.min(j+1,列數);t++)
{ if(block[k][t].獲取探雷標記()==0&&block[k][t].判斷是否是雷()==false)
錯誤++;
}
}
if(錯誤>0)
{
correct=false;
}
else if(錯誤==0&&周圍雷標數==周圍雷數)
{
correct=true;
}
return correct;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -