我正在制作西洋双陆棋游戏,并且我使用 2D 数组设置棋盘,如下所示:
stoneCounts[0][0]=stoneCounts[0][1]=stoneCounts[0][2]=stoneCounts[0][3]=stoneCounts[0][4] = W;
stoneCounts[11][0]=stoneCounts[11][1] = W;
stoneCounts[16][0]=stoneCounts[16][1]=stoneCounts[16][2]= W;
stoneCounts[18][0]=stoneCounts[18][1]=stoneCounts[18][2]=stoneCounts[18][3]=stoneCounts[18][4]=W;
stoneCounts[23][0]=stoneCounts[23][1]=stoneCounts[23][2]=stoneCounts[23][3]=stoneCounts[23][4] =B;
stoneCounts[12][0]=stoneCounts[12][1] = B;
stoneCounts[7][0]=stoneCounts[7][1]=stoneCounts[7][2]=stoneCounts[7][3]=stoneCounts[7][4] =B;
stoneCounts[5][0]=stoneCounts[5][1]=stoneCounts[5][2]= B;
例如,当玩家移动时,我怎样才能得到。'W' 在stoneCounts[0][1] 移动到stoneCounts[2][3]