java简单迷宫游戏代码 java写迷宫游戏( 三 )


out.println(store[row]);
out.println();
}
voidpushUnvisited(introw,intcol){
if(store[row][col]==passage||store[row][col]==exitMarker)
mazeStack.push(newMazeCell(row,col));
}
voidexitMaze(PrintStreamout){
introw=0,col=0;
currentCell=entryCell;
out.println();
while(!currentCell.equals(exitCell)){
row=currentCell.x;
col=currentCell.y;
display(System.out);//printasnapshot;
if(!currentCell.equals(entryCell))
store[row][col]=visited;
pushUnvisited(row-1,col);
pushUnvisited(row+1,col);
pushUnvisited(row,col-1);
pushUnvisited(row,col+1);
if(mazeStack.isEmpty()){
display(out);
out.println("Failure");
return;
}
elsecurrentCell=(MazeCell)mazeStack.pop();
}
display(out);
out.println("Success");
}
staticpublicvoidmain(Stringargs[]){
(newMaze()).exitMaze(System.out);
}
}
试一下这个java简单迷宫游戏代码,是不是你想要java简单迷宫游戏代码的……
___________________________________________________________________________________________________________________________
html代码?你是说你要做一个java applet的网页迷宫小游戏??
【java简单迷宫游戏代码 java写迷宫游戏】java简单迷宫游戏代码的介绍就聊到这里吧,感谢你花时间阅读本站内容 , 更多关于java写迷宫游戏、java简单迷宫游戏代码的信息别忘了在本站进行查找喔 。

推荐阅读