62,614
社区成员
发帖
与我相关
我的任务
分享
void showSurroundNum(){
//this.setBackground(new Color(225,238,210));
if(surround == -1){
this.setText("pop");
}else if(surround == 0){
for(Mine m:neighborMines){
m.showSurroundNum();//在这里递归的
}
}else {
this.setText((new Integer(surround)).toString());
}
}
void showSurroundNum(){
//this.setBackground(new Color(225,238,210));
if(surround == -1){
this.setText("pop");
}else if(surround == 0){
for(Mine m:neighborMines){
//在这里递归的
if(m.surround ==-1){
m..setText("pop");
}else{
m..setText((new Integer(surround)).toString());
}
}
}else {
this.setText((new Integer(surround)).toString());
}
}
void showSurroundNum(int level){//初次调用是参数level填0
if(level>1)return;//深度是1,那么进行一层的嵌套调用
//this.setBackground(new Color(225,238,210));
if(surround == -1){
this.setText("pop");
}else if(surround == 0){
for(Mine m:neighborMines){
m.showSurroundNum(level+1);//在这里递归的
}
}else {
this.setText((new Integer(surround)).toString());
}
}
void showSurroundNum(){
for(Mine m:neighborMines){
//this.setBackground(new Color(225,238,210));
if(surround == -1){
this.setText("pop");
}else if(surround == 0){
m.showSurroundNum();//在这里递归的
}else {
this.setText((new Integer(surround)).toString());
}
}
}