<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <script type="text/javascript"> var allPoint =[] //棋盘上的点加第n种赢法组成三维数组 //allWins var allWins =[] var count = 0 //第0种赢法 //allWins 纵向五个子的赢法 for(var i = 0; i < 19; i ++){ allWins[i]=[] for(var j =0;j < 15;j ++){ for(var k =0;k < 5 ; k++){ allWins[i][j+k]=[] allWins[i][j+k][count] = true } count++ } } //allWins横向赢法 for(var i = 0; i < 15; i ++){ for(var j =0;j < 19; j ++){ for(var k =0;k < 5 ; k++){ allWins[i+k][j][count] = true } count++ } } //allWins 正斜线 for(var i = 0; i < 15; i ++){ for(var j =4;j < 19; j ++){ for(var k =0;k < 5 ; k++){ allWins[i+k][j-k][count] = true } count++ } } //allWins 反斜线 for(var i = 0; i < 15; i ++){ for(var j =0;j < 15; j ++){ for(var k =0;k < 5 ; k++){ allWins[i+k][j+k][count] = true } count++ } } alert(count) console.log('????????????'+count) //我的赢法统计 var myWins =[] for(var i = 0; i < count ; i++){ // myWins[i] = 0 console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!"+i) // console.log(i+'!!'+myWins[i]) } //对方赢法统计 var yourWins =[] for(var i = 0; i < count ; i++){ yourWins[i] = 0 } </script> </body> </html> 为什么 console.log('????????????'+count) 不会被执行 : console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!"+i) 不是从i等于0开始输出
行走的指尖
OlderSkee
相关分类