JS围棋半成品
// = 0 && cheseArray[x][y-1] == chessState.None){
return true;
}
if(y + 1 = 0 &&cheseArray[x - 1][y] == chessState.None){
return true;
}
return false;
}
//»ñµÃÏàÁڵļº·½Æå×Ó
function getContentedSelfChessArray(selectedChess){
var array = new Array();
var x = selectedChess.x;
var y = selectedChess.y;
if(y - 1 >= 0 && cheseArray[x][y - 1] == selectedChess.state){
var chess = new Object();
chess.x = x;
chess.y = y - 1;
chess.state = cheseArray[chess.x][chess.y];
array.push(chess);
}
if( x - 1 >= 0 && cheseArray[x - 1][y] == selectedChess.state){
var chess = new Object();
chess.x = x - 1;
chess.y = y;
chess.state = cheseArray[chess.x][chess.y];
array.push(chess);
}
if(y + 1 = 0 &&
cheseArray[x][y - 1] != selectedChess.state &&
cheseArray[x][y - 1] != chessState.None){
var chess = new Object();
chess.x = x;
chess.y = y - 1;
chess.state = cheseArray[chess.x][chess.y];
array.push(chess);
}
if(x - 1 >= 0 &&
cheseArray[x - 1][y] != selectedChess.state &&
cheseArray[x - 1][y] != chessState.None){
var chess = new Object();
chess.x = x - 1;
chess.y = y;
chess.state = cheseArray[chess.x][chess.y];
array.push(chess);
}
if(y + 1
最新文章
- javascript函数小练习
- vue相关的 helloword示例
- HDU 2222 AC自动机模板题
- GC之七--gc日志分析工具
- 浅析对象访问属性的";.";和";[]";方法区别
- struts不同session范围添加、访问属性
- mysql有回滚,php没有回滚的说法
- 使用Visio进行UML建模
- oracle decode函数使用方法
- 关于泥水佬的minihttp与MVC4的对比
- python操作redis-过期时间
- Scale-up(纵向扩展) vs Scale-out(横向扩展)
- 删除workspace下的vss的scc文件
- SSM-SpringMVC-28:SpringMVC类型转换之自定义日期类型转换器
- 配置MySQL的数据源
- npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6
- Zookeeper 在Windows下的安装过程及测试
- 配置iis支持json解析,配置ssi
- 在Github上搭建博客
- 5.UiScrollable API 详细介绍