lihongxun945 / gobang

javascript gobang AI,JS五子棋AI,源码+教程,基于Alpha-Beta剪枝算法(不是神经网络)

Home Page:http://gobang2.light7.cn/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

evaluate-point中的bug

afkbrb opened this issue · comments

evaluate-point.js中220行

if(empty == -1 && (x<len-1 && y<len-1) && board[x+1][y-1] == role)

应该写成

if (empty == -1 && (x < len - 1 && y > 0) && board[x + 1][y - 1] == role)

类似地,244行

if(empty == -1 && (x>0 && y>0) && board[x-1][y+1] == role)

应该写成

if (empty == -1 && (x > 0 && y < len - 1) && board[x - 1][y + 1] == role)