'class'or'interface'expected是什么
package nicholas.game.chess;class FirstAI extends ChessPlayer {
private ChessModel model[][][];
private StepStack stack;
private Step step;
private int layer;
private int turn;
protected GameRule gameRule;
public FirstAI(int t) {
super(false);
stack = new StepStack();
layer = 7;
// layer = 3;
turn = t;
}
public String getName() {
return "ColinRobot";
}
public Step getNextStep(ChessModel m[][][]) {
//algo
model = m;
System.out.println("max="+getLayerValue(0));
stack.removeAll();
return step;
}
private int getLayerValue(int lay) {
if(lay>layer) {
return -1*getModelValue();
}
int value = 0;
int max = -2000;
int decision;
for(int z=0;z<3;z++) {
for(int y=0;y<3;y++) {
for(int x=0;x<3;x++) {
if((x==1&&y==1)||model[z][y][x].isOccupied()) continue;
model[z][y][x].acceptChessman(Chessman.CHESS[(turn+lay)%2]);
decision = gameRule.checkStep(model[z][y][x], model);
switch(decision) {
case 0://win
stack.add(new Step(model[z][y][x],decision));
value = 1000;
break;
case 3://tiaodan|gan
gameRule.checkDecision(model[z][y][x],1,model);
stack.add(new Step(model[z][y][x],1));
value = 660;
break;
case 1://tiaodan
stack.add(new Step(model[z][y][x],decision));
value = 660;
break;
case 2://gan
stack.add(new Step(model[z][y][x],decision));
value = 320;
break;
default://tiaodan,gan,none
stack.add(new Step(model[z][y][x],decision));
value = -1*getLayerValue(lay+1);
}
if(value>max) {
max = value;
if(lay==0) {
//first layer, save step
System.out.println("max="+max);
step = stack.getTop();
}
}
//remove chessman
gameRule.undoStep(stack.remove(),model);
if(max==1000) return max;
}
}
}
return max;
}
private int getModelValue() {
return 3;
}
public void setGameRule(GameRule rule) {
gameRule = rule;
}
}
'class'or'interface'expexted at line 20 (20:1)
1 error