資源簡介
掃雷源碼 + 素材 for (int x = 0; x < widthx; x++) {
for (int y = 0; y < highty; y++) {
gridBlank[x][y] = new Blank();
// grid[x][y].addMouseListener();
}
}
// 開始布雷
count = 40;
do {
for (int x = 0; x < widthx; x++) {
for (int y = 0; y 0) {
if (!(gridBlank[x][y] instanceof Bomb)) {
rdm = new Random().nextInt(widthx * highty / 40);
if (rdm == 1) {
gridBlank[x][y] = new Bomb();
count--;
}
} else {
continue;
}
} else {
break;
}
}
}
} while (count > 0);

代碼片段和文件信息
package?org.zy.af11018.MineSweep.main;
import?java.awt.Color;
import?java.awt.Dimension;
import?java.awt.GridBagLayout;
import?java.awt.GridLayout;
import?java.beans.Visibility;
import?javax.swing.ImageIcon;
import?javax.swing.JButton;
import?javax.swing.JPanel;
import?org.zy.af11018.MineSweep.ui.Mybtn;
public?class?Blank?extends?Mybtn{
private?ImageIcon?iconDeafualt;
private?ImageIcon?iconOpenedIcon;
private?boolean?visitable?=?true;
private?boolean?lable?=?false;
public?Blank(){
super(new?ImageIcon(“images/blank.gif“));
}
public?ImageIcon?getIconDeafualt()?{
return?iconDeafualt;
}
public?void?setIconDeafualt(ImageIcon?iconDeafualt)?{
this.iconDeafualt?=?iconDeafualt;
}
public?ImageIcon?getIconOpenedIcon()?{
return?iconOpenedIcon;
}
public?void?setIconOpenedIcon(ImageIcon?iconOpenedIcon)?{
this.iconOpenedIcon?=?iconOpenedIcon;
}
public?void?open(){
setIcon(new?ImageIcon(“images/0.gif“));
setEnabled(false);
setDisabledIcon(new?ImageIcon(“images/0.gif“));
}
public?boolean?isVisitable()?{
return?visitable;
}
public?void?setVisitable(boolean?visitable)?{
this.visitable?=?visitable;
}
public?boolean?isLabled(){
return??lable;
}
public?void?setisLabled(boolean?lable)?{
this.lable?=?lable;
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????301??2011-11-22?23:10??MineSweep\.classpath
?????文件????????385??2011-11-22?23:10??MineSweep\.project
?????文件????????629??2011-11-22?23:10??MineSweep\.settings\org.eclipse.jdt.core.prefs
?????文件???????1553??2011-12-17?11:04??MineSweep\bin\org\zy\af11018\MineSweep\main\Blank.class
?????文件????????898??2011-12-17?11:04??MineSweep\bin\org\zy\af11018\MineSweep\main\Bomb.class
?????文件????????543??2011-12-17?11:04??MineSweep\bin\org\zy\af11018\MineSweep\main\MineSweepMain.class
?????文件???????1583??2011-12-17?11:04??MineSweep\bin\org\zy\af11018\MineSweep\main\Number.class
?????文件???????1686??2011-12-17?11:04??MineSweep\bin\org\zy\af11018\MineSweep\ui\InfDia.class
?????文件????????946??2011-12-17?11:04??MineSweep\bin\org\zy\af11018\MineSweep\ui\MainContant.class
?????文件???????1307??2011-12-17?11:04??MineSweep\bin\org\zy\af11018\MineSweep\ui\Mainfr
?????文件???????1321??2011-12-17?11:04??MineSweep\bin\org\zy\af11018\MineSweep\ui\Mainfr
?????文件???????4337??2011-12-17?11:04??MineSweep\bin\org\zy\af11018\MineSweep\ui\Mainfr
?????文件???????9865??2011-12-17?11:04??MineSweep\bin\org\zy\af11018\MineSweep\ui\Mainfr
?????文件????????801??2011-12-17?11:04??MineSweep\bin\org\zy\af11018\MineSweep\ui\Mybtn.class
?????文件????????855??2011-11-25?13:48??MineSweep\images\0.gif
?????文件????????872??2011-11-25?13:48??MineSweep\images\1.gif
?????文件????????878??2011-11-25?13:48??MineSweep\images\2.gif
?????文件????????877??2011-11-25?13:48??MineSweep\images\3.gif
?????文件????????879??2011-11-25?13:48??MineSweep\images\4.gif
?????文件????????872??2011-11-25?13:48??MineSweep\images\5.gif
?????文件????????877??2011-11-25?13:48??MineSweep\images\6.gif
?????文件????????873??2011-11-25?13:48??MineSweep\images\7.gif
?????文件????????872??2011-11-25?13:48??MineSweep\images\8.gif
?????文件????????892??2011-11-25?13:48??MineSweep\images\ask.gif
?????文件????????892??2011-11-25?13:48??MineSweep\images\ask0.gif
?????文件????????873??2011-11-25?13:48??MineSweep\images\ask1.gif
?????文件????????873??2011-11-25?13:48??MineSweep\images\ask2.gif
?????文件????????873??2011-11-25?13:48??MineSweep\images\blank.gif
?????文件????????887??2011-11-25?13:48??MineSweep\images\blood.gif
?????文件????????893??2011-11-25?13:48??MineSweep\images\d0.gif
............此處省略58個文件信息
- 上一篇:stata基尼系數算法
- 下一篇:萬能的BDC程序
評論
共有 條評論